From 97ffa7c56984decad799953fa7a41721cb4c3a1b Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 1 Apr 2026 16:00:29 +0800 Subject: [PATCH 1/3] generated from swagger:347957f6f5b15889f48000bbca92b7ed1d759dca --- sdk/sql/azure-mgmt-sql/CHANGELOG.md | 4 + sdk/sql/azure-mgmt-sql/_metadata.json | 8 +- .../azure-mgmt-sql/apiview-properties.json | 1638 +- .../azure/mgmt/sql/_configuration.py | 6 + .../azure/mgmt/sql/_sql_management_client.py | 739 +- .../azure/mgmt/sql/_utils/serialization.py | 19 +- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../azure/mgmt/sql/aio/_configuration.py | 6 + .../mgmt/sql/aio/_sql_management_client.py | 744 +- .../azure/mgmt/sql/aio/operations/__init__.py | 288 +- ...hort_term_retention_policies_operations.py | 210 +- .../operations/_capabilities_operations.py | 12 +- .../_data_masking_policies_operations.py | 162 +- .../_data_masking_rules_operations.py | 202 +- ...ta_warehouse_user_activities_operations.py | 166 +- ...d_threat_protection_settings_operations.py | 38 +- .../_database_advisors_operations.py | 24 +- .../_database_automatic_tuning_operations.py | 16 +- ...abase_blob_auditing_policies_operations.py | 38 +- .../_database_columns_operations.py | 51 +- ...tabase_encryption_protectors_operations.py | 32 +- .../_database_extensions_operations.py | 203 +- .../_database_operations_operations.py | 28 +- ...database_recommended_actions_operations.py | 78 +- .../_database_schemas_operations.py | 30 +- ...base_security_alert_policies_operations.py | 196 +- ...ability_assessment_baselines_operations.py | 38 +- ...lity_assessment_execute_scan_operations.py | 16 +- ...ty_assessment_rule_baselines_operations.py | 46 +- ...ility_assessment_scan_result_operations.py | 30 +- ...lnerability_assessment_scans_operations.py | 30 +- ...ability_assessments_settings_operations.py | 30 +- .../operations/_database_tables_operations.py | 30 +- .../operations/_database_usages_operations.py | 22 +- ...ty_assessment_rule_baselines_operations.py | 24 +- ...lnerability_assessment_scans_operations.py | 306 +- ...se_vulnerability_assessments_operations.py | 196 +- .../aio/operations/_databases_operations.py | 380 +- .../operations/_deleted_servers_operations.py | 171 +- ...tributed_availability_groups_operations.py | 97 +- .../_elastic_pool_activities_operations.py | 130 - ...tic_pool_database_activities_operations.py | 131 - .../_elastic_pool_operations_operations.py | 144 +- .../operations/_elastic_pools_operations.py | 250 +- .../_encryption_protectors_operations.py | 62 +- .../_endpoint_certificates_operations.py | 30 +- ...abase_blob_auditing_policies_operations.py | 38 +- ...erver_blob_auditing_policies_operations.py | 46 +- .../operations/_failover_groups_operations.py | 120 +- .../operations/_firewall_rules_operations.py | 404 +- .../_geo_backup_policies_operations.py | 332 +- .../_instance_failover_groups_operations.py | 94 +- ...> _instance_pool_operations_operations.py} | 179 +- .../operations/_instance_pools_operations.py | 99 +- .../_ipv6_firewall_rules_operations.py | 46 +- .../aio/operations/_job_agents_operations.py | 78 +- .../operations/_job_credentials_operations.py | 46 +- .../operations/_job_executions_operations.py | 425 +- .../_job_private_endpoints_operations.py | 62 +- .../_job_step_executions_operations.py | 32 +- .../aio/operations/_job_steps_operations.py | 391 +- .../_job_target_executions_operations.py | 227 +- .../_job_target_groups_operations.py | 46 +- .../operations/_job_versions_operations.py | 30 +- .../sql/aio/operations/_jobs_operations.py | 46 +- .../_ledger_digest_uploads_operations.py | 206 +- ..._long_term_retention_backups_operations.py | 279 +- ...ion_managed_instance_backups_operations.py | 586 +- ...long_term_retention_policies_operations.py | 37 +- .../_maintenance_window_options_operations.py | 8 +- .../_maintenance_windows_operations.py | 4 +- ...hort_term_retention_policies_operations.py | 210 +- ...d_threat_protection_settings_operations.py | 38 +- .../_managed_database_columns_operations.py | 51 +- ...ged_database_move_operations_operations.py | 30 +- .../_managed_database_queries_operations.py | 30 +- ...commended_sensitivity_labels_operations.py | 8 +- ...ged_database_restore_details_operations.py | 8 +- .../_managed_database_schemas_operations.py | 30 +- ...base_security_alert_policies_operations.py | 196 +- ...ged_database_security_events_operations.py | 22 +- ..._database_sensitivity_labels_operations.py | 656 +- .../_managed_database_tables_operations.py | 30 +- ..._transparent_data_encryption_operations.py | 188 +- ...ty_assessment_rule_baselines_operations.py | 24 +- ...lnerability_assessment_scans_operations.py | 402 +- ...se_vulnerability_assessments_operations.py | 196 +- .../_managed_databases_operations.py | 286 +- ...aged_instance_administrators_operations.py | 62 +- ...d_threat_protection_settings_operations.py | 46 +- ...zure_ad_only_authentications_operations.py | 204 +- .../_managed_instance_dtcs_operations.py | 40 +- ...stance_encryption_protectors_operations.py | 290 +- .../_managed_instance_keys_operations.py | 62 +- ...long_term_retention_policies_operations.py | 294 +- ..._managed_instance_operations_operations.py | 38 +- ...private_endpoint_connections_operations.py | 204 +- ...tance_private_link_resources_operations.py | 30 +- ...ed_instance_tde_certificates_operations.py | 16 +- ...ce_vulnerability_assessments_operations.py | 190 +- .../_managed_instances_operations.py | 537 +- ...anaged_ledger_digest_uploads_operations.py | 62 +- ...hort_term_retention_policies_operations.py | 210 +- .../_managed_server_dns_aliases_operations.py | 78 +- ...rver_security_alert_policies_operations.py | 210 +- ...ty_perimeter_configurations_operations.py} | 368 +- .../mgmt/sql/aio/operations/_operations.py | 22 +- .../_outbound_firewall_rules_operations.py | 302 +- ...private_endpoint_connections_operations.py | 62 +- .../_private_link_resources_operations.py | 30 +- ...commended_sensitivity_labels_operations.py | 8 +- .../_recoverable_databases_operations.py | 30 +- ...ecoverable_managed_databases_operations.py | 30 +- .../_replication_links_operations.py | 129 +- ...restorable_dropped_databases_operations.py | 30 +- ...le_dropped_managed_databases_operations.py | 30 +- .../operations/_restore_points_operations.py | 54 +- .../_sensitivity_labels_operations.py | 482 +- ...d_threat_protection_settings_operations.py | 46 +- .../operations/_server_advisors_operations.py | 24 +- .../_server_automatic_tuning_operations.py | 16 +- ...rver_azure_ad_administrators_operations.py | 204 +- ...zure_ad_only_authentications_operations.py | 204 +- ...erver_blob_auditing_policies_operations.py | 46 +- ...server_configuration_options_operations.py | 40 +- .../_server_connection_policies_operations.py | 186 +- ...erver_dev_ops_audit_settings_operations.py | 46 +- .../_server_dns_aliases_operations.py | 216 +- .../aio/operations/_server_keys_operations.py | 62 +- .../_server_operations_operations.py | 22 +- ...rver_security_alert_policies_operations.py | 210 +- .../_server_trust_certificates_operations.py | 76 +- .../_server_trust_groups_operations.py | 221 +- .../operations/_server_usages_operations.py | 26 +- ...er_vulnerability_assessments_operations.py | 188 +- .../sql/aio/operations/_servers_operations.py | 100 +- .../aio/operations/_sql_agent_operations.py | 16 +- ...rability_assessment_baseline_operations.py | 30 +- ...ability_assessment_baselines_operations.py | 8 +- ...lity_assessment_execute_scan_operations.py | 16 +- ...ity_assessment_rule_baseline_operations.py | 38 +- ...ty_assessment_rule_baselines_operations.py | 8 +- ...ility_assessment_scan_result_operations.py | 30 +- ...lnerability_assessment_scans_operations.py | 30 +- ...ql_vulnerability_assessments_operations.py | 8 +- ...ability_assessments_settings_operations.py | 38 +- ...p_managed_instance_schedules_operations.py | 46 +- .../_subscription_usages_operations.py | 30 +- .../_synapse_link_workspaces_operations.py | 22 +- .../aio/operations/_sync_agents_operations.py | 229 +- .../aio/operations/_sync_groups_operations.py | 881 +- .../operations/_sync_members_operations.py | 439 +- .../_tde_certificates_operations.py | 16 +- .../aio/operations/_time_zones_operations.py | 30 +- ...transparent_data_encryptions_operations.py | 328 +- .../sql/aio/operations/_usages_operations.py | 22 +- .../_virtual_clusters_operations.py | 300 +- .../_virtual_network_rules_operations.py | 200 +- .../_workload_classifiers_operations.py | 214 +- .../operations/_workload_groups_operations.py | 206 +- .../azure/mgmt/sql/models/__init__.py | 120 +- .../azure/mgmt/sql/models/_models_py3.py | 3271 +- .../models/_sql_management_client_enums.py | 214 +- .../azure/mgmt/sql/operations/__init__.py | 288 +- ...hort_term_retention_policies_operations.py | 256 +- .../operations/_capabilities_operations.py | 14 +- .../_data_masking_policies_operations.py | 200 +- .../_data_masking_rules_operations.py | 242 +- ...ta_warehouse_user_activities_operations.py | 198 +- ...d_threat_protection_settings_operations.py | 44 +- .../_database_advisors_operations.py | 30 +- .../_database_automatic_tuning_operations.py | 20 +- ...abase_blob_auditing_policies_operations.py | 44 +- .../_database_columns_operations.py | 57 +- ...tabase_encryption_protectors_operations.py | 52 +- .../_database_extensions_operations.py | 253 +- .../_database_operations_operations.py | 39 +- ...database_recommended_actions_operations.py | 84 +- .../_database_schemas_operations.py | 34 +- ...base_security_alert_policies_operations.py | 236 +- ...ability_assessment_baselines_operations.py | 44 +- ...lity_assessment_execute_scan_operations.py | 26 +- ...ty_assessment_rule_baselines_operations.py | 62 +- ...ility_assessment_scan_result_operations.py | 34 +- ...lnerability_assessment_scans_operations.py | 34 +- ...ability_assessments_settings_operations.py | 34 +- .../operations/_database_tables_operations.py | 34 +- .../operations/_database_usages_operations.py | 24 +- ...ty_assessment_rule_baselines_operations.py | 38 +- ...lnerability_assessment_scans_operations.py | 344 +- ...se_vulnerability_assessments_operations.py | 252 +- .../sql/operations/_databases_operations.py | 498 +- .../operations/_deleted_servers_operations.py | 189 +- ...tributed_availability_groups_operations.py | 111 +- .../_elastic_pool_activities_operations.py | 165 - ...tic_pool_database_activities_operations.py | 165 - .../_elastic_pool_operations_operations.py | 182 +- .../operations/_elastic_pools_operations.py | 347 +- .../_encryption_protectors_operations.py | 78 +- .../_endpoint_certificates_operations.py | 34 +- ...abase_blob_auditing_policies_operations.py | 44 +- ...erver_blob_auditing_policies_operations.py | 52 +- .../operations/_failover_groups_operations.py | 144 +- .../operations/_firewall_rules_operations.py | 462 +- .../_geo_backup_policies_operations.py | 376 +- .../_instance_failover_groups_operations.py | 114 +- ...> _instance_pool_operations_operations.py} | 217 +- .../operations/_instance_pools_operations.py | 119 +- .../_ipv6_firewall_rules_operations.py | 62 +- .../sql/operations/_job_agents_operations.py | 96 +- .../operations/_job_credentials_operations.py | 62 +- .../operations/_job_executions_operations.py | 541 +- .../_job_private_endpoints_operations.py | 78 +- .../_job_step_executions_operations.py | 36 +- .../sql/operations/_job_steps_operations.py | 471 +- .../_job_target_executions_operations.py | 295 +- .../_job_target_groups_operations.py | 62 +- .../operations/_job_versions_operations.py | 34 +- .../mgmt/sql/operations/_jobs_operations.py | 62 +- .../_ledger_digest_uploads_operations.py | 250 +- ..._long_term_retention_backups_operations.py | 327 +- ...ion_managed_instance_backups_operations.py | 809 +- ...long_term_retention_policies_operations.py | 43 +- .../_maintenance_window_options_operations.py | 10 +- .../_maintenance_windows_operations.py | 8 +- ...hort_term_retention_policies_operations.py | 258 +- ...d_threat_protection_settings_operations.py | 44 +- .../_managed_database_columns_operations.py | 57 +- ...ged_database_move_operations_operations.py | 34 +- .../_managed_database_queries_operations.py | 34 +- ...commended_sensitivity_labels_operations.py | 13 +- ...ged_database_restore_details_operations.py | 10 +- .../_managed_database_schemas_operations.py | 34 +- ...base_security_alert_policies_operations.py | 236 +- ...ged_database_security_events_operations.py | 24 +- ..._database_sensitivity_labels_operations.py | 883 +- .../_managed_database_tables_operations.py | 34 +- ..._transparent_data_encryption_operations.py | 228 +- ...ty_assessment_rule_baselines_operations.py | 38 +- ...lnerability_assessment_scans_operations.py | 442 +- ...se_vulnerability_assessments_operations.py | 252 +- .../_managed_databases_operations.py | 357 +- ...aged_instance_administrators_operations.py | 78 +- ...d_threat_protection_settings_operations.py | 52 +- ...zure_ad_only_authentications_operations.py | 256 +- .../_managed_instance_dtcs_operations.py | 46 +- ...stance_encryption_protectors_operations.py | 344 +- .../_managed_instance_keys_operations.py | 78 +- ...long_term_retention_policies_operations.py | 343 +- ..._managed_instance_operations_operations.py | 52 +- ...private_endpoint_connections_operations.py | 260 +- ...tance_private_link_resources_operations.py | 34 +- ...ed_instance_tde_certificates_operations.py | 21 +- ...ce_vulnerability_assessments_operations.py | 246 +- .../_managed_instances_operations.py | 642 +- ...anaged_ledger_digest_uploads_operations.py | 70 +- ...hort_term_retention_policies_operations.py | 246 +- .../_managed_server_dns_aliases_operations.py | 96 +- ...rver_security_alert_policies_operations.py | 250 +- ...ty_perimeter_configurations_operations.py} | 428 +- .../azure/mgmt/sql/operations/_operations.py | 24 +- .../_outbound_firewall_rules_operations.py | 343 +- ...private_endpoint_connections_operations.py | 78 +- .../_private_link_resources_operations.py | 34 +- ...commended_sensitivity_labels_operations.py | 13 +- .../_recoverable_databases_operations.py | 34 +- ...ecoverable_managed_databases_operations.py | 34 +- .../_replication_links_operations.py | 153 +- ...restorable_dropped_databases_operations.py | 34 +- ...le_dropped_managed_databases_operations.py | 34 +- .../operations/_restore_points_operations.py | 70 +- .../_sensitivity_labels_operations.py | 601 +- ...d_threat_protection_settings_operations.py | 52 +- .../operations/_server_advisors_operations.py | 30 +- .../_server_automatic_tuning_operations.py | 20 +- ...rver_azure_ad_administrators_operations.py | 254 +- ...zure_ad_only_authentications_operations.py | 254 +- ...erver_blob_auditing_policies_operations.py | 52 +- ...server_configuration_options_operations.py | 46 +- .../_server_connection_policies_operations.py | 226 +- ...erver_dev_ops_audit_settings_operations.py | 52 +- .../_server_dns_aliases_operations.py | 256 +- .../sql/operations/_server_keys_operations.py | 78 +- .../_server_operations_operations.py | 24 +- ...rver_security_alert_policies_operations.py | 250 +- .../_server_trust_certificates_operations.py | 92 +- .../_server_trust_groups_operations.py | 267 +- .../operations/_server_usages_operations.py | 30 +- ...er_vulnerability_assessments_operations.py | 242 +- .../sql/operations/_servers_operations.py | 118 +- .../sql/operations/_sql_agent_operations.py | 20 +- ...rability_assessment_baseline_operations.py | 34 +- ...ability_assessment_baselines_operations.py | 10 +- ...lity_assessment_execute_scan_operations.py | 26 +- ...ity_assessment_rule_baseline_operations.py | 44 +- ...ty_assessment_rule_baselines_operations.py | 18 +- ...ility_assessment_scan_result_operations.py | 34 +- ...lnerability_assessment_scans_operations.py | 34 +- ...ql_vulnerability_assessments_operations.py | 18 +- ...ability_assessments_settings_operations.py | 44 +- ...p_managed_instance_schedules_operations.py | 62 +- .../_subscription_usages_operations.py | 34 +- .../_synapse_link_workspaces_operations.py | 24 +- .../sql/operations/_sync_agents_operations.py | 277 +- .../sql/operations/_sync_groups_operations.py | 1391 +- .../operations/_sync_members_operations.py | 513 +- .../_tde_certificates_operations.py | 21 +- .../sql/operations/_time_zones_operations.py | 34 +- ...transparent_data_encryptions_operations.py | 408 +- .../mgmt/sql/operations/_usages_operations.py | 24 +- .../_virtual_clusters_operations.py | 355 +- .../_virtual_network_rules_operations.py | 244 +- .../_workload_classifiers_operations.py | 256 +- .../operations/_workload_groups_operations.py | 260 +- .../azure-mgmt-sql/code_report_swagger.json | 125814 +++++++++++++++ .../administrator_create_or_update.py | 2 +- .../generated_samples/administrator_delete.py | 2 +- .../generated_samples/administrator_get.py | 2 +- .../generated_samples/administrator_list.py | 2 +- .../azure_ad_only_auth_create_or_update.py | 2 +- .../azure_ad_only_auth_delete.py | 2 +- .../azure_ad_only_auth_get.py | 2 +- .../azure_ad_only_auth_list.py | 2 +- .../cancel_database_operation.py | 2 +- .../cancel_elastic_pool_operation.py | 2 +- .../generated_samples/cancel_job_execution.py | 2 +- .../cancel_managed_instance_operation.py | 2 +- ..._long_term_retention_backup_access_tier.py | 2 +- ...name_availability_server_already_exists.py | 2 +- ...heck_name_availability_server_available.py | 2 +- .../check_name_availability_server_invalid.py | 2 +- .../column_sensitivity_label_create_max.py | 3 +- .../column_sensitivity_label_delete.py | 2 +- .../column_sensitivity_label_get.py | 2 +- .../columns_list_by_database_max.py | 2 +- .../columns_list_by_database_min.py | 2 +- ...se_configured_backup_storage_redundancy.py | 2 +- .../create_database_copy_mode.py | 2 +- .../create_database_default_enclave.py | 2 +- .../create_database_default_mode.py | 2 +- ...mode_with_keys_and_encryption_protector.py | 2 +- ...ys_and_versionless_encryption_protector.py | 64 + .../create_database_ledger.py | 2 +- ...eate_database_maintenance_configuration.py | 2 +- .../generated_samples/create_database_min.py | 2 +- .../create_database_named_replica.py | 2 +- .../create_database_pitr_mode.py | 2 +- .../create_database_secondary_mode.py | 2 +- .../create_database_standby_mode.py | 2 +- .../create_database_vbs_enclave.py | 2 +- .../create_database_with_availability_zone.py | 2 +- ...with_encryption_protector_auto_rotation.py | 61 + ...ate_dw_database_cross_subscription_pitr.py | 2 +- ...dw_database_cross_subscription_recovery.py | 2 +- ..._dw_database_cross_subscription_restore.py | 2 +- ...ate_elastic_pool_with_availability_zone.py | 2 +- .../generated_samples/create_job_execution.py | 2 +- .../create_managed_database_ledger.py | 2 +- .../create_or_update_database_extensions.py | 2 +- .../create_or_update_instance_pool_max.py | 2 +- .../create_or_update_instance_pool_min.py | 2 +- .../create_or_update_job_agent.py | 2 +- ...reate_or_update_job_agent_with_identity.py | 56 + .../create_or_update_job_agent_with_sku.py | 51 + .../create_or_update_job_credential.py | 2 +- .../create_or_update_job_execution.py | 2 +- .../create_or_update_job_max.py | 2 +- .../create_or_update_job_min.py | 59 + .../create_or_update_job_private_endpoint.py | 2 +- .../create_or_update_job_step_max.py | 2 +- .../create_or_update_job_step_min.py | 3 +- .../create_or_update_job_target_group_max.py | 2 +- .../create_or_update_job_target_group_min.py | 2 +- .../create_or_update_maintenance_windows.py | 2 +- ...reate_or_update_workload_classifier_max.py | 2 +- ...reate_or_update_workload_classifier_min.py | 2 +- .../create_or_update_workload_group_max.py | 2 +- .../create_or_update_workload_group_min.py | 2 +- ...ate_vcore_database_by_service_objective.py | 2 +- ...ate_vcore_database_by_sku_name_capacity.py | 2 +- ...ata_masking_policy_create_or_update_max.py | 3 +- ...ata_masking_policy_create_or_update_min.py | 3 +- .../data_masking_policy_get.py | 3 +- ...sking_rule_create_or_update_default_max.py | 3 +- ...sking_rule_create_or_update_default_min.py | 3 +- ...ta_masking_rule_create_or_update_number.py | 3 +- ...data_masking_rule_create_or_update_text.py | 3 +- ... => data_masking_rule_list_by_database.py} | 5 +- .../data_warehouse_restore_points_get.py | 2 +- ...rehouse_restore_points_list_by_database.py | 2 +- ...d_threat_protection_settings_create_max.py | 2 +- ...d_threat_protection_settings_create_min.py | 2 +- ...advanced_threat_protection_settings_get.py | 2 +- ...at_protection_settings_list_by_database.py | 2 +- .../generated_samples/database_advisor_get.py | 2 +- .../database_advisor_list.py | 2 +- .../database_advisor_update.py | 2 +- .../database_auditing_settings_list.py | 2 +- .../database_automatic_tuning_get.py | 2 +- .../database_automatic_tuning_update_max.py | 2 +- .../database_automatic_tuning_update_min.py | 2 +- ...abase_azure_monitor_auditing_create_min.py | 2 +- .../database_blob_auditing_create_max.py | 2 +- .../database_blob_auditing_create_min.py | 2 +- .../database_blob_auditing_get.py | 2 +- .../generated_samples/database_column_get.py | 2 +- .../database_column_list_by_table.py | 2 +- ...atabase_encryption_protector_revalidate.py | 2 +- .../database_encryption_protector_revert.py | 2 +- ...atabase_extended_auditing_settings_list.py | 2 +- .../database_metrics_list_with_filter.py | 46 - .../database_recommended_action_get.py | 2 +- .../database_recommended_action_list.py | 2 +- ...database_recommended_action_list_expand.py | 2 +- .../database_recommended_action_update.py | 2 +- .../database_restore_points_delete.py | 2 +- .../database_restore_points_get.py | 2 +- ...atabase_restore_points_list_by_database.py | 2 +- .../database_restore_points_post.py | 2 +- .../generated_samples/database_schema_get.py | 2 +- .../database_schema_list_by_database.py | 2 +- .../database_security_alert_create_max.py | 4 +- .../database_security_alert_create_min.py | 4 +- .../database_security_alert_get.py | 4 +- ...atabase_security_alert_list_by_database.py | 2 +- ...l_vulnerability_assessment_baseline_add.py | 2 +- ...rability_assessment_baseline_add_latest.py | 2 +- ...l_vulnerability_assessment_baseline_get.py | 2 +- ...ne_list_by_sql_vulnerability_assessment.py | 2 +- ...tabase_sql_vulnerability_assessment_get.py | 2 +- ...lnerability_assessment_list_by_database.py | 2 +- ...erability_assessment_list_scans_results.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 2 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...sessment_rule_baseline_list_by_baseline.py | 2 +- ...abase_sql_vulnerability_assessment_scan.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 2 +- ..._vulnerability_assessment_scans_results.py | 2 +- .../generated_samples/database_table_get.py | 2 +- .../database_table_list_by_schema.py | 2 +- ...assessment_create_container_sas_key_min.py | 2 +- ...ase_vulnerability_assessment_create_max.py | 2 +- ...ssessment_create_storage_access_key_min.py | 2 +- ...atabase_vulnerability_assessment_delete.py | 2 +- .../database_vulnerability_assessment_get.py | 2 +- ...lnerability_assessment_list_by_database.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 2 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...se_vulnerability_assessment_scan_export.py | 2 +- ...lnerability_assessment_scan_records_get.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 2 +- .../generated_samples/delete_database.py | 2 +- .../generated_samples/delete_instance_pool.py | 2 +- .../generated_samples/delete_job.py | 3 +- .../generated_samples/delete_job_agent.py | 2 +- .../delete_job_credential.py | 2 +- .../delete_job_private_endpoint.py | 2 +- .../generated_samples/delete_job_step.py | 3 +- .../delete_job_target_group.py | 2 +- .../delete_workload_classifier.py | 2 +- .../delete_workload_group.py | 2 +- .../generated_samples/deleted_server_get.py | 2 +- .../generated_samples/deleted_server_list.py | 2 +- .../deleted_server_list_by_subscription.py | 2 +- .../deleted_server_recover.py | 2 +- ...tributed_availability_groups_create_max.py | 2 +- ...tributed_availability_groups_create_min.py | 2 +- .../distributed_availability_groups_delete.py | 2 +- ...istributed_availability_groups_failover.py | 2 +- .../distributed_availability_groups_get.py | 2 +- ...ed_availability_groups_list_by_instance.py | 2 +- ...istributed_availability_groups_set_role.py | 2 +- .../distributed_availability_groups_update.py | 2 +- .../elastic_pool_create_or_update_max.py | 2 +- .../elastic_pool_create_or_update_min.py | 2 +- ..._create_or_update_serverless_properties.py | 53 + ...or_update_set_maintenance_configuration.py | 2 +- ...ate_with_default_preferred_enclave_type.py | 2 +- ..._create_with_vbs_preferred_enclave_type.py | 2 +- .../elastic_pool_database_activity_list.py | 45 - .../generated_samples/elastic_pool_delete.py | 2 +- .../generated_samples/elastic_pool_get.py | 2 +- ...ic_pool_get_with_preferred_enclave_type.py | 2 +- .../elastic_pool_list_by_server.py | 2 +- .../elastic_pool_metrics_list_with_filter.py | 46 - ...update_assign_maintenance_configuration.py | 2 +- .../elastic_pool_update_max.py | 2 +- .../elastic_pool_update_min.py | 58 + ..._update_reset_maintenance_configuration.py | 2 +- ...astic_pool_update_serverless_properties.py | 52 + ...ate_with_default_preferred_enclave_type.py | 2 +- ..._update_with_vbs_preferred_enclave_type.py | 2 +- ...on_protector_create_or_update_key_vault.py | 2 +- ...r_update_key_vault_with_versionless_key.py | 51 + ...tector_create_or_update_service_managed.py | 2 +- .../encryption_protector_get.py | 2 +- ...ion_protector_get_with_versionless_key.py} | 10 +- .../encryption_protector_list.py | 2 +- .../encryption_protector_revalidate.py | 2 +- .../endpoint_certificates_get.py | 2 +- .../endpoint_certificates_list_by_instance.py | 2 +- .../generated_samples/export_database.py | 2 +- ...port_database_using_database_extensions.py | 56 + ...tabase_extensions_with_managed_identity.py | 55 + .../export_database_with_managed_identity.py | 51 + .../export_database_with_network_isolation.py | 2 +- ...abase_azure_monitor_auditing_create_min.py | 2 +- ...ended_database_blob_auditing_create_max.py | 2 +- ...ended_database_blob_auditing_create_min.py | 2 +- .../extended_database_blob_auditing_get.py | 2 +- ...xtended_server_blob_auditing_create_max.py | 2 +- ...xtended_server_blob_auditing_create_min.py | 2 +- .../extended_server_blob_auditing_get.py | 2 +- .../generated_samples/failover_database.py | 2 +- .../failover_elastic_pool.py | 2 +- .../failover_group_create_or_update.py | 2 +- ...roup_create_or_update_standby_secondary.py | 2 +- .../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 +- ...failover_group_update_standby_secondary.py | 2 +- .../failover_managed_instance.py | 2 +- .../generated_samples/firewall_rule_create.py | 2 +- .../generated_samples/firewall_rule_delete.py | 2 +- .../generated_samples/firewall_rule_get.py | 2 +- .../generated_samples/firewall_rule_list.py | 2 +- .../firewall_rule_replace.py | 2 +- .../generated_samples/firewall_rule_update.py | 2 +- .../geo_backup_policies_create_or_update.py | 2 +- .../geo_backup_policies_get.py | 2 +- .../geo_backup_policies_list.py | 4 +- .../get_data_warehouse_user_activities.py | 2 +- .../get_database_extensions.py | 2 +- .../generated_samples/get_database_usages.py | 2 +- .../get_database_with_availability_zone.py | 2 +- ...get_elastic_pool_with_availability_zone.py | 2 +- ...elastic_pool_with_serverless_properties.py | 44 + .../generated_samples/get_instance_pool.py | 2 +- .../get_instance_pool_operation.py | 44 + .../generated_samples/get_job.py | 2 +- .../generated_samples/get_job_agent.py | 3 +- .../generated_samples/get_job_credential.py | 2 +- .../generated_samples/get_job_execution.py | 2 +- .../get_job_execution_step.py | 2 +- .../get_job_execution_target.py | 2 +- .../get_job_private_endpoint.py | 2 +- .../generated_samples/get_job_step_by_job.py | 2 +- .../get_job_step_by_version.py | 2 +- .../generated_samples/get_job_target_group.py | 2 +- .../generated_samples/get_job_version.py | 3 +- ...ist_managed_short_term_retention_policy.py | 2 +- ...erm_retention_policy_restorable_dropped.py | 2 +- .../get_maintenance_window_options.py | 2 +- .../get_maintenance_windows.py | 2 +- .../get_managed_instance_operation.py | 2 +- ...get_managed_short_term_retention_policy.py | 2 +- ...erm_retention_policy_restorable_dropped.py | 2 +- .../get_recoverable_managed_database.py | 2 +- .../get_restorable_dropped_database.py | 2 +- ...ropped_database_with_expand_equals_keys.py | 2 +- ...get_restorable_dropped_managed_database.py | 2 +- .../get_short_term_retention_policy.py | 2 +- .../generated_samples/get_vcore_database.py | 2 +- .../get_vcore_database_default_enclave.py | 2 +- .../get_vcore_database_vbs_enclave.py | 2 +- ..._vcore_database_with_expand_equals_keys.py | 2 +- ...xpand_equals_keys_with_versionless_keys.py | 44 + .../get_workload_classifier.py | 2 +- .../get_workload_classifier_list.py | 2 +- .../generated_samples/get_workload_group.py | 2 +- .../get_workload_group_list.py | 2 +- ...ate_set_high_availability_replica_count.py | 2 +- .../hyperscale_elastic_pool_get.py | 2 +- ...ate_set_high_availability_replica_count.py | 2 +- .../generated_samples/import_database.py | 2 +- ...port_database_using_database_extensions.py | 56 + .../import_database_with_managed_identity.py | 51 + .../import_database_with_network_isolation.py | 2 +- .../generated_samples/import_new_database.py | 2 +- ...port_new_database_with_managed_identity.py | 2 +- ...ort_new_database_with_network_isolation.py | 2 +- ...naged_database_list_by_managed_instance.py | 2 +- ...nstance_failover_group_create_or_update.py | 2 +- .../instance_failover_group_delete.py | 2 +- .../instance_failover_group_failover.py | 2 +- ...er_group_force_failover_allow_data_loss.py | 2 +- .../instance_failover_group_get.py | 2 +- .../instance_failover_group_list.py | 2 +- .../ipv6_firewall_rule_create.py | 2 +- .../ipv6_firewall_rule_delete.py | 2 +- .../ipv6_firewall_rule_get.py | 2 +- .../ipv6_firewall_rule_list.py | 2 +- .../ipv6_firewall_rule_update.py | 2 +- .../ledger_digest_uploads_disable.py | 2 +- .../ledger_digest_uploads_enable.py | 2 +- .../ledger_digest_uploads_get.py | 2 +- .../ledger_digest_uploads_list.py | 2 +- .../list_data_warehouse_user_activities.py | 2 +- .../list_database_extensions.py | 2 +- .../list_database_operations.py | 4 +- .../list_databases_by_elastic_pool.py | 4 +- .../list_elastic_pool_operations.py | 2 +- ...st.py => list_instance_pool_operations.py} | 10 +- .../list_instance_pool_operations_empty.py | 44 + .../list_instance_pool_usage.py | 2 +- .../list_instance_pool_usage_expanded.py | 2 +- .../list_instance_pools_by_resource_group.py | 2 +- .../list_instance_pools_by_subscription_id.py | 2 +- .../list_job_agents_by_server.py | 2 +- .../list_job_credentials_by_agent.py | 2 +- .../list_job_execution_steps.py | 2 +- ...list_job_execution_targets_by_execution.py | 2 +- .../list_job_execution_targets_by_step.py | 2 +- .../list_job_executions_by_agent.py | 2 +- ...ist_job_executions_by_agent_with_filter.py | 2 +- .../list_job_executions_by_job.py | 2 +- .../list_job_private_endpoints_by_agent.py | 2 +- .../list_job_steps_by_job.py | 2 +- .../list_job_steps_by_version.py | 2 +- .../list_job_target_groups.py | 2 +- .../generated_samples/list_job_versions.py | 2 +- .../generated_samples/list_jobs_by_agent.py | 2 +- .../list_managed_instance_operations.py | 2 +- .../generated_samples/list_operations.py | 41 + ...etwork_dependencies_by_managed_instance.py | 2 +- ...recoverable_managed_databases_by_server.py | 2 +- ..._restorable_dropped_databases_by_server.py | 2 +- .../list_server_operations.py | 2 +- ...ort_term_retention_policies_by_database.py | 2 +- .../list_vcore_databases_by_server.py | 2 +- ..._vcore_databases_enclave_type_by_server.py | 2 +- ..._vcore_inaccessible_databases_by_server.py | 2 +- .../location_capability_list_by_location.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- .../long_term_retention_backup_copy.py | 2 +- .../long_term_retention_backup_delete.py | 2 +- .../long_term_retention_backup_get.py | 2 +- ..._term_retention_backup_list_by_database.py | 2 +- ..._term_retention_backup_list_by_location.py | 2 +- ...ng_term_retention_backup_list_by_server.py | 2 +- .../long_term_retention_backup_update.py | 2 +- ..._term_retention_policy_create_or_update.py | 2 +- .../long_term_retention_policy_get.py | 2 +- ..._term_retention_policy_list_by_database.py | 2 +- .../managed_columns_list_by_database_max.py | 2 +- .../managed_columns_list_by_database_min.py | 2 +- ...d_threat_protection_settings_create_max.py | 2 +- ...d_threat_protection_settings_create_min.py | 2 +- ...advanced_threat_protection_settings_get.py | 2 +- ...at_protection_settings_list_by_database.py | 2 +- .../managed_database_cancel_move.py | 2 +- .../managed_database_column_get.py | 2 +- .../managed_database_column_list_by_table.py | 2 +- ...atabase_column_sensitivity_label_create.py | 3 +- ...atabase_column_sensitivity_label_delete.py | 2 +- ...d_database_column_sensitivity_label_get.py | 2 +- ...aged_database_complete_external_restore.py | 2 +- .../managed_database_complete_move.py | 2 +- ...ross_subscription_point_in_time_restore.py | 2 +- .../managed_database_create_max.py | 2 +- .../managed_database_create_min.py | 2 +- ...d_database_create_point_in_time_restore.py | 2 +- .../managed_database_create_recovery.py | 2 +- ...database_create_restore_external_backup.py | 2 +- ...estore_external_backup_managed_identity.py | 2 +- ...aged_database_create_restore_ltr_backup.py | 2 +- .../managed_database_delete.py | 2 +- .../generated_samples/managed_database_get.py | 2 +- ...naged_database_list_by_managed_instance.py | 2 +- ...aged_database_move_operation_result_get.py | 2 +- ...ged_database_move_operation_result_list.py | 2 +- ...e_operation_result_list_last_operations.py | 2 +- ...database_move_operation_result_list_max.py | 2 +- ...mended_column_sensitivity_label_disable.py | 2 +- ...mmended_column_sensitivity_label_enable.py | 2 +- ..._reevaluate_inaccessible_database_state.py | 44 + .../managed_database_restore_details.py | 2 +- .../managed_database_schema_get.py | 2 +- ...anaged_database_schema_list_by_database.py | 2 +- ...aged_database_security_alert_create_max.py | 4 +- ...aged_database_security_alert_create_min.py | 4 +- .../managed_database_security_alert_get.py | 4 +- ...atabase_security_alert_list_by_database.py | 2 +- ...anaged_database_security_events_get_max.py | 2 +- ...anaged_database_security_events_get_min.py | 2 +- ...abase_sensitivity_labels_current_update.py | 2 +- ...se_sensitivity_labels_list_by_database.py} | 12 +- ...itivity_labels_list_by_database_current.py | 2 +- ...ity_labels_list_by_database_recommended.py | 2 +- ...e_sensitivity_labels_recommended_update.py | 2 +- .../managed_database_start_move_max.py | 2 +- .../managed_database_start_move_min.py | 2 +- .../managed_database_table_get.py | 2 +- .../managed_database_table_list_by_schema.py | 2 +- .../managed_database_update_max.py | 2 +- .../managed_database_update_min.py | 2 +- ...ase_vulnerability_assessment_create_max.py | 2 +- ...ase_vulnerability_assessment_create_min.py | 2 +- ...atabase_vulnerability_assessment_delete.py | 2 +- ...d_database_vulnerability_assessment_get.py | 2 +- ...lnerability_assessment_list_by_database.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 2 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...se_vulnerability_assessment_scan_export.py | 2 +- ...lnerability_assessment_scan_records_get.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 2 +- ...validate_azure_key_vault_encryption_key.py | 43 + .../managed_instance_administrator_create.py | 2 +- .../managed_instance_administrator_delete.py | 2 +- .../managed_instance_administrator_get.py | 2 +- ...instance_administrator_list_by_instance.py | 2 +- .../managed_instance_administrator_update.py | 2 +- ...d_threat_protection_settings_create_max.py | 2 +- ...d_threat_protection_settings_create_min.py | 2 +- ...advanced_threat_protection_settings_get.py | 2 +- ...at_protection_settings_list_by_instance.py | 2 +- ...nce_azure_ad_only_auth_create_or_update.py | 2 +- ...aged_instance_azure_ad_only_auth_delete.py | 2 +- ...managed_instance_azure_ad_only_auth_get.py | 2 +- ...nce_azure_ad_only_auth_list_by_instance.py | 2 +- .../managed_instance_create_max.py | 4 +- .../managed_instance_create_min.py | 2 +- .../managed_instance_delete.py | 2 +- .../managed_instance_dtc_get.py | 2 +- .../managed_instance_dtc_list.py | 2 +- .../managed_instance_dtc_update_enable_dtc.py | 2 +- .../managed_instance_dtc_update_max.py | 2 +- ...on_protector_create_or_update_key_vault.py | 2 +- ...tector_create_or_update_service_managed.py | 2 +- ...naged_instance_encryption_protector_get.py | 2 +- ...aged_instance_encryption_protector_list.py | 2 +- ...nstance_encryption_protector_revalidate.py | 2 +- .../generated_samples/managed_instance_get.py | 2 +- .../managed_instance_get_while_updating.py | 2 +- ...e_get_with_expand_equals_administrators.py | 2 +- .../managed_instance_key_create_or_update.py | 2 +- .../managed_instance_key_delete.py | 2 +- .../managed_instance_key_get.py | 2 +- .../managed_instance_key_list.py | 2 +- .../managed_instance_list.py | 2 +- .../managed_instance_list_by_instance_pool.py | 2 +- ..._pool_with_expand_equals_administrators.py | 2 +- ...managed_instance_list_by_resource_group.py | 2 +- ...group_with_expand_equals_administrators.py | 2 +- ..._list_with_expand_equals_administrators.py | 2 +- ...tance_long_term_retention_backup_delete.py | 4 +- ...instance_long_term_retention_backup_get.py | 4 +- ..._term_retention_backup_list_by_database.py | 2 +- ..._term_retention_backup_list_by_instance.py | 2 +- ..._term_retention_backup_list_by_location.py | 2 +- ..._retention_backup_list_by_location_max.py} | 10 +- ..._term_retention_policy_create_or_update.py | 3 +- ...tance_long_term_retention_policy_delete.py | 45 + ...instance_long_term_retention_policy_get.py | 2 +- ..._term_retention_policy_list_by_database.py | 2 +- ...ance_private_endpoint_connection_delete.py | 2 +- ...nstance_private_endpoint_connection_get.py | 2 +- ...stance_private_endpoint_connection_list.py | 2 +- ...ance_private_endpoint_connection_update.py | 2 +- ...ged_instance_private_link_resources_get.py | 2 +- ...ed_instance_private_link_resources_list.py | 2 +- .../managed_instance_query_get.py | 2 +- .../managed_instance_query_statistics_list.py | 2 +- ...aged_instance_query_statistics_list_max.py | 2 +- ...aged_instance_query_statistics_list_min.py | 2 +- ..._reevaluate_inaccessible_database_state.py | 42 + ...ance_refresh_external_governance_status.py | 2 +- ...stance_remove_maintenance_configuration.py | 2 +- .../managed_instance_tde_certificate.py | 2 +- .../managed_instance_time_zone_get.py | 2 +- ...ged_instance_time_zone_list_by_location.py | 2 +- .../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 | 3 +- .../managed_instance_update_min.py | 2 +- ...assessment_create_container_sas_key_min.py | 2 +- ...nce_vulnerability_assessment_create_max.py | 2 +- ...ssessment_create_storage_access_key_min.py | 2 +- ...nstance_vulnerability_assessment_delete.py | 2 +- ...d_instance_vulnerability_assessment_get.py | 2 +- ...lnerability_assessment_list_by_instance.py | 2 +- .../managed_ledger_digest_uploads_disable.py | 2 +- .../managed_ledger_digest_uploads_enable.py | 2 +- .../managed_ledger_digest_uploads_get.py | 2 +- .../managed_ledger_digest_uploads_list.py | 2 +- .../managed_server_dns_alias_acquire.py | 2 +- ...naged_server_dns_alias_create_or_update.py | 45 + .../managed_server_dns_alias_delete.py | 2 +- .../managed_server_dns_alias_get.py | 2 +- .../managed_server_dns_alias_list.py | 2 +- ...anaged_server_security_alert_create_max.py | 2 +- ...anaged_server_security_alert_create_min.py | 2 +- .../managed_server_security_alert_get.py | 2 +- ..._server_security_alert_list_by_instance.py | 2 +- ...managed_transparent_data_encryption_get.py | 2 +- ...anaged_transparent_data_encryption_list.py | 2 +- ...aged_transparent_data_encryption_update.py | 2 +- ...k_security_perimeter_configurations_get.py | 44 + ...erimeter_configurations_list_by_server.py} | 11 +- ...ity_perimeter_configurations_reconcile.py} | 11 +- ...te.py => outbound_firewall_rule_create.py} | 11 +- .../outbound_firewall_rule_delete.py | 2 +- .../outbound_firewall_rule_get.py | 2 +- .../outbound_firewall_rule_list.py | 2 +- .../patch_database_default_enclave.py | 2 +- .../patch_database_vbs_enclave.py | 2 +- .../generated_samples/patch_instance_pool.py | 2 +- .../generated_samples/patch_vcore_database.py | 2 +- ...tabase_assign_maintenance_configuration.py | 2 +- ...atabase_reset_maintenance_configuration.py | 2 +- ...base_with_keys_and_encryption_protector.py | 2 +- .../generated_samples/pause_database.py | 3 +- .../private_endpoint_connection_delete.py | 2 +- .../private_endpoint_connection_get.py | 2 +- .../private_endpoint_connection_list.py | 2 +- .../private_endpoint_connection_update.py | 2 +- .../private_link_resources_get.py | 2 +- .../private_link_resources_list.py | 2 +- ...mended_column_sensitivity_label_disable.py | 2 +- ...mmended_column_sensitivity_label_enable.py | 2 +- .../recoverable_database_get.py | 2 +- ...le_database_get_with_expand_equals_keys.py | 2 +- .../recoverable_database_list.py | 2 +- .../refresh_external_governance_status.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- .../generated_samples/rename_database.py | 2 +- .../replication_link_create_or_update.py | 2 +- .../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 +- .../replication_link_update.py | 2 +- ..._long_term_retention_backup_access_tier.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- ...p_based_long_term_retention_backup_copy.py | 2 +- ...based_long_term_retention_backup_delete.py | 2 +- ...up_based_long_term_retention_backup_get.py | 2 +- ..._term_retention_backup_list_by_database.py | 2 +- ..._term_retention_backup_list_by_location.py | 2 +- ...ng_term_retention_backup_list_by_server.py | 2 +- ...based_long_term_retention_backup_update.py | 2 +- ...tance_long_term_retention_backup_delete.py | 4 +- ...instance_long_term_retention_backup_get.py | 4 +- ..._term_retention_backup_list_by_database.py | 2 +- ..._term_retention_backup_list_by_instance.py | 2 +- ..._term_retention_backup_list_by_location.py | 2 +- ...m_retention_backup_list_by_location_max.py | 44 + ...immutability_long_term_retention_backup.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- ...naged_database_list_by_managed_instance.py | 2 +- .../generated_samples/resume_database.py | 2 +- ...sume_transparent_data_encryption_update.py | 45 + .../sensitivity_labels_current_update.py | 2 +- .../sensitivity_labels_list_by_database.py | 45 + ...ls_list_by_database_with_source_current.py | 2 +- ...ist_by_database_with_source_recommended.py | 2 +- .../sensitivity_labels_recommended_update.py | 2 +- ...d_threat_protection_settings_create_max.py | 2 +- ...d_threat_protection_settings_create_min.py | 2 +- ...advanced_threat_protection_settings_get.py | 2 +- ...reat_protection_settings_list_by_server.py | 2 +- .../generated_samples/server_advisor_get.py | 2 +- .../generated_samples/server_advisor_list.py | 2 +- .../server_advisor_update.py | 2 +- .../server_auditing_settings_list.py | 2 +- .../server_automatic_tuning_get.py | 2 +- .../server_automatic_tuning_update_max.py | 2 +- .../server_automatic_tuning_update_min.py | 2 +- .../server_blob_auditing_create_max.py | 2 +- .../server_blob_auditing_create_min.py | 2 +- .../server_blob_auditing_get.py | 2 +- .../server_configuration_option_get.py | 2 +- .../server_configuration_option_list.py | 2 +- .../server_configuration_option_update.py | 2 +- .../server_connection_policies_get.py | 2 +- .../server_connection_policies_list.py | 2 +- .../server_connection_policies_update.py | 2 +- .../generated_samples/server_create.py | 3 +- .../generated_samples/server_delete.py | 3 +- .../server_dev_ops_audit_create_max.py | 2 +- .../server_dev_ops_audit_create_min.py | 2 +- .../server_dev_ops_audit_get.py | 2 +- .../server_dev_ops_audit_list.py | 2 +- .../server_dns_alias_acquire.py | 2 +- .../server_dns_alias_create_or_update.py | 2 +- .../server_dns_alias_delete.py | 2 +- .../generated_samples/server_dns_alias_get.py | 2 +- .../server_dns_alias_list.py | 2 +- .../server_extended_auditing_settings_list.py | 2 +- .../generated_samples/server_get.py | 3 +- ...r_get_with_expand_equals_administrators.py | 2 +- .../server_key_create_or_update.py | 2 +- ...y_create_or_update_with_versionless_key.py | 47 + .../generated_samples/server_key_delete.py | 2 +- .../generated_samples/server_key_get.py | 3 +- ...=> server_key_get_with_versionless_key.py} | 8 +- .../generated_samples/server_key_list.py | 3 +- .../generated_samples/server_list.py | 3 +- .../server_list_by_resource_group.py | 2 +- ...group_with_expand_equals_administrators.py | 2 +- ..._list_with_expand_equals_administrators.py | 2 +- .../server_recommended_action_list_expand.py | 2 +- .../server_security_alerts_create_max.py | 2 +- .../server_security_alerts_create_min.py | 2 +- .../server_security_alerts_get.py | 2 +- .../server_security_alerts_list_by_server.py | 2 +- .../server_trust_certificates_create.py | 2 +- .../server_trust_certificates_delete.py | 2 +- .../server_trust_certificates_get.py | 2 +- ...ver_trust_certificates_list_by_instance.py | 2 +- .../server_trust_group_create.py | 2 +- .../server_trust_group_delete.py | 2 +- .../server_trust_group_get.py | 2 +- .../server_trust_group_list.py | 2 +- ...er_trust_group_list_by_managed_instance.py | 2 +- .../generated_samples/server_update.py | 3 +- ...e_metrics_list.py => server_usage_list.py} | 4 +- ...assessment_create_container_sas_key_min.py | 2 +- ...ver_vulnerability_assessment_create_max.py | 2 +- ...ssessment_create_storage_access_key_min.py | 2 +- .../server_vulnerability_assessment_delete.py | 2 +- .../server_vulnerability_assessment_get.py | 2 +- ...vulnerability_assessment_list_by_server.py | 2 +- ...immutability_long_term_retention_backup.py | 2 +- .../sql_agent_configuration_get.py | 2 +- .../sql_agent_configuration_put.py | 2 +- .../sql_tde_certificate_create.py | 2 +- ...l_vulnerability_assessment_baseline_add.py | 2 +- ...rability_assessment_baseline_add_latest.py | 2 +- ...l_vulnerability_assessment_baseline_get.py | 2 +- ...ne_list_by_sql_vulnerability_assessment.py | 2 +- .../sql_vulnerability_assessment_create.py | 2 +- .../sql_vulnerability_assessment_delete.py | 2 +- .../sql_vulnerability_assessment_get.py | 2 +- ...vulnerability_assessment_list_by_server.py | 2 +- ...erability_assessment_list_scans_results.py | 2 +- ...ability_assessment_rule_baseline_create.py | 2 +- ...ability_assessment_rule_baseline_delete.py | 2 +- ...nerability_assessment_rule_baseline_get.py | 2 +- ...sessment_rule_baseline_list_by_baseline.py | 2 +- .../sql_vulnerability_assessment_scan.py | 2 +- ...ssessment_scan_records_list_by_database.py | 2 +- ..._vulnerability_assessment_scans_execute.py | 2 +- ..._vulnerability_assessment_scans_results.py | 2 +- .../start_managed_instance.py | 2 +- ..._instance_schedule_create_or_update_max.py | 2 +- ..._instance_schedule_create_or_update_min.py | 2 +- ...t_stop_managed_instance_schedule_delete.py | 2 +- ...tart_stop_managed_instance_schedule_get.py | 2 +- ...art_stop_managed_instance_schedule_list.py | 2 +- .../stop_managed_instance.py | 2 +- .../subscription_usage_get.py | 2 +- .../subscription_usage_list_by_location.py | 2 +- ...pend_transparent_data_encryption_update.py | 45 + ...synapse_link_workspace_list_by_database.py | 2 +- .../generated_samples/sync_agent_create.py | 2 +- .../generated_samples/sync_agent_delete.py | 2 +- .../sync_agent_generate_key.py | 2 +- .../generated_samples/sync_agent_get.py | 3 +- .../sync_agent_get_linked_databases.py | 2 +- .../sync_agent_list_by_server.py | 2 +- .../generated_samples/sync_agent_update.py | 2 +- .../sync_group_cancel_sync.py | 2 +- .../generated_samples/sync_group_create.py | 2 +- .../generated_samples/sync_group_delete.py | 2 +- .../generated_samples/sync_group_get.py | 3 +- .../sync_group_get_hub_schema.py | 2 +- .../generated_samples/sync_group_get_log.py | 2 +- .../sync_group_get_sync_database_id.py | 2 +- .../sync_group_list_by_database.py | 2 +- .../generated_samples/sync_group_patch.py | 2 +- .../sync_group_refresh_hub_schema.py | 2 +- .../sync_group_trigger_sync.py | 2 +- .../generated_samples/sync_group_update.py | 2 +- .../generated_samples/sync_member_create.py | 2 +- .../generated_samples/sync_member_delete.py | 2 +- .../generated_samples/sync_member_get.py | 3 +- .../sync_member_get_schema.py | 2 +- .../sync_member_list_by_sync_group.py | 2 +- .../generated_samples/sync_member_patch.py | 2 +- .../sync_member_refresh_schema.py | 2 +- .../generated_samples/sync_member_update.py | 2 +- .../transparent_data_encryption_get.py | 2 +- .../transparent_data_encryption_list.py | 2 +- .../transparent_data_encryption_update.py | 4 +- ...se_hyperscale_migration_perform_cutover.py | 2 +- ...yperscale_migration_with_manual_cutover.py | 2 +- .../generated_samples/update_job_agent.py | 2 +- .../update_job_agent_with_identity.py | 52 + ...ve_get.py => update_job_agent_with_sku.py} | 13 +- ...ate_managed_short_term_retention_policy.py | 2 +- ...erm_retention_policy_restorable_dropped.py | 2 +- .../update_short_term_retention_policy.py | 2 +- .../update_virtual_cluster_dns_servers.py | 2 +- .../upgrade_data_warehouse.py | 2 +- .../virtual_cluster_create.py | 44 + .../virtual_cluster_delete.py | 4 +- .../generated_samples/virtual_cluster_get.py | 4 +- .../generated_samples/virtual_cluster_list.py | 4 +- .../virtual_cluster_list_by_resource_group.py | 4 +- .../virtual_cluster_update.py | 4 +- .../virtual_network_rules_create_or_update.py | 2 +- .../virtual_network_rules_delete.py | 2 +- .../virtual_network_rules_get.py | 2 +- .../virtual_network_rules_list.py | 2 +- ...hort_term_retention_policies_operations.py | 32 +- ...erm_retention_policies_operations_async.py | 32 +- ..._sql_management_capabilities_operations.py | 2 +- ...anagement_capabilities_operations_async.py | 2 +- ...gement_data_masking_policies_operations.py | 32 +- ..._data_masking_policies_operations_async.py | 32 +- ...anagement_data_masking_rules_operations.py | 32 +- ...ent_data_masking_rules_operations_async.py | 32 +- ...ta_warehouse_user_activities_operations.py | 18 +- ...ehouse_user_activities_operations_async.py | 18 +- ...d_threat_protection_settings_operations.py | 6 +- ...at_protection_settings_operations_async.py | 6 +- ...management_database_advisors_operations.py | 12 +- ...ment_database_advisors_operations_async.py | 12 +- ...nt_database_automatic_tuning_operations.py | 4 +- ...abase_automatic_tuning_operations_async.py | 4 +- ...abase_blob_auditing_policies_operations.py | 6 +- ...blob_auditing_policies_operations_async.py | 6 +- ..._management_database_columns_operations.py | 6 +- ...ement_database_columns_operations_async.py | 6 +- ...tabase_encryption_protectors_operations.py | 4 +- ..._encryption_protectors_operations_async.py | 4 +- ...nagement_database_extensions_operations.py | 37 +- ...nt_database_extensions_operations_async.py | 37 +- ...nagement_database_operations_operations.py | 4 +- ...nt_database_operations_operations_async.py | 4 +- ...database_recommended_actions_operations.py | 12 +- ...se_recommended_actions_operations_async.py | 12 +- ..._management_database_schemas_operations.py | 4 +- ...ement_database_schemas_operations_async.py | 4 +- ...base_security_alert_policies_operations.py | 30 +- ...ecurity_alert_policies_operations_async.py | 30 +- ...ability_assessment_baselines_operations.py | 6 +- ...y_assessment_baselines_operations_async.py | 6 +- ...lity_assessment_execute_scan_operations.py | 2 +- ...ssessment_execute_scan_operations_async.py | 2 +- ...ty_assessment_rule_baselines_operations.py | 8 +- ...essment_rule_baselines_operations_async.py | 8 +- ...ility_assessment_scan_result_operations.py | 4 +- ...assessment_scan_result_operations_async.py | 4 +- ...lnerability_assessment_scans_operations.py | 4 +- ...ility_assessment_scans_operations_async.py | 4 +- ...ability_assessments_settings_operations.py | 4 +- ...y_assessments_settings_operations_async.py | 4 +- ...l_management_database_tables_operations.py | 4 +- ...gement_database_tables_operations_async.py | 4 +- ...l_management_database_usages_operations.py | 2 +- ...gement_database_usages_operations_async.py | 2 +- ...ty_assessment_rule_baselines_operations.py | 6 +- ...essment_rule_baselines_operations_async.py | 6 +- ...lnerability_assessment_scans_operations.py | 34 +- ...ility_assessment_scans_operations_async.py | 40 +- ...se_vulnerability_assessments_operations.py | 32 +- ...nerability_assessments_operations_async.py | 32 +- ...est_sql_management_databases_operations.py | 61 +- ...l_management_databases_operations_async.py | 61 +- ...l_management_deleted_servers_operations.py | 22 +- ...gement_deleted_servers_operations_async.py | 22 +- ...tributed_availability_groups_operations.py | 14 +- ...ed_availability_groups_operations_async.py | 14 +- ...ment_elastic_pool_operations_operations.py | 18 +- ...lastic_pool_operations_operations_async.py | 18 +- ...sql_management_elastic_pools_operations.py | 45 +- ...nagement_elastic_pools_operations_async.py | 45 +- ...gement_encryption_protectors_operations.py | 9 +- ..._encryption_protectors_operations_async.py | 9 +- ...gement_endpoint_certificates_operations.py | 4 +- ..._endpoint_certificates_operations_async.py | 4 +- ...abase_blob_auditing_policies_operations.py | 6 +- ...blob_auditing_policies_operations_async.py | 6 +- ...erver_blob_auditing_policies_operations.py | 6 +- ...blob_auditing_policies_operations_async.py | 6 +- ...l_management_failover_groups_operations.py | 16 +- ...gement_failover_groups_operations_async.py | 16 +- ...ql_management_firewall_rules_operations.py | 46 +- ...agement_firewall_rules_operations_async.py | 46 +- ...nagement_geo_backup_policies_operations.py | 38 +- ...nt_geo_backup_policies_operations_async.py | 38 +- ...ent_instance_failover_groups_operations.py | 12 +- ...stance_failover_groups_operations_async.py | 12 +- ...ent_instance_pool_operations_operations.py | 4 +- ...stance_pool_operations_operations_async.py | 4 +- ...ql_management_instance_pools_operations.py | 12 +- ...agement_instance_pools_operations_async.py | 12 +- ...nagement_ipv6_firewall_rules_operations.py | 8 +- ...nt_ipv6_firewall_rules_operations_async.py | 8 +- ...st_sql_management_job_agents_operations.py | 25 +- ..._management_job_agents_operations_async.py | 25 +- ...l_management_job_credentials_operations.py | 8 +- ...gement_job_credentials_operations_async.py | 8 +- ...ql_management_job_executions_operations.py | 44 +- ...agement_job_executions_operations_async.py | 56 +- ...gement_job_private_endpoints_operations.py | 8 +- ..._job_private_endpoints_operations_async.py | 8 +- ...nagement_job_step_executions_operations.py | 4 +- ...nt_job_step_executions_operations_async.py | 4 +- ...est_sql_management_job_steps_operations.py | 72 +- ...l_management_job_steps_operations_async.py | 72 +- ...gement_job_target_executions_operations.py | 26 +- ..._job_target_executions_operations_async.py | 26 +- ...management_job_target_groups_operations.py | 8 +- ...ment_job_target_groups_operations_async.py | 8 +- ..._sql_management_job_versions_operations.py | 4 +- ...anagement_job_versions_operations_async.py | 4 +- .../test_sql_management_jobs_operations.py | 12 +- ...st_sql_management_jobs_operations_async.py | 12 +- ...gement_ledger_digest_uploads_operations.py | 32 +- ..._ledger_digest_uploads_operations_async.py | 32 +- ..._long_term_retention_backups_operations.py | 48 +- ...term_retention_backups_operations_async.py | 48 +- ...ion_managed_instance_backups_operations.py | 84 +- ...naged_instance_backups_operations_async.py | 84 +- ...long_term_retention_policies_operations.py | 6 +- ...erm_retention_policies_operations_async.py | 6 +- ...t_maintenance_window_options_operations.py | 2 +- ...tenance_window_options_operations_async.py | 2 +- ...nagement_maintenance_windows_operations.py | 4 +- ...nt_maintenance_windows_operations_async.py | 4 +- ...hort_term_retention_policies_operations.py | 32 +- ...erm_retention_policies_operations_async.py | 32 +- ...d_threat_protection_settings_operations.py | 6 +- ...at_protection_settings_operations_async.py | 6 +- ...ent_managed_database_columns_operations.py | 6 +- ...naged_database_columns_operations_async.py | 6 +- ...ged_database_move_operations_operations.py | 4 +- ...tabase_move_operations_operations_async.py | 4 +- ...ent_managed_database_queries_operations.py | 4 +- ...naged_database_queries_operations_async.py | 4 +- ...commended_sensitivity_labels_operations.py | 2 +- ...ded_sensitivity_labels_operations_async.py | 2 +- ...ged_database_restore_details_operations.py | 2 +- ...tabase_restore_details_operations_async.py | 2 +- ...ent_managed_database_schemas_operations.py | 4 +- ...naged_database_schemas_operations_async.py | 4 +- ...base_security_alert_policies_operations.py | 30 +- ...ecurity_alert_policies_operations_async.py | 30 +- ...ged_database_security_events_operations.py | 2 +- ...tabase_security_events_operations_async.py | 2 +- ..._database_sensitivity_labels_operations.py | 139 +- ...ase_sensitivity_labels_operations_async.py | 139 +- ...ment_managed_database_tables_operations.py | 4 +- ...anaged_database_tables_operations_async.py | 4 +- ..._transparent_data_encryption_operations.py | 26 +- ...parent_data_encryption_operations_async.py | 26 +- ...ty_assessment_rule_baselines_operations.py | 6 +- ...essment_rule_baselines_operations_async.py | 6 +- ...lnerability_assessment_scans_operations.py | 34 +- ...ility_assessment_scans_operations_async.py | 56 +- ...se_vulnerability_assessments_operations.py | 32 +- ...nerability_assessments_operations_async.py | 32 +- ...management_managed_databases_operations.py | 45 +- ...ment_managed_databases_operations_async.py | 47 +- ...aged_instance_administrators_operations.py | 8 +- ...nstance_administrators_operations_async.py | 8 +- ...d_threat_protection_settings_operations.py | 6 +- ...at_protection_settings_operations_async.py | 6 +- ...zure_ad_only_authentications_operations.py | 30 +- ...d_only_authentications_operations_async.py | 30 +- ...gement_managed_instance_dtcs_operations.py | 6 +- ..._managed_instance_dtcs_operations_async.py | 6 +- ...stance_encryption_protectors_operations.py | 32 +- ..._encryption_protectors_operations_async.py | 36 +- ...gement_managed_instance_keys_operations.py | 8 +- ..._managed_instance_keys_operations_async.py | 8 +- ...long_term_retention_policies_operations.py | 29 +- ...erm_retention_policies_operations_async.py | 37 +- ..._managed_instance_operations_operations.py | 6 +- ...ed_instance_operations_operations_async.py | 6 +- ...private_endpoint_connections_operations.py | 30 +- ...e_endpoint_connections_operations_async.py | 30 +- ...tance_private_link_resources_operations.py | 4 +- ...private_link_resources_operations_async.py | 4 +- ...ed_instance_tde_certificates_operations.py | 2 +- ...tance_tde_certificates_operations_async.py | 2 +- ...ce_vulnerability_assessments_operations.py | 30 +- ...nerability_assessments_operations_async.py | 30 +- ...management_managed_instances_operations.py | 55 +- ...ment_managed_instances_operations_async.py | 59 +- ...anaged_ledger_digest_uploads_operations.py | 8 +- ..._ledger_digest_uploads_operations_async.py | 8 +- ...hort_term_retention_policies_operations.py | 36 +- ...erm_retention_policies_operations_async.py | 36 +- ...t_managed_server_dns_aliases_operations.py | 10 +- ...ged_server_dns_aliases_operations_async.py | 10 +- ...rver_security_alert_policies_operations.py | 28 +- ...ecurity_alert_policies_operations_async.py | 28 +- ...ity_perimeter_configurations_operations.py | 6 +- ...rimeter_configurations_operations_async.py | 6 +- .../test_sql_management_operations.py | 2 +- .../test_sql_management_operations_async.py | 2 +- ...ment_outbound_firewall_rules_operations.py | 31 +- ...utbound_firewall_rules_operations_async.py | 31 +- ...private_endpoint_connections_operations.py | 8 +- ...e_endpoint_connections_operations_async.py | 8 +- ...ement_private_link_resources_operations.py | 4 +- ...private_link_resources_operations_async.py | 4 +- ...commended_sensitivity_labels_operations.py | 2 +- ...ded_sensitivity_labels_operations_async.py | 2 +- ...gement_recoverable_databases_operations.py | 4 +- ..._recoverable_databases_operations_async.py | 4 +- ...ecoverable_managed_databases_operations.py | 4 +- ...able_managed_databases_operations_async.py | 4 +- ...management_replication_links_operations.py | 16 +- ...ment_replication_links_operations_async.py | 16 +- ...restorable_dropped_databases_operations.py | 4 +- ...able_dropped_databases_operations_async.py | 4 +- ...le_dropped_managed_databases_operations.py | 4 +- ...pped_managed_databases_operations_async.py | 4 +- ...ql_management_restore_points_operations.py | 8 +- ...agement_restore_points_operations_async.py | 8 +- ...anagement_sensitivity_labels_operations.py | 91 +- ...ent_sensitivity_labels_operations_async.py | 91 +- ...d_threat_protection_settings_operations.py | 6 +- ...at_protection_settings_operations_async.py | 6 +- ...l_management_server_advisors_operations.py | 12 +- ...gement_server_advisors_operations_async.py | 12 +- ...ment_server_automatic_tuning_operations.py | 4 +- ...erver_automatic_tuning_operations_async.py | 4 +- ...rver_azure_ad_administrators_operations.py | 30 +- ...zure_ad_administrators_operations_async.py | 30 +- ...zure_ad_only_authentications_operations.py | 30 +- ...d_only_authentications_operations_async.py | 30 +- ...erver_blob_auditing_policies_operations.py | 6 +- ...blob_auditing_policies_operations_async.py | 6 +- ...server_configuration_options_operations.py | 6 +- ..._configuration_options_operations_async.py | 6 +- ...t_server_connection_policies_operations.py | 28 +- ...er_connection_policies_operations_async.py | 28 +- ...erver_dev_ops_audit_settings_operations.py | 6 +- ...dev_ops_audit_settings_operations_async.py | 6 +- ...anagement_server_dns_aliases_operations.py | 32 +- ...ent_server_dns_aliases_operations_async.py | 32 +- ...t_sql_management_server_keys_operations.py | 9 +- ...management_server_keys_operations_async.py | 9 +- ...management_server_operations_operations.py | 2 +- ...ment_server_operations_operations_async.py | 2 +- ...rver_security_alert_policies_operations.py | 28 +- ...ecurity_alert_policies_operations_async.py | 28 +- ...nt_server_trust_certificates_operations.py | 8 +- ...ver_trust_certificates_operations_async.py | 8 +- ...nagement_server_trust_groups_operations.py | 32 +- ...nt_server_trust_groups_operations_async.py | 32 +- ...sql_management_server_usages_operations.py | 2 +- ...nagement_server_usages_operations_async.py | 2 +- ...er_vulnerability_assessments_operations.py | 30 +- ...nerability_assessments_operations_async.py | 30 +- .../test_sql_management_servers_operations.py | 18 +- ...sql_management_servers_operations_async.py | 18 +- ...est_sql_management_sql_agent_operations.py | 4 +- ...l_management_sql_agent_operations_async.py | 4 +- ...rability_assessment_baseline_operations.py | 4 +- ...ty_assessment_baseline_operations_async.py | 4 +- ...ability_assessment_baselines_operations.py | 2 +- ...y_assessment_baselines_operations_async.py | 2 +- ...lity_assessment_execute_scan_operations.py | 2 +- ...ssessment_execute_scan_operations_async.py | 2 +- ...ity_assessment_rule_baseline_operations.py | 6 +- ...sessment_rule_baseline_operations_async.py | 6 +- ...ty_assessment_rule_baselines_operations.py | 2 +- ...essment_rule_baselines_operations_async.py | 2 +- ...ility_assessment_scan_result_operations.py | 4 +- ...assessment_scan_result_operations_async.py | 4 +- ...lnerability_assessment_scans_operations.py | 4 +- ...ility_assessment_scans_operations_async.py | 4 +- ...ql_vulnerability_assessments_operations.py | 2 +- ...nerability_assessments_operations_async.py | 2 +- ...ability_assessments_settings_operations.py | 6 +- ...y_assessments_settings_operations_async.py | 6 +- ...p_managed_instance_schedules_operations.py | 8 +- ...ged_instance_schedules_operations_async.py | 8 +- ...nagement_subscription_usages_operations.py | 4 +- ...nt_subscription_usages_operations_async.py | 4 +- ...ment_synapse_link_workspaces_operations.py | 2 +- ...ynapse_link_workspaces_operations_async.py | 2 +- ...t_sql_management_sync_agents_operations.py | 34 +- ...management_sync_agents_operations_async.py | 34 +- ...t_sql_management_sync_groups_operations.py | 142 +- ...management_sync_groups_operations_async.py | 146 +- ..._sql_management_sync_members_operations.py | 50 +- ...anagement_sync_members_operations_async.py | 62 +- ..._management_tde_certificates_operations.py | 2 +- ...ement_tde_certificates_operations_async.py | 2 +- ...st_sql_management_time_zones_operations.py | 4 +- ..._management_time_zones_operations_async.py | 4 +- ...transparent_data_encryptions_operations.py | 36 +- ...arent_data_encryptions_operations_async.py | 40 +- .../test_sql_management_usages_operations.py | 2 +- ..._sql_management_usages_operations_async.py | 2 +- ..._management_virtual_clusters_operations.py | 34 +- ...ement_virtual_clusters_operations_async.py | 36 +- ...gement_virtual_network_rules_operations.py | 30 +- ..._virtual_network_rules_operations_async.py | 30 +- ...agement_workload_classifiers_operations.py | 34 +- ...t_workload_classifiers_operations_async.py | 34 +- ...l_management_workload_groups_operations.py | 32 +- ...gement_workload_groups_operations_async.py | 32 +- sdk/sql/azure-mgmt-sql/pyproject.toml | 8 +- 1317 files changed, 161929 insertions(+), 22846 deletions(-) delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/{_service_objectives_operations.py => _instance_pool_operations_operations.py} (65%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/{_server_communication_links_operations.py => _network_security_perimeter_configurations_operations.py} (50%) delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_service_objectives_operations.py => _instance_pool_operations_operations.py} (66%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_server_communication_links_operations.py => _network_security_perimeter_configurations_operations.py} (51%) create mode 100644 sdk/sql/azure-mgmt-sql/code_report_swagger.json create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py rename sdk/sql/azure-mgmt-sql/generated_samples/{data_masking_rule_list.py => data_masking_rule_list_by_database.py} (90%) delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py rename sdk/sql/azure-mgmt-sql/generated_samples/{server_communication_link_list.py => encryption_protector_get_with_versionless_key.py} (84%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py rename sdk/sql/azure-mgmt-sql/generated_samples/{service_objective_list.py => list_instance_pool_operations.py} (83%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py rename sdk/sql/azure-mgmt-sql/generated_samples/{elastic_pool_metrics_definitions_list.py => managed_database_sensitivity_labels_list_by_database.py} (79%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py rename sdk/sql/azure-mgmt-sql/generated_samples/{database_metrics_definitions_list.py => managed_instance_long_term_retention_backup_list_by_location_max.py} (82%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py rename sdk/sql/azure-mgmt-sql/generated_samples/{elastic_pool_activity_list.py => network_security_perimeter_configurations_list_by_server.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_samples/{server_communication_link_create_or_update.py => network_security_perimeter_configurations_reconcile.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_samples/{server_communication_link_delete.py => outbound_firewall_rule_create.py} (83%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py rename sdk/sql/azure-mgmt-sql/generated_samples/{server_communication_link_get.py => server_key_get_with_versionless_key.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_samples/{server_usage_metrics_list.py => server_usage_list.py} (93%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py rename sdk/sql/azure-mgmt-sql/generated_samples/{service_objective_get.py => update_job_agent_with_sku.py} (83%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py diff --git a/sdk/sql/azure-mgmt-sql/CHANGELOG.md b/sdk/sql/azure-mgmt-sql/CHANGELOG.md index 62700a667f07..73a7ca205370 100644 --- a/sdk/sql/azure-mgmt-sql/CHANGELOG.md +++ b/sdk/sql/azure-mgmt-sql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 3.1.0 (2026-04-01) + +skip changelog generation + ## 4.0.0b24 (2025-10-09) ### Bugs Fixed diff --git a/sdk/sql/azure-mgmt-sql/_metadata.json b/sdk/sql/azure-mgmt-sql/_metadata.json index 8a79cbe05c94..90fe74de03ad 100644 --- a/sdk/sql/azure-mgmt-sql/_metadata.json +++ b/sdk/sql/azure-mgmt-sql/_metadata.json @@ -1,11 +1,11 @@ { - "commit": "8358c7473dfe057d84a6b6a921225063c040b31a", + "commit": "347957f6f5b15889f48000bbca92b7ed1d759dca", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ - "@autorest/python@6.40.0", + "@autorest/python@6.50.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/sql/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.40.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/sql/resource-manager/readme.md" + "autorest_command": "autorest specification/sql/resource-manager/Microsoft.Sql/SQL/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/home/v-chenjiang/spec/worktrees/sdk-azure-mgmt-sql/sdk --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "readme": "specification/sql/resource-manager/Microsoft.Sql/SQL/readme.md" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/apiview-properties.json b/sdk/sql/azure-mgmt-sql/apiview-properties.json index 57dcfec67bab..7c0c62ef739f 100644 --- a/sdk/sql/azure-mgmt-sql/apiview-properties.json +++ b/sdk/sql/azure-mgmt-sql/apiview-properties.json @@ -71,10 +71,6 @@ "azure.mgmt.sql.models.DistributedAvailabilityGroupsListResult": null, "azure.mgmt.sql.models.EditionCapability": null, "azure.mgmt.sql.models.ElasticPool": null, - "azure.mgmt.sql.models.ElasticPoolActivity": null, - "azure.mgmt.sql.models.ElasticPoolActivityListResult": null, - "azure.mgmt.sql.models.ElasticPoolDatabaseActivity": null, - "azure.mgmt.sql.models.ElasticPoolDatabaseActivityListResult": null, "azure.mgmt.sql.models.ElasticPoolEditionCapability": null, "azure.mgmt.sql.models.ElasticPoolListResult": null, "azure.mgmt.sql.models.ElasticPoolOperation": null, @@ -108,6 +104,7 @@ "azure.mgmt.sql.models.FirewallRule": null, "azure.mgmt.sql.models.FirewallRuleList": null, "azure.mgmt.sql.models.FirewallRuleListResult": null, + "azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability": null, "azure.mgmt.sql.models.GeoBackupPolicy": null, "azure.mgmt.sql.models.GeoBackupPolicyListResult": null, "azure.mgmt.sql.models.ImportExistingDatabaseDefinition": null, @@ -123,14 +120,21 @@ "azure.mgmt.sql.models.InstancePoolEditionCapability": null, "azure.mgmt.sql.models.InstancePoolFamilyCapability": null, "azure.mgmt.sql.models.InstancePoolListResult": null, + "azure.mgmt.sql.models.InstancePoolOperation": null, + "azure.mgmt.sql.models.InstancePoolOperationListResult": null, "azure.mgmt.sql.models.InstancePoolUpdate": null, "azure.mgmt.sql.models.InstancePoolVcoresCapability": null, "azure.mgmt.sql.models.IPv6FirewallRule": null, "azure.mgmt.sql.models.IPv6FirewallRuleListResult": null, "azure.mgmt.sql.models.Job": null, "azure.mgmt.sql.models.JobAgent": null, + "azure.mgmt.sql.models.JobAgentEditionCapability": null, + "azure.mgmt.sql.models.JobAgentIdentity": null, "azure.mgmt.sql.models.JobAgentListResult": null, + "azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability": null, "azure.mgmt.sql.models.JobAgentUpdate": null, + "azure.mgmt.sql.models.JobAgentUserAssignedIdentity": null, + "azure.mgmt.sql.models.JobAgentVersionCapability": null, "azure.mgmt.sql.models.JobCredential": null, "azure.mgmt.sql.models.JobCredentialListResult": null, "azure.mgmt.sql.models.JobExecution": null, @@ -173,6 +177,7 @@ "azure.mgmt.sql.models.ManagedDatabase": null, "azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection": null, "azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtectionListResult": null, + "azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo": null, "azure.mgmt.sql.models.ManagedDatabaseListResult": null, "azure.mgmt.sql.models.ManagedDatabaseMoveDefinition": null, "azure.mgmt.sql.models.ManagedDatabaseMoveOperationListResult": null, @@ -225,6 +230,7 @@ "azure.mgmt.sql.models.ManagedInstanceQuery": null, "azure.mgmt.sql.models.ManagedInstanceQueryStatistics": null, "azure.mgmt.sql.models.ManagedInstanceUpdate": null, + "azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest": null, "azure.mgmt.sql.models.ManagedInstanceVcoresCapability": null, "azure.mgmt.sql.models.ManagedInstanceVersionCapability": null, "azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment": null, @@ -239,21 +245,25 @@ "azure.mgmt.sql.models.ManagedServerSecurityAlertPolicyListResult": null, "azure.mgmt.sql.models.ManagedTransparentDataEncryption": null, "azure.mgmt.sql.models.ManagedTransparentDataEncryptionListResult": null, + "azure.mgmt.sql.models.MaxLimitRangeCapability": null, "azure.mgmt.sql.models.MaxSizeCapability": null, "azure.mgmt.sql.models.MaxSizeRangeCapability": null, - "azure.mgmt.sql.models.Metric": null, - "azure.mgmt.sql.models.MetricAvailability": null, - "azure.mgmt.sql.models.MetricDefinition": null, - "azure.mgmt.sql.models.MetricDefinitionListResult": null, - "azure.mgmt.sql.models.MetricListResult": null, - "azure.mgmt.sql.models.MetricName": null, - "azure.mgmt.sql.models.MetricValue": null, "azure.mgmt.sql.models.MinCapacityCapability": null, "azure.mgmt.sql.models.Name": null, "azure.mgmt.sql.models.NetworkIsolationSettings": null, + "azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated": null, + "azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration": null, + "azure.mgmt.sql.models.NetworkSecurityPerimeterConfigurationListResult": null, + "azure.mgmt.sql.models.NSPConfigAccessRule": null, + "azure.mgmt.sql.models.NSPConfigAccessRuleProperties": null, + "azure.mgmt.sql.models.NSPConfigAssociation": null, + "azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule": null, + "azure.mgmt.sql.models.NSPConfigPerimeter": null, + "azure.mgmt.sql.models.NSPConfigProfile": null, + "azure.mgmt.sql.models.NSPProvisioningIssue": null, + "azure.mgmt.sql.models.NSPProvisioningIssueProperties": null, "azure.mgmt.sql.models.Operation": null, "azure.mgmt.sql.models.OperationDisplay": null, - "azure.mgmt.sql.models.OperationImpact": null, "azure.mgmt.sql.models.OperationListResult": null, "azure.mgmt.sql.models.OutboundEnvironmentEndpoint": null, "azure.mgmt.sql.models.OutboundEnvironmentEndpointCollection": null, @@ -261,6 +271,7 @@ "azure.mgmt.sql.models.OutboundFirewallRuleListResult": null, "azure.mgmt.sql.models.PartnerInfo": null, "azure.mgmt.sql.models.PartnerRegionInfo": null, + "azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange": null, "azure.mgmt.sql.models.PerformanceLevelCapability": null, "azure.mgmt.sql.models.PhaseDetails": null, "azure.mgmt.sql.models.PrivateEndpointConnection": null, @@ -274,12 +285,12 @@ "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty": null, "azure.mgmt.sql.models.QueryCheck": null, "azure.mgmt.sql.models.QueryMetricInterval": null, - "azure.mgmt.sql.models.QueryMetricIntervalAutoGenerated": null, "azure.mgmt.sql.models.QueryMetricProperties": null, "azure.mgmt.sql.models.QueryStatistics": null, "azure.mgmt.sql.models.QueryStatisticsProperties": null, "azure.mgmt.sql.models.ReadScaleCapability": null, "azure.mgmt.sql.models.RecommendedAction": null, + "azure.mgmt.sql.models.RecommendedActionAutoGenerated": null, "azure.mgmt.sql.models.RecommendedActionErrorInfo": null, "azure.mgmt.sql.models.RecommendedActionImpactRecord": null, "azure.mgmt.sql.models.RecommendedActionImplementationInfo": null, @@ -321,8 +332,6 @@ "azure.mgmt.sql.models.ServerAzureADOnlyAuthentication": null, "azure.mgmt.sql.models.ServerBlobAuditingPolicy": null, "azure.mgmt.sql.models.ServerBlobAuditingPolicyListResult": null, - "azure.mgmt.sql.models.ServerCommunicationLink": null, - "azure.mgmt.sql.models.ServerCommunicationLinkListResult": null, "azure.mgmt.sql.models.ServerConfigurationOption": null, "azure.mgmt.sql.models.ServerConfigurationOptionListResult": null, "azure.mgmt.sql.models.ServerConnectionPolicy": null, @@ -351,12 +360,9 @@ "azure.mgmt.sql.models.ServerVersionCapability": null, "azure.mgmt.sql.models.ServerVulnerabilityAssessment": null, "azure.mgmt.sql.models.ServerVulnerabilityAssessmentListResult": null, - "azure.mgmt.sql.models.ServiceObjective": null, "azure.mgmt.sql.models.ServiceObjectiveCapability": null, - "azure.mgmt.sql.models.ServiceObjectiveListResult": null, "azure.mgmt.sql.models.ServicePrincipal": null, "azure.mgmt.sql.models.Sku": null, - "azure.mgmt.sql.models.SloUsageMetric": null, "azure.mgmt.sql.models.SqlAgentConfiguration": null, "azure.mgmt.sql.models.SqlVulnerabilityAssessment": null, "azure.mgmt.sql.models.SqlVulnerabilityAssessmentListResult": null, @@ -402,7 +408,7 @@ "azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters": null, "azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation": null, "azure.mgmt.sql.models.UpsertManagedServerOperationParameters": null, - "azure.mgmt.sql.models.UpsertManagedServerOperationStep": null, + "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration": null, "azure.mgmt.sql.models.Usage": null, "azure.mgmt.sql.models.UsageListResult": null, "azure.mgmt.sql.models.UserIdentity": null, @@ -420,12 +426,11 @@ "azure.mgmt.sql.models.WorkloadClassifierListResult": null, "azure.mgmt.sql.models.WorkloadGroup": null, "azure.mgmt.sql.models.WorkloadGroupListResult": null, - "azure.mgmt.sql.models.DataMaskingRuleState": null, - "azure.mgmt.sql.models.DataMaskingFunction": null, - "azure.mgmt.sql.models.GeoBackupPolicyState": null, - "azure.mgmt.sql.models.UnitType": null, - "azure.mgmt.sql.models.PrimaryAggregationType": null, - "azure.mgmt.sql.models.UnitDefinitionType": null, + "azure.mgmt.sql.models.ZonePinningCapability": null, + "azure.mgmt.sql.models.DiffBackupIntervalInHours": null, + "azure.mgmt.sql.models.BlobAuditingPolicyState": null, + "azure.mgmt.sql.models.CreatedByType": null, + "azure.mgmt.sql.models.AdvancedThreatProtectionState": null, "azure.mgmt.sql.models.RecommendedActionCurrentState": null, "azure.mgmt.sql.models.RecommendedActionInitiatedBy": null, "azure.mgmt.sql.models.ImplementationMethod": null, @@ -435,11 +440,49 @@ "azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom": null, "azure.mgmt.sql.models.ColumnDataType": null, "azure.mgmt.sql.models.TableTemporalType": null, - "azure.mgmt.sql.models.CreatedByType": null, + "azure.mgmt.sql.models.ManagementOperationState": null, + "azure.mgmt.sql.models.Phase": null, + "azure.mgmt.sql.models.DatabaseIdentityType": null, + "azure.mgmt.sql.models.CreateMode": null, + "azure.mgmt.sql.models.SampleName": null, + "azure.mgmt.sql.models.DatabaseStatus": null, + "azure.mgmt.sql.models.CatalogCollationType": null, + "azure.mgmt.sql.models.DatabaseLicenseType": null, + "azure.mgmt.sql.models.DatabaseReadScale": null, + "azure.mgmt.sql.models.SecondaryType": null, + "azure.mgmt.sql.models.BackupStorageRedundancy": null, + "azure.mgmt.sql.models.DatabaseKeyType": null, + "azure.mgmt.sql.models.AlwaysEncryptedEnclaveType": null, + "azure.mgmt.sql.models.FreeLimitExhaustionBehavior": null, + "azure.mgmt.sql.models.AvailabilityZoneType": null, "azure.mgmt.sql.models.SecurityAlertsPolicyState": null, + "azure.mgmt.sql.models.RuleStatus": null, + "azure.mgmt.sql.models.RuleSeverity": null, + "azure.mgmt.sql.models.RuleType": null, "azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType": null, "azure.mgmt.sql.models.VulnerabilityAssessmentScanState": null, + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentState": null, + "azure.mgmt.sql.models.DataMaskingRuleState": null, + "azure.mgmt.sql.models.DataMaskingFunction": null, + "azure.mgmt.sql.models.ReplicaSynchronizationHealth": null, + "azure.mgmt.sql.models.ReplicaConnectedState": null, + "azure.mgmt.sql.models.ReplicationModeType": null, + "azure.mgmt.sql.models.LinkRole": null, + "azure.mgmt.sql.models.FailoverModeType": null, + "azure.mgmt.sql.models.SeedingModeType": null, + "azure.mgmt.sql.models.ElasticPoolState": null, + "azure.mgmt.sql.models.ElasticPoolLicenseType": null, "azure.mgmt.sql.models.ServerKeyType": null, + "azure.mgmt.sql.models.FailoverGroupReplicationRole": null, + "azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy": null, + "azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy": null, + "azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType": null, + "azure.mgmt.sql.models.GeoBackupPolicyState": null, + "azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole": null, + "azure.mgmt.sql.models.SecondaryInstanceType": null, + "azure.mgmt.sql.models.ErrorType": null, + "azure.mgmt.sql.models.InstancePoolLicenseType": null, + "azure.mgmt.sql.models.JobAgentIdentityType": null, "azure.mgmt.sql.models.JobAgentState": null, "azure.mgmt.sql.models.JobExecutionLifecycle": null, "azure.mgmt.sql.models.ProvisioningState": null, @@ -449,306 +492,337 @@ "azure.mgmt.sql.models.JobStepActionSource": null, "azure.mgmt.sql.models.JobStepOutputType": null, "azure.mgmt.sql.models.JobTargetGroupMembershipType": null, + "azure.mgmt.sql.models.LedgerDigestUploadsState": null, "azure.mgmt.sql.models.MaxSizeUnit": null, "azure.mgmt.sql.models.LogSizeUnit": null, "azure.mgmt.sql.models.CapabilityStatus": null, "azure.mgmt.sql.models.PerformanceLevelUnit": null, "azure.mgmt.sql.models.PauseDelayTimeUnit": null, "azure.mgmt.sql.models.StorageCapabilityStorageAccountType": null, + "azure.mgmt.sql.models.TimeBasedImmutability": null, + "azure.mgmt.sql.models.TimeBasedImmutabilityMode": null, + "azure.mgmt.sql.models.SetLegalHoldImmutability": null, + "azure.mgmt.sql.models.BackupStorageAccessTier": null, "azure.mgmt.sql.models.DayOfWeek": null, + "azure.mgmt.sql.models.MoveOperationMode": null, "azure.mgmt.sql.models.QueryMetricUnitType": null, "azure.mgmt.sql.models.QueryTimeGrainType": null, + "azure.mgmt.sql.models.ManagedDatabaseStatus": null, + "azure.mgmt.sql.models.ManagedDatabaseCreateMode": null, + "azure.mgmt.sql.models.InaccessibilityReason": null, "azure.mgmt.sql.models.SecurityAlertPolicyState": null, "azure.mgmt.sql.models.SecurityEventType": null, - "azure.mgmt.sql.models.TransparentDataEncryptionState": null, - "azure.mgmt.sql.models.ManagedInstanceAdministratorType": null, - "azure.mgmt.sql.models.UpsertManagedServerOperationStepStatus": null, - "azure.mgmt.sql.models.ManagementOperationState": null, - "azure.mgmt.sql.models.OperationOrigin": null, - "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus": null, - "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire": null, - "azure.mgmt.sql.models.PrivateEndpointProvisioningState": null, - "azure.mgmt.sql.models.RestorePointType": null, - "azure.mgmt.sql.models.AdministratorType": null, - "azure.mgmt.sql.models.BlobAuditingPolicyState": null, - "azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem": null, - "azure.mgmt.sql.models.SyncAgentState": null, - "azure.mgmt.sql.models.SyncMemberDbType": null, - "azure.mgmt.sql.models.SyncGroupLogType": null, - "azure.mgmt.sql.models.SyncConflictResolutionPolicy": null, - "azure.mgmt.sql.models.SyncGroupState": null, - "azure.mgmt.sql.models.SyncDirection": null, - "azure.mgmt.sql.models.SyncMemberState": null, - "azure.mgmt.sql.models.VirtualNetworkRuleState": null, - "azure.mgmt.sql.models.DiffBackupIntervalInHours": null, - "azure.mgmt.sql.models.LedgerDigestUploadsState": null, - "azure.mgmt.sql.models.BackupStorageRedundancy": null, - "azure.mgmt.sql.models.ServerConnectionType": null, "azure.mgmt.sql.models.SensitivityLabelRank": null, + "azure.mgmt.sql.models.ClientClassificationSource": null, "azure.mgmt.sql.models.SensitivityLabelUpdateKind": null, "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind": null, - "azure.mgmt.sql.models.AdvancedThreatProtectionState": null, - "azure.mgmt.sql.models.MoveOperationMode": null, - "azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole": null, - "azure.mgmt.sql.models.SecondaryInstanceType": null, - "azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy": null, - "azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy": null, - "azure.mgmt.sql.models.DatabaseIdentityType": null, - "azure.mgmt.sql.models.CreateMode": null, - "azure.mgmt.sql.models.SampleName": null, - "azure.mgmt.sql.models.DatabaseStatus": null, - "azure.mgmt.sql.models.CatalogCollationType": null, - "azure.mgmt.sql.models.DatabaseLicenseType": null, - "azure.mgmt.sql.models.DatabaseReadScale": null, - "azure.mgmt.sql.models.SecondaryType": null, - "azure.mgmt.sql.models.DatabaseKeyType": null, - "azure.mgmt.sql.models.AlwaysEncryptedEnclaveType": null, - "azure.mgmt.sql.models.FreeLimitExhaustionBehavior": null, - "azure.mgmt.sql.models.AvailabilityZoneType": null, - "azure.mgmt.sql.models.ElasticPoolState": null, - "azure.mgmt.sql.models.ElasticPoolLicenseType": null, - "azure.mgmt.sql.models.ManagedDatabaseStatus": null, - "azure.mgmt.sql.models.ManagedDatabaseCreateMode": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploadsState": null, - "azure.mgmt.sql.models.RuleStatus": null, - "azure.mgmt.sql.models.RuleSeverity": null, - "azure.mgmt.sql.models.RuleType": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentState": null, - "azure.mgmt.sql.models.FailoverGroupReplicationRole": null, - "azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType": null, - "azure.mgmt.sql.models.InstancePoolLicenseType": null, + "azure.mgmt.sql.models.TransparentDataEncryptionState": null, + "azure.mgmt.sql.models.ManagedInstanceAdministratorType": null, + "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": null, "azure.mgmt.sql.models.IdentityType": null, "azure.mgmt.sql.models.ManagedServerCreateMode": null, "azure.mgmt.sql.models.ManagedInstanceLicenseType": null, "azure.mgmt.sql.models.HybridSecondaryUsage": null, "azure.mgmt.sql.models.HybridSecondaryUsageDetected": null, "azure.mgmt.sql.models.ManagedInstanceProxyOverride": null, + "azure.mgmt.sql.models.AdministratorType": null, "azure.mgmt.sql.models.PrincipalType": null, "azure.mgmt.sql.models.ServicePrincipalType": null, "azure.mgmt.sql.models.ExternalGovernanceStatus": null, - "azure.mgmt.sql.models.FreemiumType": null, + "azure.mgmt.sql.models.PricingModel": null, "azure.mgmt.sql.models.AuthMetadataLookupModes": null, "azure.mgmt.sql.models.ManagedInstanceDatabaseFormat": null, + "azure.mgmt.sql.models.ManagedLedgerDigestUploadsState": null, + "azure.mgmt.sql.models.OperationOrigin": null, + "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus": null, + "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire": null, + "azure.mgmt.sql.models.PrivateEndpointProvisioningState": null, "azure.mgmt.sql.models.ReplicationRole": null, "azure.mgmt.sql.models.ReplicationState": null, "azure.mgmt.sql.models.ReplicationLinkType": null, - "azure.mgmt.sql.models.ReplicaSynchronizationHealth": null, - "azure.mgmt.sql.models.ReplicaConnectedState": null, - "azure.mgmt.sql.models.ReplicationModeType": null, - "azure.mgmt.sql.models.LinkRole": null, - "azure.mgmt.sql.models.FailoverModeType": null, - "azure.mgmt.sql.models.SeedingModeType": null, + "azure.mgmt.sql.models.RestorePointType": null, + "azure.mgmt.sql.models.ServerConnectionType": null, "azure.mgmt.sql.models.MinimalTlsVersion": null, "azure.mgmt.sql.models.ServerPublicNetworkAccessFlag": null, "azure.mgmt.sql.models.ServerWorkspaceFeature": null, "azure.mgmt.sql.models.ServerNetworkAccessFlag": null, "azure.mgmt.sql.models.ServerCreateMode": null, - "azure.mgmt.sql.models.TimeBasedImmutability": null, - "azure.mgmt.sql.models.TimeBasedImmutabilityMode": null, - "azure.mgmt.sql.models.SetLegalHoldImmutability": null, - "azure.mgmt.sql.models.BackupStorageAccessTier": null, - "azure.mgmt.sql.models.Phase": null, - "azure.mgmt.sql.models.GeoBackupPolicyName": null, + "azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem": null, + "azure.mgmt.sql.models.SyncAgentState": null, + "azure.mgmt.sql.models.SyncMemberDbType": null, + "azure.mgmt.sql.models.SyncConflictResolutionPolicy": null, + "azure.mgmt.sql.models.SyncGroupState": null, + "azure.mgmt.sql.models.SyncGroupLogType": null, + "azure.mgmt.sql.models.SyncDirection": null, + "azure.mgmt.sql.models.SyncMemberState": null, + "azure.mgmt.sql.models.TransparentDataEncryptionScanState": null, + "azure.mgmt.sql.models.VirtualNetworkRuleState": null, + "azure.mgmt.sql.models.ShortTermRetentionPolicyName": null, + "azure.mgmt.sql.models.AdvancedThreatProtectionName": null, + "azure.mgmt.sql.models.EncryptionProtectorName": null, + "azure.mgmt.sql.models.OperationMode": null, + "azure.mgmt.sql.models.StorageKeyType": null, + "azure.mgmt.sql.models.ReplicaType": null, "azure.mgmt.sql.models.SecurityAlertPolicyName": null, "azure.mgmt.sql.models.VulnerabilityAssessmentName": null, + "azure.mgmt.sql.models.BaselineName": null, + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentName": null, + "azure.mgmt.sql.models.DataMaskingPolicyName": null, "azure.mgmt.sql.models.DataWarehouseUserActivityName": null, - "azure.mgmt.sql.models.EncryptionProtectorName": null, + "azure.mgmt.sql.models.FailoverType": null, + "azure.mgmt.sql.models.InstanceRole": null, + "azure.mgmt.sql.models.RoleChangeType": null, + "azure.mgmt.sql.models.GeoBackupPolicyName": null, + "azure.mgmt.sql.models.LedgerDigestUploadsName": null, "azure.mgmt.sql.models.CapabilityGroup": null, + "azure.mgmt.sql.models.DatabaseState": null, + "azure.mgmt.sql.models.LongTermRetentionPolicyName": null, "azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName": null, + "azure.mgmt.sql.models.RestoreDetailsName": null, "azure.mgmt.sql.models.TransparentDataEncryptionName": null, "azure.mgmt.sql.models.AdministratorName": null, "azure.mgmt.sql.models.AuthenticationName": null, + "azure.mgmt.sql.models.DtcName": null, "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName": null, + "azure.mgmt.sql.models.AggregationFunctionType": null, + "azure.mgmt.sql.models.MetricType": null, + "azure.mgmt.sql.models.ManagedLedgerDigestUploadsName": null, + "azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated": null, + "azure.mgmt.sql.models.ServerConfigurationOptionName": null, + "azure.mgmt.sql.models.ConnectionPolicyName": null, "azure.mgmt.sql.models.DevOpsAuditingSettingsName": null, "azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState": null, + "azure.mgmt.sql.models.StartStopScheduleName": null, "azure.mgmt.sql.models.SyncGroupsType": null, - "azure.mgmt.sql.models.ShortTermRetentionPolicyName": null, - "azure.mgmt.sql.models.OperationMode": null, - "azure.mgmt.sql.models.StorageKeyType": null, - "azure.mgmt.sql.models.LedgerDigestUploadsName": null, - "azure.mgmt.sql.models.DatabaseState": null, - "azure.mgmt.sql.models.ConnectionPolicyName": null, - "azure.mgmt.sql.models.AdvancedThreatProtectionName": null, - "azure.mgmt.sql.models.DtcName": null, "azure.mgmt.sql.models.DNSRefreshOperationStatus": null, - "azure.mgmt.sql.models.RestoreDetailsName": null, - "azure.mgmt.sql.models.ReplicaType": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploadsName": null, - "azure.mgmt.sql.models.ServerConfigurationOptionName": null, - "azure.mgmt.sql.models.StartStopScheduleName": null, - "azure.mgmt.sql.models.BaselineName": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentName": null, - "azure.mgmt.sql.models.AggregationFunctionType": null, - "azure.mgmt.sql.models.MetricType": null, - "azure.mgmt.sql.models.FailoverType": null, - "azure.mgmt.sql.models.InstanceRole": null, - "azure.mgmt.sql.models.RoleChangeType": null, - "azure.mgmt.sql.models.LongTermRetentionPolicyName": null, - "azure.mgmt.sql.models.ServiceObjectiveName": null, "azure.mgmt.sql.models.AutomaticTuningOptionModeDesired": null, "azure.mgmt.sql.models.AutomaticTuningOptionModeActual": null, "azure.mgmt.sql.models.AutomaticTuningDisabledReason": null, "azure.mgmt.sql.models.AutomaticTuningServerReason": null, - "azure.mgmt.sql.models.DataMaskingState": null, "azure.mgmt.sql.models.AutomaticTuningMode": null, + "azure.mgmt.sql.models.DataMaskingState": null, "azure.mgmt.sql.models.AutomaticTuningServerMode": null, "azure.mgmt.sql.models.CheckNameAvailabilityReason": null, "azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName": null, "azure.mgmt.sql.models.SensitivityLabelSource": null, - "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.DataMaskingRulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DataMaskingRulesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.list_by_database": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.get": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_metrics": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_metrics": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_metric_definitions": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_metric_definitions": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.DatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.get": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_update": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_export": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_export": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_failover": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_import_method": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_import_method": null, - "azure.mgmt.sql.operations.DatabasesOperations.rename": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.rename": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_pause": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_pause": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_resume": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_resume": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_inaccessible_by_server": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_inaccessible_by_server": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.list_metrics": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_metrics": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.list_metric_definitions": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_metric_definitions": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.get": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.get": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_update": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_failover": null, - "azure.mgmt.sql.operations.ServerCommunicationLinksOperations.delete": null, - "azure.mgmt.sql.aio.operations.ServerCommunicationLinksOperations.delete": null, - "azure.mgmt.sql.operations.ServerCommunicationLinksOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerCommunicationLinksOperations.get": null, - "azure.mgmt.sql.operations.ServerCommunicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerCommunicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerCommunicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerCommunicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServiceObjectivesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServiceObjectivesOperations.get": null, - "azure.mgmt.sql.operations.ServiceObjectivesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServiceObjectivesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ElasticPoolActivitiesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.aio.operations.ElasticPoolActivitiesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.operations.ElasticPoolDatabaseActivitiesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.aio.operations.ElasticPoolDatabaseActivitiesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.operations.ServerUsagesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerUsagesOperations.list_by_server": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.update": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.update": null, - "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.update": null, - "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.update": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, - "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.get": null, + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.get": null, + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.update": null, + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.update": null, + "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.get": null, + "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.update": null, + "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.update": null, + "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_table": null, + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_table": null, + "azure.mgmt.sql.operations.DatabaseColumnsOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.get": null, + "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, + "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, + "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, + "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.get": null, + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.DatabaseOperationsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseOperationsOperations.cancel": null, + "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.cancel": null, + "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, + "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.get": null, "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.update": null, "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.update": null, + "azure.mgmt.sql.operations.DatabasesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_server": null, + "azure.mgmt.sql.operations.DatabasesOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.get": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_delete": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_update": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_export": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_export": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_failover": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_import_method": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_import_method": null, + "azure.mgmt.sql.operations.DatabasesOperations.rename": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.rename": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_pause": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_pause": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_resume": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_resume": null, + "azure.mgmt.sql.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, + "azure.mgmt.sql.operations.DatabasesOperations.list_by_elastic_pool": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_elastic_pool": null, + "azure.mgmt.sql.operations.DatabasesOperations.list_inaccessible_by_server": null, + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_inaccessible_by_server": null, "azure.mgmt.sql.operations.DatabaseSchemasOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.list_by_database": null, "azure.mgmt.sql.operations.DatabaseSchemasOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.get": null, + "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, "azure.mgmt.sql.operations.DatabaseTablesOperations.list_by_schema": null, "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.list_by_schema": null, "azure.mgmt.sql.operations.DatabaseTablesOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.get": null, + "azure.mgmt.sql.operations.DatabaseUsagesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseUsagesOperations.list_by_database": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.delete": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.get": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.get": null, "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.export": null, "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.get": null, - "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.get": null, + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, + "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.get": null, + "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.operations.DataMaskingRulesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.list_by_database": null, + "azure.mgmt.sql.operations.DataMaskingRulesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.create_or_update": null, "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.list_by_database": null, + "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.get": null, + "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.get": null, "azure.mgmt.sql.operations.DeletedServersOperations.list": null, "azure.mgmt.sql.aio.operations.DeletedServersOperations.list": null, - "azure.mgmt.sql.operations.DeletedServersOperations.get": null, - "azure.mgmt.sql.aio.operations.DeletedServersOperations.get": null, "azure.mgmt.sql.operations.DeletedServersOperations.list_by_location": null, "azure.mgmt.sql.aio.operations.DeletedServersOperations.list_by_location": null, + "azure.mgmt.sql.operations.DeletedServersOperations.get": null, + "azure.mgmt.sql.aio.operations.DeletedServersOperations.get": null, "azure.mgmt.sql.operations.DeletedServersOperations.begin_recover": null, "azure.mgmt.sql.aio.operations.DeletedServersOperations.begin_recover": null, - "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.cancel": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.get": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.get": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_update": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": null, "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": null, + "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.cancel": null, + "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.cancel": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_by_server": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.get": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.get": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_delete": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_update": null, + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_failover": null, "azure.mgmt.sql.operations.EncryptionProtectorsOperations.list_by_server": null, "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.list_by_server": null, "azure.mgmt.sql.operations.EncryptionProtectorsOperations.get": null, @@ -757,16 +831,78 @@ "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.EncryptionProtectorsOperations.begin_revalidate": null, "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_revalidate": null, + "azure.mgmt.sql.operations.EndpointCertificatesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.EndpointCertificatesOperations.get": null, + "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.get": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.list_by_server": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.get": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.get": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_delete": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_update": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_failover": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, + "azure.mgmt.sql.operations.FirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.operations.FirewallRulesOperations.replace": null, + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.replace": null, "azure.mgmt.sql.operations.FirewallRulesOperations.get": null, "azure.mgmt.sql.aio.operations.FirewallRulesOperations.get": null, "azure.mgmt.sql.operations.FirewallRulesOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.FirewallRulesOperations.create_or_update": null, "azure.mgmt.sql.operations.FirewallRulesOperations.delete": null, "azure.mgmt.sql.aio.operations.FirewallRulesOperations.delete": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.replace": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.replace": null, + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.list": null, + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.list": null, + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.get": null, + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.create_or_update": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.list_by_location": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.list_by_location": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.get": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.get": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_delete": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_failover": null, + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, + "azure.mgmt.sql.operations.InstancePoolOperationsOperations.list_by_instance_pool": null, + "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.list_by_instance_pool": null, + "azure.mgmt.sql.operations.InstancePoolOperationsOperations.get": null, + "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.get": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.list": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.list_by_resource_group": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list_by_resource_group": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.get": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.get": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_delete": null, + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_update": null, + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.get": null, + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.get": null, + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.create_or_update": null, + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.delete": null, + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.delete": null, "azure.mgmt.sql.operations.JobAgentsOperations.list_by_server": null, "azure.mgmt.sql.aio.operations.JobAgentsOperations.list_by_server": null, "azure.mgmt.sql.operations.JobAgentsOperations.get": null, @@ -787,19 +923,19 @@ "azure.mgmt.sql.aio.operations.JobCredentialsOperations.delete": null, "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_agent": null, "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.cancel": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create": null, "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_job": null, "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_job": null, "azure.mgmt.sql.operations.JobExecutionsOperations.get": null, "azure.mgmt.sql.aio.operations.JobExecutionsOperations.get": null, "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.get": null, + "azure.mgmt.sql.operations.JobExecutionsOperations.cancel": null, + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.cancel": null, + "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create": null, + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create": null, + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.list_by_agent": null, + "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.list_by_agent": null, + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.get": null, "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.get": null, "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.begin_create_or_update": null, @@ -817,10 +953,6 @@ "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.list_by_job_execution": null, "azure.mgmt.sql.operations.JobStepExecutionsOperations.get": null, "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.get": null, - "azure.mgmt.sql.operations.JobStepsOperations.list_by_version": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_version": null, - "azure.mgmt.sql.operations.JobStepsOperations.get_by_version": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.get_by_version": null, "azure.mgmt.sql.operations.JobStepsOperations.list_by_job": null, "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_job": null, "azure.mgmt.sql.operations.JobStepsOperations.get": null, @@ -829,12 +961,16 @@ "azure.mgmt.sql.aio.operations.JobStepsOperations.create_or_update": null, "azure.mgmt.sql.operations.JobStepsOperations.delete": null, "azure.mgmt.sql.aio.operations.JobStepsOperations.delete": null, - "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_job_execution": null, - "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_job_execution": null, + "azure.mgmt.sql.operations.JobStepsOperations.list_by_version": null, + "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_version": null, + "azure.mgmt.sql.operations.JobStepsOperations.get_by_version": null, + "azure.mgmt.sql.aio.operations.JobStepsOperations.get_by_version": null, "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_step": null, "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_step": null, "azure.mgmt.sql.operations.JobTargetExecutionsOperations.get": null, "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.get": null, + "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_job_execution": null, + "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_job_execution": null, "azure.mgmt.sql.operations.JobTargetGroupsOperations.list_by_agent": null, "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.list_by_agent": null, "azure.mgmt.sql.operations.JobTargetGroupsOperations.get": null, @@ -847,76 +983,212 @@ "azure.mgmt.sql.aio.operations.JobVersionsOperations.list_by_job": null, "azure.mgmt.sql.operations.JobVersionsOperations.get": null, "azure.mgmt.sql.aio.operations.JobVersionsOperations.get": null, + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.list_by_database": null, + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.get": null, + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.get": null, + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_disable": null, + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_disable": null, "azure.mgmt.sql.operations.CapabilitiesOperations.list_by_location": null, "azure.mgmt.sql.aio.operations.CapabilitiesOperations.list_by_location": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_location": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_location": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_server": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_database": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.get": null, + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations.get": null, "azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations.get": null, "azure.mgmt.sql.operations.MaintenanceWindowsOperations.get": null, "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.get": null, "azure.mgmt.sql.operations.MaintenanceWindowsOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.create_or_update": null, + "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": null, "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_table": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_table": null, "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, + "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.list_by_query": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.list_by_query": null, + "azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_delete": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_update": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_cancel_move": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_cancel_move": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_move": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_move": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_restore": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_restore": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_start_move": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_start_move": null, + "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.list_by_schema": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.list_by_schema": null, "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": null, + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.list_by_instance": null, "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.list_by_instance": null, "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.get": null, @@ -925,22 +1197,34 @@ "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_delete": null, + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": null, "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.get": null, + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": null, "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": null, "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.get": null, "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.list_by_instance": null, "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.list_by_instance": null, "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.get": null, @@ -949,59 +1233,123 @@ "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_delete": null, + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": null, "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": null, "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": null, "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.get": null, "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.cancel": null, "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.cancel": null, + "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": null, "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": null, "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": null, "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.get": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.list": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_instance_pool": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_instance_pool": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_resource_group": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_resource_group": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.get": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_delete": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_update": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_failover": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_refresh_status": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_refresh_status": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_start": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_start": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_stop": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_stop": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_managed_instance": null, + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": null, + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": null, "azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations.begin_create": null, "azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations.begin_create": null, + "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": null, "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.get": null, + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, + "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, + "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": null, "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": null, "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, - "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.Operations.list": null, - "azure.mgmt.sql.aio.operations.Operations.list": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.list_by_server": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.get": null, + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.get": null, + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_delete": null, + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": null, + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.get": null, + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.get": null, + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": null, + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": null, + "azure.mgmt.sql.operations.Operations.list": null, + "azure.mgmt.sql.aio.operations.Operations.list": null, + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.list_by_server": null, + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.get": null, + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.get": null, + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_delete": null, + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.list_by_server": null, + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.get": null, "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.get": null, "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": null, @@ -1011,10 +1359,38 @@ "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.list_by_server": null, "azure.mgmt.sql.operations.PrivateLinkResourcesOperations.get": null, "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.get": null, + "azure.mgmt.sql.operations.RecoverableDatabasesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.list_by_server": null, + "azure.mgmt.sql.operations.RecoverableDatabasesOperations.get": null, + "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.get": null, "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.list_by_instance": null, "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.list_by_instance": null, "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.get": null, "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.get": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_database": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.get": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.get": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_delete": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_update": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, + "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_server": null, + "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.list_by_server": null, + "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.get": null, + "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.get": null, + "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.get": null, + "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.get": null, "azure.mgmt.sql.operations.RestorePointsOperations.list_by_database": null, "azure.mgmt.sql.aio.operations.RestorePointsOperations.list_by_database": null, "azure.mgmt.sql.operations.RestorePointsOperations.begin_create": null, @@ -1023,6 +1399,32 @@ "azure.mgmt.sql.aio.operations.RestorePointsOperations.get": null, "azure.mgmt.sql.operations.RestorePointsOperations.delete": null, "azure.mgmt.sql.aio.operations.RestorePointsOperations.delete": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_current_by_database": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_current_by_database": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.update": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.update": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_recommended_by_database": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_recommended_by_database": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.get": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.get": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.create_or_update": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.delete": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.delete": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.disable_recommendation": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.disable_recommendation": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.enable_recommendation": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.enable_recommendation": null, + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_by_database": null, + "azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations.update": null, + "azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations.update": null, + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerAdvisorsOperations.list_by_server": null, "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerAdvisorsOperations.get": null, @@ -1033,36 +1435,48 @@ "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.get": null, "azure.mgmt.sql.operations.ServerAutomaticTuningOperations.update": null, "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.update": null, + "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.get": null, "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.get": null, "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.get": null, "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.get": null, "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.get": null, + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.get": null, + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.get": null, + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.get": null, + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.list_by_server": null, "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.get": null, "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.get": null, "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerDnsAliasesOperations.get": null, "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.get": null, "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_acquire": null, "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_acquire": null, "azure.mgmt.sql.operations.ServerKeysOperations.list_by_server": null, @@ -1075,62 +1489,124 @@ "azure.mgmt.sql.aio.operations.ServerKeysOperations.begin_delete": null, "azure.mgmt.sql.operations.ServerOperationsOperations.list_by_server": null, "azure.mgmt.sql.aio.operations.ServerOperationsOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServersOperations.check_name_availability": null, + "azure.mgmt.sql.aio.operations.ServersOperations.check_name_availability": null, + "azure.mgmt.sql.operations.ServersOperations.list": null, + "azure.mgmt.sql.aio.operations.ServersOperations.list": null, + "azure.mgmt.sql.operations.ServersOperations.list_by_resource_group": null, + "azure.mgmt.sql.aio.operations.ServersOperations.list_by_resource_group": null, + "azure.mgmt.sql.operations.ServersOperations.get": null, + "azure.mgmt.sql.aio.operations.ServersOperations.get": null, + "azure.mgmt.sql.operations.ServersOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServersOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ServersOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ServersOperations.begin_delete": null, + "azure.mgmt.sql.operations.ServersOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.ServersOperations.begin_update": null, + "azure.mgmt.sql.operations.ServersOperations.begin_import_database": null, + "azure.mgmt.sql.aio.operations.ServersOperations.begin_import_database": null, + "azure.mgmt.sql.operations.ServersOperations.begin_refresh_status": null, + "azure.mgmt.sql.aio.operations.ServersOperations.begin_refresh_status": null, + "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.get": null, "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.get": null, + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.get": null, + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_delete": null, + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_location": null, + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_location": null, "azure.mgmt.sql.operations.ServerTrustGroupsOperations.get": null, "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.get": null, "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_location": null, "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_instance": null, "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_instance": null, + "azure.mgmt.sql.operations.ServerUsagesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerUsagesOperations.list_by_server": null, + "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.get": null, "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": null, "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.delete": null, "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, "azure.mgmt.sql.operations.SqlAgentOperations.get": null, "azure.mgmt.sql.aio.operations.SqlAgentOperations.get": null, "azure.mgmt.sql.operations.SqlAgentOperations.create_or_update": null, "azure.mgmt.sql.aio.operations.SqlAgentOperations.create_or_update": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.get": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.get": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations.delete": null, + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations.delete": null, + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.get": null, + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.get": null, + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.delete": null, + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.delete": null, "azure.mgmt.sql.operations.SubscriptionUsagesOperations.list_by_location": null, "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.list_by_location": null, "azure.mgmt.sql.operations.SubscriptionUsagesOperations.get": null, "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.get": null, + "azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations.list_by_database": null, + "azure.mgmt.sql.operations.SyncAgentsOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_by_server": null, "azure.mgmt.sql.operations.SyncAgentsOperations.get": null, "azure.mgmt.sql.aio.operations.SyncAgentsOperations.get": null, "azure.mgmt.sql.operations.SyncAgentsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.SyncAgentsOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_delete": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_by_server": null, "azure.mgmt.sql.operations.SyncAgentsOperations.generate_key": null, "azure.mgmt.sql.aio.operations.SyncAgentsOperations.generate_key": null, "azure.mgmt.sql.operations.SyncAgentsOperations.list_linked_databases": null, "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_linked_databases": null, "azure.mgmt.sql.operations.SyncGroupsOperations.list_sync_database_ids": null, "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_sync_database_ids": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_hub_schemas": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_hub_schemas": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_logs": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_logs": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.cancel_sync": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.cancel_sync": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.trigger_sync": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.trigger_sync": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_by_database": null, "azure.mgmt.sql.operations.SyncGroupsOperations.get": null, "azure.mgmt.sql.aio.operations.SyncGroupsOperations.get": null, "azure.mgmt.sql.operations.SyncGroupsOperations.begin_create_or_update": null, @@ -1139,8 +1615,18 @@ "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_delete": null, "azure.mgmt.sql.operations.SyncGroupsOperations.begin_update": null, "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_by_database": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.cancel_sync": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.cancel_sync": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.list_hub_schemas": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_hub_schemas": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.list_logs": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_logs": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, + "azure.mgmt.sql.operations.SyncGroupsOperations.trigger_sync": null, + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.trigger_sync": null, + "azure.mgmt.sql.operations.SyncMembersOperations.list_by_sync_group": null, + "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_by_sync_group": null, "azure.mgmt.sql.operations.SyncMembersOperations.get": null, "azure.mgmt.sql.aio.operations.SyncMembersOperations.get": null, "azure.mgmt.sql.operations.SyncMembersOperations.begin_create_or_update": null, @@ -1149,537 +1635,65 @@ "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_delete": null, "azure.mgmt.sql.operations.SyncMembersOperations.begin_update": null, "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_update": null, - "azure.mgmt.sql.operations.SyncMembersOperations.list_by_sync_group": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_by_sync_group": null, - "azure.mgmt.sql.operations.SyncMembersOperations.list_member_schemas": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_member_schemas": null, "azure.mgmt.sql.operations.SyncMembersOperations.begin_refresh_member_schema": null, "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_refresh_member_schema": null, + "azure.mgmt.sql.operations.SyncMembersOperations.list_member_schemas": null, + "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_member_schemas": null, "azure.mgmt.sql.operations.TdeCertificatesOperations.begin_create": null, "azure.mgmt.sql.aio.operations.TdeCertificatesOperations.begin_create": null, "azure.mgmt.sql.operations.TimeZonesOperations.list_by_location": null, "azure.mgmt.sql.aio.operations.TimeZonesOperations.list_by_location": null, "azure.mgmt.sql.operations.TimeZonesOperations.get": null, "azure.mgmt.sql.aio.operations.TimeZonesOperations.get": null, + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.list_by_database": null, + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.get": null, + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.get": null, + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_resume": null, + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_resume": null, + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_suspend": null, + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_suspend": null, + "azure.mgmt.sql.operations.UsagesOperations.list_by_instance_pool": null, + "azure.mgmt.sql.aio.operations.UsagesOperations.list_by_instance_pool": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.list": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.list_by_resource_group": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list_by_resource_group": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.get": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.get": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_create_or_update": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_create_or_update": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_delete": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_delete": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update": null, + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update_dns_servers": null, + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update_dns_servers": null, + "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.list_by_server": null, + "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.list_by_server": null, "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.get": null, "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.get": null, "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_delete": null, - "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.list_by_server": null, + "azure.mgmt.sql.operations.WorkloadClassifiersOperations.list_by_workload_group": null, + "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.list_by_workload_group": null, "azure.mgmt.sql.operations.WorkloadClassifiersOperations.get": null, "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.get": null, "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_delete": null, "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_delete": null, - "azure.mgmt.sql.operations.WorkloadClassifiersOperations.list_by_workload_group": null, - "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.list_by_workload_group": null, + "azure.mgmt.sql.operations.WorkloadGroupsOperations.list_by_database": null, + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.list_by_database": null, "azure.mgmt.sql.operations.WorkloadGroupsOperations.get": null, "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.get": null, "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_create_or_update": null, "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_create_or_update": null, "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.WorkloadGroupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseUsagesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseUsagesOperations.list_by_database": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.get": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_delete": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.UsagesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.aio.operations.UsagesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.get": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_delete": null, - "azure.mgmt.sql.operations.EndpointCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.EndpointCertificatesOperations.get": null, - "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.get": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.get": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, - "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations.list_by_database": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.list": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.get": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.get": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_delete": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update_dns_servers": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update_dns_servers": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.get": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, - "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_cancel_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_cancel_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_restore": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_restore": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_start_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_start_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.operations.RecoverableDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.RecoverableDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.get": null, - "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.get": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.get": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.get": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.delete": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.delete": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.list_by_database": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.get": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.get": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.get": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.delete": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.delete": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.list_by_server": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.get": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.list": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.get": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.get": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_delete": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_failover": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_refresh_status": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_refresh_status": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_start": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_start": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_stop": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_stop": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_database": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.get": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.get": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_delete": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_update": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.get": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, - "azure.mgmt.sql.operations.ServersOperations.check_name_availability": null, - "azure.mgmt.sql.aio.operations.ServersOperations.check_name_availability": null, - "azure.mgmt.sql.operations.ServersOperations.list": null, - "azure.mgmt.sql.aio.operations.ServersOperations.list": null, - "azure.mgmt.sql.operations.ServersOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.ServersOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.ServersOperations.get": null, - "azure.mgmt.sql.aio.operations.ServersOperations.get": null, - "azure.mgmt.sql.operations.ServersOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServersOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_update": null, - "azure.mgmt.sql.operations.ServersOperations.begin_import_database": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_import_database": null, - "azure.mgmt.sql.operations.ServersOperations.begin_refresh_status": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_refresh_status": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_server": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseOperationsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseOperationsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.cancel": null + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_delete": null } } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py index 0c40e17514d7..4abe2d42c73f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py @@ -31,6 +31,9 @@ class SqlManagementClientConfiguration: # pylint: disable=too-many-instance-att :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -40,6 +43,8 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + api_version: str = kwargs.pop("api_version", "2025-01-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -48,6 +53,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.cloud_setting = cloud_setting + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-sql/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) 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 289890219482..5538d08ae444 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 @@ -52,8 +52,6 @@ DatabasesOperations, DeletedServersOperations, DistributedAvailabilityGroupsOperations, - ElasticPoolActivitiesOperations, - ElasticPoolDatabaseActivitiesOperations, ElasticPoolOperationsOperations, ElasticPoolsOperations, EncryptionProtectorsOperations, @@ -65,6 +63,7 @@ GeoBackupPoliciesOperations, IPv6FirewallRulesOperations, InstanceFailoverGroupsOperations, + InstancePoolOperationsOperations, InstancePoolsOperations, JobAgentsOperations, JobCredentialsOperations, @@ -116,6 +115,7 @@ ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations, ManagedServerDnsAliasesOperations, ManagedServerSecurityAlertPoliciesOperations, + NetworkSecurityPerimeterConfigurationsOperations, Operations, OutboundFirewallRulesOperations, PrivateEndpointConnectionsOperations, @@ -134,7 +134,6 @@ ServerAzureADAdministratorsOperations, ServerAzureADOnlyAuthenticationsOperations, ServerBlobAuditingPoliciesOperations, - ServerCommunicationLinksOperations, ServerConfigurationOptionsOperations, ServerConnectionPoliciesOperations, ServerDevOpsAuditSettingsOperations, @@ -147,7 +146,6 @@ ServerUsagesOperations, ServerVulnerabilityAssessmentsOperations, ServersOperations, - ServiceObjectivesOperations, SqlAgentOperations, SqlVulnerabilityAssessmentBaselineOperations, SqlVulnerabilityAssessmentBaselinesOperations, @@ -179,49 +177,84 @@ from azure.core.credentials import TokenCredential -class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class SqlManagementClient: # pylint: disable=too-many-instance-attributes """The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete databases. - :ivar data_masking_policies: DataMaskingPoliciesOperations operations - :vartype data_masking_policies: azure.mgmt.sql.operations.DataMaskingPoliciesOperations - :ivar data_masking_rules: DataMaskingRulesOperations operations - :vartype data_masking_rules: azure.mgmt.sql.operations.DataMaskingRulesOperations - :ivar geo_backup_policies: GeoBackupPoliciesOperations operations - :vartype geo_backup_policies: azure.mgmt.sql.operations.GeoBackupPoliciesOperations - :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.sql.operations.DatabasesOperations - :ivar elastic_pools: ElasticPoolsOperations operations - :vartype elastic_pools: azure.mgmt.sql.operations.ElasticPoolsOperations - :ivar server_communication_links: ServerCommunicationLinksOperations operations - :vartype server_communication_links: - azure.mgmt.sql.operations.ServerCommunicationLinksOperations - :ivar service_objectives: ServiceObjectivesOperations operations - :vartype service_objectives: azure.mgmt.sql.operations.ServiceObjectivesOperations - :ivar elastic_pool_activities: ElasticPoolActivitiesOperations operations - :vartype elastic_pool_activities: azure.mgmt.sql.operations.ElasticPoolActivitiesOperations - :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations - :vartype elastic_pool_database_activities: - azure.mgmt.sql.operations.ElasticPoolDatabaseActivitiesOperations - :ivar server_usages: ServerUsagesOperations operations - :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations + :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations + operations + :vartype backup_short_term_retention_policies: + azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations + :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations + :vartype server_blob_auditing_policies: + azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations + :ivar database_blob_auditing_policies: DatabaseBlobAuditingPoliciesOperations operations + :vartype database_blob_auditing_policies: + azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations + :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations + operations + :vartype extended_database_blob_auditing_policies: + azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations + :ivar extended_server_blob_auditing_policies: ExtendedServerBlobAuditingPoliciesOperations + operations + :vartype extended_server_blob_auditing_policies: + azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations + :ivar database_advanced_threat_protection_settings: + DatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype database_advanced_threat_protection_settings: + azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations :ivar database_advisors: DatabaseAdvisorsOperations operations :vartype database_advisors: azure.mgmt.sql.operations.DatabaseAdvisorsOperations :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations :vartype database_automatic_tuning: azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations :ivar database_columns: DatabaseColumnsOperations operations :vartype database_columns: azure.mgmt.sql.operations.DatabaseColumnsOperations + :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations + :vartype database_encryption_protectors: + azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations + :ivar database_extensions: DatabaseExtensionsOperations operations + :vartype database_extensions: azure.mgmt.sql.operations.DatabaseExtensionsOperations + :ivar database_operations: DatabaseOperationsOperations operations + :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperationsOperations :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations :vartype database_recommended_actions: azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations + :ivar databases: DatabasesOperations operations + :vartype databases: azure.mgmt.sql.operations.DatabasesOperations :ivar database_schemas: DatabaseSchemasOperations operations :vartype database_schemas: azure.mgmt.sql.operations.DatabaseSchemasOperations :ivar database_security_alert_policies: DatabaseSecurityAlertPoliciesOperations operations :vartype database_security_alert_policies: azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar database_sql_vulnerability_assessment_rule_baselines: + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scan_result: + DatabaseSqlVulnerabilityAssessmentScanResultOperations operations + :vartype database_sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :ivar database_tables: DatabaseTablesOperations operations :vartype database_tables: azure.mgmt.sql.operations.DatabaseTablesOperations + :ivar database_usages: DatabaseUsagesOperations operations + :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_vulnerability_assessment_rule_baselines: @@ -233,17 +266,40 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype database_vulnerability_assessment_scans: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar data_masking_policies: DataMaskingPoliciesOperations operations + :vartype data_masking_policies: azure.mgmt.sql.operations.DataMaskingPoliciesOperations + :ivar data_masking_rules: DataMaskingRulesOperations operations + :vartype data_masking_rules: azure.mgmt.sql.operations.DataMaskingRulesOperations :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations :vartype data_warehouse_user_activities: azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations :ivar deleted_servers: DeletedServersOperations operations :vartype deleted_servers: azure.mgmt.sql.operations.DeletedServersOperations + :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations + :vartype distributed_availability_groups: + azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperationsOperations + :ivar elastic_pools: ElasticPoolsOperations operations + :vartype elastic_pools: azure.mgmt.sql.operations.ElasticPoolsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations + :ivar endpoint_certificates: EndpointCertificatesOperations operations + :vartype endpoint_certificates: azure.mgmt.sql.operations.EndpointCertificatesOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations :ivar firewall_rules: FirewallRulesOperations operations :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations + :ivar geo_backup_policies: GeoBackupPoliciesOperations operations + :vartype geo_backup_policies: azure.mgmt.sql.operations.GeoBackupPoliciesOperations + :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations + :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations + :ivar instance_pool_operations: InstancePoolOperationsOperations operations + :vartype instance_pool_operations: azure.mgmt.sql.operations.InstancePoolOperationsOperations + :ivar instance_pools: InstancePoolsOperations operations + :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations + :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations + :vartype ipv6_firewall_rules: azure.mgmt.sql.operations.IPv6FirewallRulesOperations :ivar job_agents: JobAgentsOperations operations :vartype job_agents: azure.mgmt.sql.operations.JobAgentsOperations :ivar job_credentials: JobCredentialsOperations operations @@ -264,8 +320,20 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype job_target_groups: azure.mgmt.sql.operations.JobTargetGroupsOperations :ivar job_versions: JobVersionsOperations operations :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations + :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations + :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations :ivar capabilities: CapabilitiesOperations operations :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations + :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations + :vartype long_term_retention_backups: + azure.mgmt.sql.operations.LongTermRetentionBackupsOperations + :ivar long_term_retention_managed_instance_backups: + LongTermRetentionManagedInstanceBackupsOperations operations + :vartype long_term_retention_managed_instance_backups: + azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations + :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations + :vartype long_term_retention_policies: + azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations :vartype maintenance_window_options: azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations @@ -275,10 +343,22 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedBackupShortTermRetentionPoliciesOperations operations :vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations + :ivar managed_database_advanced_threat_protection_settings: + ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype managed_database_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations :vartype managed_database_columns: azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations + :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations + :vartype managed_database_move_operations: + azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations :vartype managed_database_queries: azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations + :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations + :vartype managed_database_restore_details: + azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations + :ivar managed_databases: ManagedDatabasesOperations operations + :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations :vartype managed_database_schemas: azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations :ivar managed_database_security_alert_policies: ManagedDatabaseSecurityAlertPoliciesOperations @@ -288,6 +368,14 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations :vartype managed_database_security_events: azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations + :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations + operations + :vartype managed_database_sensitivity_labels: + azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar managed_database_recommended_sensitivity_labels: + ManagedDatabaseRecommendedSensitivityLabelsOperations operations + :vartype managed_database_recommended_sensitivity_labels: + azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations :ivar managed_database_tables: ManagedDatabaseTablesOperations operations :vartype managed_database_tables: azure.mgmt.sql.operations.ManagedDatabaseTablesOperations :ivar managed_database_transparent_data_encryption: @@ -309,10 +397,16 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_instance_administrators: ManagedInstanceAdministratorsOperations operations :vartype managed_instance_administrators: azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations + :ivar managed_instance_advanced_threat_protection_settings: + ManagedInstanceAdvancedThreatProtectionSettingsOperations operations + :vartype managed_instance_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthenticationsOperations operations :vartype managed_instance_azure_ad_only_authentications: azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations + :ivar managed_instance_dtcs: ManagedInstanceDtcsOperations operations + :vartype managed_instance_dtcs: azure.mgmt.sql.operations.ManagedInstanceDtcsOperations :ivar managed_instance_encryption_protectors: ManagedInstanceEncryptionProtectorsOperations operations :vartype managed_instance_encryption_protectors: @@ -334,6 +428,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype managed_instance_private_link_resources: azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations :vartype managed_instance_tde_certificates: azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations @@ -341,26 +437,58 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedInstanceVulnerabilityAssessmentsOperations operations :vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations + :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations + :vartype managed_ledger_digest_uploads: + azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations + :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations + :vartype managed_server_dns_aliases: + azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations :ivar managed_server_security_alert_policies: ManagedServerSecurityAlertPoliciesOperations operations :vartype managed_server_security_alert_policies: azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations + :ivar network_security_perimeter_configurations: + NetworkSecurityPerimeterConfigurationsOperations operations + :vartype network_security_perimeter_configurations: + azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.sql.operations.Operations + :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations + :vartype outbound_firewall_rules: azure.mgmt.sql.operations.OutboundFirewallRulesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.sql.operations.PrivateLinkResourcesOperations + :ivar recoverable_databases: RecoverableDatabasesOperations operations + :vartype recoverable_databases: azure.mgmt.sql.operations.RecoverableDatabasesOperations :ivar recoverable_managed_databases: RecoverableManagedDatabasesOperations operations :vartype recoverable_managed_databases: azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations + :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations + :vartype restorable_dropped_databases: + azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations + :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations + operations + :vartype restorable_dropped_managed_databases: + azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations :ivar restore_points: RestorePointsOperations operations :vartype restore_points: azure.mgmt.sql.operations.RestorePointsOperations + :ivar sensitivity_labels: SensitivityLabelsOperations operations + :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations + :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations + :vartype recommended_sensitivity_labels: + azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations + :ivar server_advanced_threat_protection_settings: + ServerAdvancedThreatProtectionSettingsOperations operations + :vartype server_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations :ivar server_advisors: ServerAdvisorsOperations operations :vartype server_advisors: azure.mgmt.sql.operations.ServerAdvisorsOperations :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations @@ -372,6 +500,12 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype server_azure_ad_only_authentications: azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations + :ivar server_configuration_options: ServerConfigurationOptionsOperations operations + :vartype server_configuration_options: + azure.mgmt.sql.operations.ServerConfigurationOptionsOperations + :ivar server_connection_policies: ServerConnectionPoliciesOperations operations + :vartype server_connection_policies: + azure.mgmt.sql.operations.ServerConnectionPoliciesOperations :ivar server_dev_ops_audit_settings: ServerDevOpsAuditSettingsOperations operations :vartype server_dev_ops_audit_settings: azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations @@ -381,148 +515,22 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype server_keys: azure.mgmt.sql.operations.ServerKeysOperations :ivar server_operations: ServerOperationsOperations operations :vartype server_operations: azure.mgmt.sql.operations.ServerOperationsOperations + :ivar servers: ServersOperations operations + :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_security_alert_policies: ServerSecurityAlertPoliciesOperations operations :vartype server_security_alert_policies: azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations + :ivar server_trust_certificates: ServerTrustCertificatesOperations operations + :vartype server_trust_certificates: azure.mgmt.sql.operations.ServerTrustCertificatesOperations :ivar server_trust_groups: ServerTrustGroupsOperations operations :vartype server_trust_groups: azure.mgmt.sql.operations.ServerTrustGroupsOperations + :ivar server_usages: ServerUsagesOperations operations + :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations :ivar server_vulnerability_assessments: ServerVulnerabilityAssessmentsOperations operations :vartype server_vulnerability_assessments: azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations :ivar sql_agent: SqlAgentOperations operations :vartype sql_agent: azure.mgmt.sql.operations.SqlAgentOperations - :ivar subscription_usages: SubscriptionUsagesOperations operations - :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations - :ivar sync_agents: SyncAgentsOperations operations - :vartype sync_agents: azure.mgmt.sql.operations.SyncAgentsOperations - :ivar sync_groups: SyncGroupsOperations operations - :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations - :ivar sync_members: SyncMembersOperations operations - :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations - :ivar tde_certificates: TdeCertificatesOperations operations - :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations - :ivar time_zones: TimeZonesOperations operations - :vartype time_zones: azure.mgmt.sql.operations.TimeZonesOperations - :ivar virtual_network_rules: VirtualNetworkRulesOperations operations - :vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations - :ivar workload_classifiers: WorkloadClassifiersOperations operations - :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations - :ivar workload_groups: WorkloadGroupsOperations operations - :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations - :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations - operations - :vartype backup_short_term_retention_policies: - azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations - :ivar database_extensions: DatabaseExtensionsOperations operations - :vartype database_extensions: azure.mgmt.sql.operations.DatabaseExtensionsOperations - :ivar database_usages: DatabaseUsagesOperations operations - :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations - :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations - :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations - :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations - :vartype outbound_firewall_rules: azure.mgmt.sql.operations.OutboundFirewallRulesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.sql.operations.UsagesOperations - :ivar long_term_retention_managed_instance_backups: - LongTermRetentionManagedInstanceBackupsOperations operations - :vartype long_term_retention_managed_instance_backups: - azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations - :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations - operations - :vartype restorable_dropped_managed_databases: - azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations - :ivar server_connection_policies: ServerConnectionPoliciesOperations operations - :vartype server_connection_policies: - azure.mgmt.sql.operations.ServerConnectionPoliciesOperations - :ivar server_trust_certificates: ServerTrustCertificatesOperations operations - :vartype server_trust_certificates: azure.mgmt.sql.operations.ServerTrustCertificatesOperations - :ivar endpoint_certificates: EndpointCertificatesOperations operations - :vartype endpoint_certificates: azure.mgmt.sql.operations.EndpointCertificatesOperations - :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations - operations - :vartype managed_database_sensitivity_labels: - azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations - :ivar managed_database_recommended_sensitivity_labels: - ManagedDatabaseRecommendedSensitivityLabelsOperations operations - :vartype managed_database_recommended_sensitivity_labels: - azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations - :ivar sensitivity_labels: SensitivityLabelsOperations operations - :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations - :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations - :vartype recommended_sensitivity_labels: - azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations - :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations - :vartype server_blob_auditing_policies: - azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations - :ivar database_blob_auditing_policies: DatabaseBlobAuditingPoliciesOperations operations - :vartype database_blob_auditing_policies: - azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations - :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations - operations - :vartype extended_database_blob_auditing_policies: - azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations - :ivar extended_server_blob_auditing_policies: ExtendedServerBlobAuditingPoliciesOperations - operations - :vartype extended_server_blob_auditing_policies: - azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations - :ivar database_advanced_threat_protection_settings: - DatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype database_advanced_threat_protection_settings: - azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations - :ivar server_advanced_threat_protection_settings: - ServerAdvancedThreatProtectionSettingsOperations operations - :vartype server_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations - :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations - :vartype managed_server_dns_aliases: - azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations - :ivar managed_database_advanced_threat_protection_settings: - ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype managed_database_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations - :ivar managed_instance_advanced_threat_protection_settings: - ManagedInstanceAdvancedThreatProtectionSettingsOperations operations - :vartype managed_instance_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations - :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations - :vartype managed_database_move_operations: - azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations - :ivar managed_instance_dtcs: ManagedInstanceDtcsOperations operations - :vartype managed_instance_dtcs: azure.mgmt.sql.operations.ManagedInstanceDtcsOperations - :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations - :vartype synapse_link_workspaces: azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations - :ivar virtual_clusters: VirtualClustersOperations operations - :vartype virtual_clusters: azure.mgmt.sql.operations.VirtualClustersOperations - :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations - :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations - :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations - :vartype managed_database_restore_details: - azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations - :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations - :vartype database_encryption_protectors: - azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations - :ivar managed_databases: ManagedDatabasesOperations operations - :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations - :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations - :vartype managed_ledger_digest_uploads: - azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations - :ivar recoverable_databases: RecoverableDatabasesOperations operations - :vartype recoverable_databases: azure.mgmt.sql.operations.RecoverableDatabasesOperations - :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations - :vartype restorable_dropped_databases: - azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations - :ivar server_configuration_options: ServerConfigurationOptionsOperations operations - :vartype server_configuration_options: - azure.mgmt.sql.operations.ServerConfigurationOptionsOperations - :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations - operations - :vartype start_stop_managed_instance_schedules: - azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: - azure.mgmt.sql.operations.TransparentDataEncryptionsOperations - :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations - :vartype ipv6_firewall_rules: azure.mgmt.sql.operations.IPv6FirewallRulesOperations :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations operations :vartype sql_vulnerability_assessment_baseline: @@ -557,51 +565,37 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations :vartype sql_vulnerability_assessments: azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations - :ivar database_sql_vulnerability_assessment_rule_baselines: - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar database_sql_vulnerability_assessment_scan_result: - DatabaseSqlVulnerabilityAssessmentScanResultOperations operations - :vartype database_sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations - :ivar failover_groups: FailoverGroupsOperations operations - :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations - :ivar instance_pools: InstancePoolsOperations operations - :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations - :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations - :vartype distributed_availability_groups: - azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations - :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.sql.operations.ServersOperations - :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations - :vartype long_term_retention_backups: - azure.mgmt.sql.operations.LongTermRetentionBackupsOperations - :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations - :vartype long_term_retention_policies: - azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations - :ivar database_operations: DatabaseOperationsOperations operations - :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperationsOperations + :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations + operations + :vartype start_stop_managed_instance_schedules: + azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations + :ivar subscription_usages: SubscriptionUsagesOperations operations + :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations + :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations + :vartype synapse_link_workspaces: azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations + :ivar sync_agents: SyncAgentsOperations operations + :vartype sync_agents: azure.mgmt.sql.operations.SyncAgentsOperations + :ivar sync_groups: SyncGroupsOperations operations + :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations + :ivar sync_members: SyncMembersOperations operations + :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations + :ivar tde_certificates: TdeCertificatesOperations operations + :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations + :ivar time_zones: TimeZonesOperations operations + :vartype time_zones: azure.mgmt.sql.operations.TimeZonesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.sql.operations.TransparentDataEncryptionsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :ivar virtual_clusters: VirtualClustersOperations operations + :vartype virtual_clusters: azure.mgmt.sql.operations.VirtualClustersOperations + :ivar virtual_network_rules: VirtualNetworkRulesOperations operations + :vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations + :ivar workload_classifiers: WorkloadClassifiersOperations operations + :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations + :ivar workload_groups: WorkloadGroupsOperations operations + :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations :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. @@ -611,6 +605,9 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -661,30 +658,24 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.data_masking_policies = DataMaskingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.data_masking_rules = DataMaskingRulesOperations( + self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.geo_backup_policies = GeoBackupPoliciesOperations( + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_communication_links = ServerCommunicationLinksOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.service_objectives = ServiceObjectivesOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_activities = ElasticPoolActivitiesOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( + self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_advisors = DatabaseAdvisorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -694,36 +685,96 @@ def __init__( self.database_columns = DatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_extensions = DatabaseExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_operations = DatabaseOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_schemas = DatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_rule_baselines = ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_masking_policies = DataMaskingPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_masking_rules = DataMaskingRulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.elastic_pool_operations = ElasticPoolOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.encryption_protectors = EncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self.endpoint_certificates = EndpointCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.geo_backup_policies = GeoBackupPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_pool_operations = ElasticPoolOperationsOperations( + self.instance_pool_operations = InstancePoolOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.encryption_protectors = EncryptionProtectorsOperations( + self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_credentials = JobCredentialsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -742,7 +793,19 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.long_term_retention_policies = LongTermRetentionPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.maintenance_window_options = MaintenanceWindowOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -752,12 +815,26 @@ def __init__( self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.managed_database_columns = ManagedDatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_queries = ManagedDatabaseQueriesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_databases = ManagedDatabasesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_schemas = ManagedDatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -767,6 +844,12 @@ def __init__( self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_tables = ManagedDatabaseTablesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -787,9 +870,17 @@ def __init__( self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -808,195 +899,108 @@ def __init__( self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_automatic_tuning = ServerAutomaticTuningOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_dns_aliases = ServerDnsAliasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_operations = ServerOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_trust_groups = ServerTrustGroupsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) - self.subscription_usages = SubscriptionUsagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) - self.tde_certificates = TdeCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workload_classifiers = WorkloadClassifiersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( + self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_extensions = DatabaseExtensionsOperations( + self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_connection_policies = ServerConnectionPoliciesOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_certificates = ServerTrustCertificatesOperations( + self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.endpoint_certificates = EndpointCertificatesOperations( + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) self.sensitivity_labels = SensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.virtual_clusters = VirtualClustersOperations( + self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.instance_failover_groups = InstanceFailoverGroupsOperations( + self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.server_dns_aliases = ServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_operations = ServerOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.server_trust_certificates = ServerTrustCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.server_trust_groups = ServerTrustGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.ipv6_firewall_rules = IPv6FirewallRulesOperations( + self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -1024,49 +1028,36 @@ def __init__( self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.database_sql_vulnerability_assessment_rule_baselines = ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.subscription_usages = SubscriptionUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) + self.tde_certificates = TdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.virtual_clusters = VirtualClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.long_term_retention_policies = LongTermRetentionPoliciesOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_operations = DatabaseOperationsOperations( + self.workload_classifiers = WorkloadClassifiersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.workload_groups = WorkloadGroupsOperations(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/_utils/serialization.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py index 5f250836cf4b..6da830e0cf4a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py @@ -787,7 +787,7 @@ def serialize_data(self, data, data_type, **kwargs): # If dependencies is empty, try with current data class # It has to be a subclass of Enum anyway - enum_type = self.dependencies.get(data_type, data.__class__) + enum_type = self.dependencies.get(data_type, cast(type, data.__class__)) if issubclass(enum_type, Enum): return Serializer.serialize_enum(data, enum_obj=enum_type) @@ -821,13 +821,20 @@ def serialize_basic(cls, data, data_type, **kwargs): :param str data_type: Type of object in the iterable. :rtype: str, int, float, bool :return: serialized object + :raises TypeError: raise if data_type is not one of str, int, float, bool. """ custom_serializer = cls._get_custom_serializers(data_type, **kwargs) if custom_serializer: return custom_serializer(data) if data_type == "str": return cls.serialize_unicode(data) - return eval(data_type)(data) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(data) + if data_type == "float": + return float(data) + if data_type == "bool": + return bool(data) + raise TypeError("Unknown basic data type: {}".format(data_type)) @classmethod def serialize_unicode(cls, data): @@ -1757,7 +1764,7 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return :param str data_type: deserialization data type. :return: Deserialized basic type. :rtype: str, int, float or bool - :raises TypeError: if string format is not valid. + :raises TypeError: if string format is not valid or data_type is not one of str, int, float, bool. """ # If we're here, data is supposed to be a basic type. # If it's still an XML node, take the text @@ -1783,7 +1790,11 @@ def deserialize_basic(self, attr, data_type): # pylint: disable=too-many-return if data_type == "str": return self.deserialize_unicode(attr) - return eval(data_type)(attr) # nosec # pylint: disable=eval-used + if data_type == "int": + return int(attr) + if data_type == "float": + return float(attr) + raise TypeError("Unknown basic data type: {}".format(data_type)) @staticmethod def deserialize_unicode(data): 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 f4d8c1dbf0d5..47babc28d5ed 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.0b24" +VERSION = "3.1.0" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py index 88546af5b237..e0256b86d59b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py @@ -31,6 +31,9 @@ class SqlManagementClientConfiguration: # pylint: disable=too-many-instance-att :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str """ def __init__( @@ -40,6 +43,8 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + api_version: str = kwargs.pop("api_version", "2025-01-01") + if credential is None: raise ValueError("Parameter 'credential' must not be None.") if subscription_id is None: @@ -48,6 +53,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id self.cloud_setting = cloud_setting + self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) kwargs.setdefault("sdk_moniker", "mgmt-sql/{}".format(VERSION)) self.polling_interval = kwargs.get("polling_interval", 30) 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 b513a77a301c..d23f8d83b268 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 @@ -52,8 +52,6 @@ DatabasesOperations, DeletedServersOperations, DistributedAvailabilityGroupsOperations, - ElasticPoolActivitiesOperations, - ElasticPoolDatabaseActivitiesOperations, ElasticPoolOperationsOperations, ElasticPoolsOperations, EncryptionProtectorsOperations, @@ -65,6 +63,7 @@ GeoBackupPoliciesOperations, IPv6FirewallRulesOperations, InstanceFailoverGroupsOperations, + InstancePoolOperationsOperations, InstancePoolsOperations, JobAgentsOperations, JobCredentialsOperations, @@ -116,6 +115,7 @@ ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations, ManagedServerDnsAliasesOperations, ManagedServerSecurityAlertPoliciesOperations, + NetworkSecurityPerimeterConfigurationsOperations, Operations, OutboundFirewallRulesOperations, PrivateEndpointConnectionsOperations, @@ -134,7 +134,6 @@ ServerAzureADAdministratorsOperations, ServerAzureADOnlyAuthenticationsOperations, ServerBlobAuditingPoliciesOperations, - ServerCommunicationLinksOperations, ServerConfigurationOptionsOperations, ServerConnectionPoliciesOperations, ServerDevOpsAuditSettingsOperations, @@ -147,7 +146,6 @@ ServerUsagesOperations, ServerVulnerabilityAssessmentsOperations, ServersOperations, - ServiceObjectivesOperations, SqlAgentOperations, SqlVulnerabilityAssessmentBaselineOperations, SqlVulnerabilityAssessmentBaselinesOperations, @@ -179,33 +177,33 @@ from azure.core.credentials_async import AsyncTokenCredential -class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes +class SqlManagementClient: # pylint: disable=too-many-instance-attributes """The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete databases. - :ivar data_masking_policies: DataMaskingPoliciesOperations operations - :vartype data_masking_policies: azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations - :ivar data_masking_rules: DataMaskingRulesOperations operations - :vartype data_masking_rules: azure.mgmt.sql.aio.operations.DataMaskingRulesOperations - :ivar geo_backup_policies: GeoBackupPoliciesOperations operations - :vartype geo_backup_policies: azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations - :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.sql.aio.operations.DatabasesOperations - :ivar elastic_pools: ElasticPoolsOperations operations - :vartype elastic_pools: azure.mgmt.sql.aio.operations.ElasticPoolsOperations - :ivar server_communication_links: ServerCommunicationLinksOperations operations - :vartype server_communication_links: - azure.mgmt.sql.aio.operations.ServerCommunicationLinksOperations - :ivar service_objectives: ServiceObjectivesOperations operations - :vartype service_objectives: azure.mgmt.sql.aio.operations.ServiceObjectivesOperations - :ivar elastic_pool_activities: ElasticPoolActivitiesOperations operations - :vartype elastic_pool_activities: azure.mgmt.sql.aio.operations.ElasticPoolActivitiesOperations - :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations - :vartype elastic_pool_database_activities: - azure.mgmt.sql.aio.operations.ElasticPoolDatabaseActivitiesOperations - :ivar server_usages: ServerUsagesOperations operations - :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations + :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations + operations + :vartype backup_short_term_retention_policies: + azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations + :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations + :vartype server_blob_auditing_policies: + azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations + :ivar database_blob_auditing_policies: DatabaseBlobAuditingPoliciesOperations operations + :vartype database_blob_auditing_policies: + azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations + :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations + operations + :vartype extended_database_blob_auditing_policies: + azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations + :ivar extended_server_blob_auditing_policies: ExtendedServerBlobAuditingPoliciesOperations + operations + :vartype extended_server_blob_auditing_policies: + azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations + :ivar database_advanced_threat_protection_settings: + DatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype database_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations :ivar database_advisors: DatabaseAdvisorsOperations operations :vartype database_advisors: azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations @@ -213,16 +211,51 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations :ivar database_columns: DatabaseColumnsOperations operations :vartype database_columns: azure.mgmt.sql.aio.operations.DatabaseColumnsOperations + :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations + :vartype database_encryption_protectors: + azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations + :ivar database_extensions: DatabaseExtensionsOperations operations + :vartype database_extensions: azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations + :ivar database_operations: DatabaseOperationsOperations operations + :vartype database_operations: azure.mgmt.sql.aio.operations.DatabaseOperationsOperations :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations :vartype database_recommended_actions: azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations + :ivar databases: DatabasesOperations operations + :vartype databases: azure.mgmt.sql.aio.operations.DatabasesOperations :ivar database_schemas: DatabaseSchemasOperations operations :vartype database_schemas: azure.mgmt.sql.aio.operations.DatabaseSchemasOperations :ivar database_security_alert_policies: DatabaseSecurityAlertPoliciesOperations operations :vartype database_security_alert_policies: azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar database_sql_vulnerability_assessment_rule_baselines: + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scan_result: + DatabaseSqlVulnerabilityAssessmentScanResultOperations operations + :vartype database_sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations :ivar database_tables: DatabaseTablesOperations operations :vartype database_tables: azure.mgmt.sql.aio.operations.DatabaseTablesOperations + :ivar database_usages: DatabaseUsagesOperations operations + :vartype database_usages: azure.mgmt.sql.aio.operations.DatabaseUsagesOperations :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_vulnerability_assessment_rule_baselines: @@ -234,17 +267,42 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype database_vulnerability_assessment_scans: azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar data_masking_policies: DataMaskingPoliciesOperations operations + :vartype data_masking_policies: azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations + :ivar data_masking_rules: DataMaskingRulesOperations operations + :vartype data_masking_rules: azure.mgmt.sql.aio.operations.DataMaskingRulesOperations :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations :vartype data_warehouse_user_activities: azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations :ivar deleted_servers: DeletedServersOperations operations :vartype deleted_servers: azure.mgmt.sql.aio.operations.DeletedServersOperations + :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations + :vartype distributed_availability_groups: + azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations :vartype elastic_pool_operations: azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations + :ivar elastic_pools: ElasticPoolsOperations operations + :vartype elastic_pools: azure.mgmt.sql.aio.operations.ElasticPoolsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations :vartype encryption_protectors: azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations + :ivar endpoint_certificates: EndpointCertificatesOperations operations + :vartype endpoint_certificates: azure.mgmt.sql.aio.operations.EndpointCertificatesOperations + :ivar failover_groups: FailoverGroupsOperations operations + :vartype failover_groups: azure.mgmt.sql.aio.operations.FailoverGroupsOperations :ivar firewall_rules: FirewallRulesOperations operations :vartype firewall_rules: azure.mgmt.sql.aio.operations.FirewallRulesOperations + :ivar geo_backup_policies: GeoBackupPoliciesOperations operations + :vartype geo_backup_policies: azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations + :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations + :vartype instance_failover_groups: + azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations + :ivar instance_pool_operations: InstancePoolOperationsOperations operations + :vartype instance_pool_operations: + azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations + :ivar instance_pools: InstancePoolsOperations operations + :vartype instance_pools: azure.mgmt.sql.aio.operations.InstancePoolsOperations + :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations + :vartype ipv6_firewall_rules: azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations :ivar job_agents: JobAgentsOperations operations :vartype job_agents: azure.mgmt.sql.aio.operations.JobAgentsOperations :ivar job_credentials: JobCredentialsOperations operations @@ -265,8 +323,20 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype job_target_groups: azure.mgmt.sql.aio.operations.JobTargetGroupsOperations :ivar job_versions: JobVersionsOperations operations :vartype job_versions: azure.mgmt.sql.aio.operations.JobVersionsOperations + :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations + :vartype ledger_digest_uploads: azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations :ivar capabilities: CapabilitiesOperations operations :vartype capabilities: azure.mgmt.sql.aio.operations.CapabilitiesOperations + :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations + :vartype long_term_retention_backups: + azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations + :ivar long_term_retention_managed_instance_backups: + LongTermRetentionManagedInstanceBackupsOperations operations + :vartype long_term_retention_managed_instance_backups: + azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations + :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations + :vartype long_term_retention_policies: + azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations :vartype maintenance_window_options: azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations @@ -276,12 +346,24 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedBackupShortTermRetentionPoliciesOperations operations :vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations + :ivar managed_database_advanced_threat_protection_settings: + ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype managed_database_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations :vartype managed_database_columns: azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations + :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations + :vartype managed_database_move_operations: + azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations :vartype managed_database_queries: azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations + :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations + :vartype managed_database_restore_details: + azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations + :ivar managed_databases: ManagedDatabasesOperations operations + :vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations :vartype managed_database_schemas: azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations @@ -292,6 +374,14 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations :vartype managed_database_security_events: azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations + :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations + operations + :vartype managed_database_sensitivity_labels: + azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar managed_database_recommended_sensitivity_labels: + ManagedDatabaseRecommendedSensitivityLabelsOperations operations + :vartype managed_database_recommended_sensitivity_labels: + azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations :ivar managed_database_tables: ManagedDatabaseTablesOperations operations :vartype managed_database_tables: azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations :ivar managed_database_transparent_data_encryption: @@ -313,10 +403,16 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar managed_instance_administrators: ManagedInstanceAdministratorsOperations operations :vartype managed_instance_administrators: azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations + :ivar managed_instance_advanced_threat_protection_settings: + ManagedInstanceAdvancedThreatProtectionSettingsOperations operations + :vartype managed_instance_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthenticationsOperations operations :vartype managed_instance_azure_ad_only_authentications: azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations + :ivar managed_instance_dtcs: ManagedInstanceDtcsOperations operations + :vartype managed_instance_dtcs: azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations :ivar managed_instance_encryption_protectors: ManagedInstanceEncryptionProtectorsOperations operations :vartype managed_instance_encryption_protectors: @@ -338,6 +434,8 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype managed_instance_private_link_resources: azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations :vartype managed_instance_tde_certificates: azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations @@ -345,26 +443,58 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword ManagedInstanceVulnerabilityAssessmentsOperations operations :vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations + :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations + :vartype managed_ledger_digest_uploads: + azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations + :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations + :vartype managed_server_dns_aliases: + azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations :ivar managed_server_security_alert_policies: ManagedServerSecurityAlertPoliciesOperations operations :vartype managed_server_security_alert_policies: azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations + :ivar network_security_perimeter_configurations: + NetworkSecurityPerimeterConfigurationsOperations operations + :vartype network_security_perimeter_configurations: + azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.sql.aio.operations.Operations + :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations + :vartype outbound_firewall_rules: azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations :vartype private_endpoint_connections: azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResourcesOperations operations :vartype private_link_resources: azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations + :ivar recoverable_databases: RecoverableDatabasesOperations operations + :vartype recoverable_databases: azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations :ivar recoverable_managed_databases: RecoverableManagedDatabasesOperations operations :vartype recoverable_managed_databases: azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations + :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations + :vartype restorable_dropped_databases: + azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations + :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations + operations + :vartype restorable_dropped_managed_databases: + azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations :ivar restore_points: RestorePointsOperations operations :vartype restore_points: azure.mgmt.sql.aio.operations.RestorePointsOperations + :ivar sensitivity_labels: SensitivityLabelsOperations operations + :vartype sensitivity_labels: azure.mgmt.sql.aio.operations.SensitivityLabelsOperations + :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations + :vartype recommended_sensitivity_labels: + azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations + :ivar server_advanced_threat_protection_settings: + ServerAdvancedThreatProtectionSettingsOperations operations + :vartype server_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations :ivar server_advisors: ServerAdvisorsOperations operations :vartype server_advisors: azure.mgmt.sql.aio.operations.ServerAdvisorsOperations :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations @@ -376,6 +506,12 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword operations :vartype server_azure_ad_only_authentications: azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations + :ivar server_configuration_options: ServerConfigurationOptionsOperations operations + :vartype server_configuration_options: + azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations + :ivar server_connection_policies: ServerConnectionPoliciesOperations operations + :vartype server_connection_policies: + azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations :ivar server_dev_ops_audit_settings: ServerDevOpsAuditSettingsOperations operations :vartype server_dev_ops_audit_settings: azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations @@ -385,150 +521,23 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :vartype server_keys: azure.mgmt.sql.aio.operations.ServerKeysOperations :ivar server_operations: ServerOperationsOperations operations :vartype server_operations: azure.mgmt.sql.aio.operations.ServerOperationsOperations + :ivar servers: ServersOperations operations + :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations :ivar server_security_alert_policies: ServerSecurityAlertPoliciesOperations operations :vartype server_security_alert_policies: azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations + :ivar server_trust_certificates: ServerTrustCertificatesOperations operations + :vartype server_trust_certificates: + azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations :ivar server_trust_groups: ServerTrustGroupsOperations operations :vartype server_trust_groups: azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations + :ivar server_usages: ServerUsagesOperations operations + :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations :ivar server_vulnerability_assessments: ServerVulnerabilityAssessmentsOperations operations :vartype server_vulnerability_assessments: azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations :ivar sql_agent: SqlAgentOperations operations :vartype sql_agent: azure.mgmt.sql.aio.operations.SqlAgentOperations - :ivar subscription_usages: SubscriptionUsagesOperations operations - :vartype subscription_usages: azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations - :ivar sync_agents: SyncAgentsOperations operations - :vartype sync_agents: azure.mgmt.sql.aio.operations.SyncAgentsOperations - :ivar sync_groups: SyncGroupsOperations operations - :vartype sync_groups: azure.mgmt.sql.aio.operations.SyncGroupsOperations - :ivar sync_members: SyncMembersOperations operations - :vartype sync_members: azure.mgmt.sql.aio.operations.SyncMembersOperations - :ivar tde_certificates: TdeCertificatesOperations operations - :vartype tde_certificates: azure.mgmt.sql.aio.operations.TdeCertificatesOperations - :ivar time_zones: TimeZonesOperations operations - :vartype time_zones: azure.mgmt.sql.aio.operations.TimeZonesOperations - :ivar virtual_network_rules: VirtualNetworkRulesOperations operations - :vartype virtual_network_rules: azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations - :ivar workload_classifiers: WorkloadClassifiersOperations operations - :vartype workload_classifiers: azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations - :ivar workload_groups: WorkloadGroupsOperations operations - :vartype workload_groups: azure.mgmt.sql.aio.operations.WorkloadGroupsOperations - :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations - operations - :vartype backup_short_term_retention_policies: - azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations - :ivar database_extensions: DatabaseExtensionsOperations operations - :vartype database_extensions: azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations - :ivar database_usages: DatabaseUsagesOperations operations - :vartype database_usages: azure.mgmt.sql.aio.operations.DatabaseUsagesOperations - :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations - :vartype ledger_digest_uploads: azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations - :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations - :vartype outbound_firewall_rules: azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.sql.aio.operations.UsagesOperations - :ivar long_term_retention_managed_instance_backups: - LongTermRetentionManagedInstanceBackupsOperations operations - :vartype long_term_retention_managed_instance_backups: - azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations - :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations - operations - :vartype restorable_dropped_managed_databases: - azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations - :ivar server_connection_policies: ServerConnectionPoliciesOperations operations - :vartype server_connection_policies: - azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations - :ivar server_trust_certificates: ServerTrustCertificatesOperations operations - :vartype server_trust_certificates: - azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations - :ivar endpoint_certificates: EndpointCertificatesOperations operations - :vartype endpoint_certificates: azure.mgmt.sql.aio.operations.EndpointCertificatesOperations - :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations - operations - :vartype managed_database_sensitivity_labels: - azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations - :ivar managed_database_recommended_sensitivity_labels: - ManagedDatabaseRecommendedSensitivityLabelsOperations operations - :vartype managed_database_recommended_sensitivity_labels: - azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations - :ivar sensitivity_labels: SensitivityLabelsOperations operations - :vartype sensitivity_labels: azure.mgmt.sql.aio.operations.SensitivityLabelsOperations - :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations - :vartype recommended_sensitivity_labels: - azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations - :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations - :vartype server_blob_auditing_policies: - azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations - :ivar database_blob_auditing_policies: DatabaseBlobAuditingPoliciesOperations operations - :vartype database_blob_auditing_policies: - azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations - :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations - operations - :vartype extended_database_blob_auditing_policies: - azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations - :ivar extended_server_blob_auditing_policies: ExtendedServerBlobAuditingPoliciesOperations - operations - :vartype extended_server_blob_auditing_policies: - azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations - :ivar database_advanced_threat_protection_settings: - DatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype database_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations - :ivar server_advanced_threat_protection_settings: - ServerAdvancedThreatProtectionSettingsOperations operations - :vartype server_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations - :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations - :vartype managed_server_dns_aliases: - azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations - :ivar managed_database_advanced_threat_protection_settings: - ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype managed_database_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations - :ivar managed_instance_advanced_threat_protection_settings: - ManagedInstanceAdvancedThreatProtectionSettingsOperations operations - :vartype managed_instance_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations - :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations - :vartype managed_database_move_operations: - azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations - :ivar managed_instance_dtcs: ManagedInstanceDtcsOperations operations - :vartype managed_instance_dtcs: azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations - :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations - :vartype synapse_link_workspaces: azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations - :ivar virtual_clusters: VirtualClustersOperations operations - :vartype virtual_clusters: azure.mgmt.sql.aio.operations.VirtualClustersOperations - :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations - :vartype instance_failover_groups: - azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations - :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations - :vartype managed_database_restore_details: - azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations - :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations - :vartype database_encryption_protectors: - azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations - :ivar managed_databases: ManagedDatabasesOperations operations - :vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations - :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations - :vartype managed_ledger_digest_uploads: - azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations - :ivar recoverable_databases: RecoverableDatabasesOperations operations - :vartype recoverable_databases: azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations - :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations - :vartype restorable_dropped_databases: - azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations - :ivar server_configuration_options: ServerConfigurationOptionsOperations operations - :vartype server_configuration_options: - azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations - :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations - operations - :vartype start_stop_managed_instance_schedules: - azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: - azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations - :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations - :vartype ipv6_firewall_rules: azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations operations :vartype sql_vulnerability_assessment_baseline: @@ -563,51 +572,37 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations :vartype sql_vulnerability_assessments: azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations - :ivar database_sql_vulnerability_assessment_rule_baselines: - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar database_sql_vulnerability_assessment_scan_result: - DatabaseSqlVulnerabilityAssessmentScanResultOperations operations - :vartype database_sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations - :ivar failover_groups: FailoverGroupsOperations operations - :vartype failover_groups: azure.mgmt.sql.aio.operations.FailoverGroupsOperations - :ivar instance_pools: InstancePoolsOperations operations - :vartype instance_pools: azure.mgmt.sql.aio.operations.InstancePoolsOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations - :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations - :vartype distributed_availability_groups: - azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations - :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations - :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations - :vartype long_term_retention_backups: - azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations - :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations - :vartype long_term_retention_policies: - azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations - :ivar database_operations: DatabaseOperationsOperations operations - :vartype database_operations: azure.mgmt.sql.aio.operations.DatabaseOperationsOperations + :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations + operations + :vartype start_stop_managed_instance_schedules: + azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations + :ivar subscription_usages: SubscriptionUsagesOperations operations + :vartype subscription_usages: azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations + :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations + :vartype synapse_link_workspaces: azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations + :ivar sync_agents: SyncAgentsOperations operations + :vartype sync_agents: azure.mgmt.sql.aio.operations.SyncAgentsOperations + :ivar sync_groups: SyncGroupsOperations operations + :vartype sync_groups: azure.mgmt.sql.aio.operations.SyncGroupsOperations + :ivar sync_members: SyncMembersOperations operations + :vartype sync_members: azure.mgmt.sql.aio.operations.SyncMembersOperations + :ivar tde_certificates: TdeCertificatesOperations operations + :vartype tde_certificates: azure.mgmt.sql.aio.operations.TdeCertificatesOperations + :ivar time_zones: TimeZonesOperations operations + :vartype time_zones: azure.mgmt.sql.aio.operations.TimeZonesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.sql.aio.operations.UsagesOperations + :ivar virtual_clusters: VirtualClustersOperations operations + :vartype virtual_clusters: azure.mgmt.sql.aio.operations.VirtualClustersOperations + :ivar virtual_network_rules: VirtualNetworkRulesOperations operations + :vartype virtual_network_rules: azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations + :ivar workload_classifiers: WorkloadClassifiersOperations operations + :vartype workload_classifiers: azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations + :ivar workload_groups: WorkloadGroupsOperations operations + :vartype workload_groups: azure.mgmt.sql.aio.operations.WorkloadGroupsOperations :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. @@ -617,6 +612,9 @@ class SqlManagementClient: # pylint: disable=client-accepts-api-version-keyword :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds + :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this + default value may result in unsupported behavior. + :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. """ @@ -669,30 +667,24 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) self._serialize.client_side_validation = False - self.data_masking_policies = DataMaskingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.data_masking_rules = DataMaskingRulesOperations( + self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.geo_backup_policies = GeoBackupPoliciesOperations( + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_communication_links = ServerCommunicationLinksOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.service_objectives = ServiceObjectivesOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_activities = ElasticPoolActivitiesOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( + self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_advisors = DatabaseAdvisorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -702,36 +694,96 @@ def __init__( self.database_columns = DatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_extensions = DatabaseExtensionsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_operations = DatabaseOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_schemas = DatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_rule_baselines = ( + DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_masking_policies = DataMaskingPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_masking_rules = DataMaskingRulesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.elastic_pool_operations = ElasticPoolOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.encryption_protectors = EncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self.endpoint_certificates = EndpointCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.geo_backup_policies = GeoBackupPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.elastic_pool_operations = ElasticPoolOperationsOperations( + self.instance_pool_operations = InstancePoolOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.encryption_protectors = EncryptionProtectorsOperations( + self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_credentials = JobCredentialsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -750,7 +802,19 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) + self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.long_term_retention_policies = LongTermRetentionPoliciesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.maintenance_window_options = MaintenanceWindowOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -760,12 +824,26 @@ def __init__( self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.managed_database_columns = ManagedDatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_queries = ManagedDatabaseQueriesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_databases = ManagedDatabasesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_schemas = ManagedDatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -775,6 +853,12 @@ def __init__( self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_database_tables = ManagedDatabaseTablesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -795,9 +879,17 @@ def __init__( self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -816,195 +908,108 @@ def __init__( self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.private_link_resources = PrivateLinkResourcesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_automatic_tuning = ServerAutomaticTuningOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_dns_aliases = ServerDnsAliasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_operations = ServerOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_trust_groups = ServerTrustGroupsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) - self.subscription_usages = SubscriptionUsagesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) - self.tde_certificates = TdeCertificatesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workload_classifiers = WorkloadClassifiersOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( + self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_extensions = DatabaseExtensionsOperations( + self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_connection_policies = ServerConnectionPoliciesOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_certificates = ServerTrustCertificatesOperations( + self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.endpoint_certificates = EndpointCertificatesOperations( + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) self.sensitivity_labels = SensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.virtual_clusters = VirtualClustersOperations( + self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.instance_failover_groups = InstanceFailoverGroupsOperations( + self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.server_dns_aliases = ServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_operations = ServerOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.server_trust_certificates = ServerTrustCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.server_trust_groups = ServerTrustGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.ipv6_firewall_rules = IPv6FirewallRulesOperations( + self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) + self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -1032,49 +1037,36 @@ def __init__( self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.database_sql_vulnerability_assessment_rule_baselines = ( - DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.subscription_usages = SubscriptionUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.instance_pools = InstancePoolsOperations(self._client, self._config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) + self.tde_certificates = TdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.virtual_clusters = VirtualClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.long_term_retention_policies = LongTermRetentionPoliciesOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_operations = DatabaseOperationsOperations( + self.workload_classifiers = WorkloadClassifiersOperations( self._client, self._config, self._serialize, self._deserialize ) + self.workload_groups = WorkloadGroupsOperations(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 88a49faa4a42..8add9d7322c9 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 @@ -13,31 +13,49 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore -from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore -from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore -from ._databases_operations import DatabasesOperations # type: ignore -from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore -from ._server_communication_links_operations import ServerCommunicationLinksOperations # type: ignore -from ._service_objectives_operations import ServiceObjectivesOperations # type: ignore -from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations # type: ignore -from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations # type: ignore -from ._server_usages_operations import ServerUsagesOperations # type: ignore +from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore +from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore +from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore +from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore +from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore +from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore from ._database_advisors_operations import DatabaseAdvisorsOperations # type: ignore from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations # type: ignore from ._database_columns_operations import DatabaseColumnsOperations # type: ignore +from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore +from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore +from ._database_operations_operations import DatabaseOperationsOperations # type: ignore from ._database_recommended_actions_operations import DatabaseRecommendedActionsOperations # type: ignore +from ._databases_operations import DatabasesOperations # type: ignore from ._database_schemas_operations import DatabaseSchemasOperations # type: ignore from ._database_security_alert_policies_operations import DatabaseSecurityAlertPoliciesOperations # type: ignore +from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore +from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore from ._database_tables_operations import DatabaseTablesOperations # type: ignore +from ._database_usages_operations import DatabaseUsagesOperations # type: ignore from ._database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore from ._database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore +from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore from ._data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations # type: ignore from ._deleted_servers_operations import DeletedServersOperations # type: ignore +from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations # type: ignore +from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore from ._encryption_protectors_operations import EncryptionProtectorsOperations # type: ignore +from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore +from ._failover_groups_operations import FailoverGroupsOperations # type: ignore from ._firewall_rules_operations import FirewallRulesOperations # type: ignore +from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore +from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore +from ._instance_pool_operations_operations import InstancePoolOperationsOperations # type: ignore +from ._instance_pools_operations import InstancePoolsOperations # type: ignore +from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore from ._job_agents_operations import JobAgentsOperations # type: ignore from ._job_credentials_operations import JobCredentialsOperations # type: ignore from ._job_executions_operations import JobExecutionsOperations # type: ignore @@ -48,97 +66,78 @@ from ._job_target_executions_operations import JobTargetExecutionsOperations # type: ignore from ._job_target_groups_operations import JobTargetGroupsOperations # type: ignore from ._job_versions_operations import JobVersionsOperations # type: ignore +from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore from ._capabilities_operations import CapabilitiesOperations # type: ignore +from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore +from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore +from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations # type: ignore from ._maintenance_windows_operations import MaintenanceWindowsOperations # type: ignore from ._managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore +from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore from ._managed_database_columns_operations import ManagedDatabaseColumnsOperations # type: ignore +from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore from ._managed_database_queries_operations import ManagedDatabaseQueriesOperations # type: ignore +from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore +from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore from ._managed_database_schemas_operations import ManagedDatabaseSchemasOperations # type: ignore from ._managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore from ._managed_database_security_events_operations import ManagedDatabaseSecurityEventsOperations # type: ignore +from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore +from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore from ._managed_database_tables_operations import ManagedDatabaseTablesOperations # type: ignore from ._managed_database_transparent_data_encryption_operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore from ._managed_database_vulnerability_assessment_rule_baselines_operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations # type: ignore +from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore +from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore from ._managed_instance_keys_operations import ManagedInstanceKeysOperations # type: ignore from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations # type: ignore from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore +from ._managed_instances_operations import ManagedInstancesOperations # type: ignore from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations # type: ignore from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore +from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore +from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore +from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._operations import Operations # type: ignore +from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore +from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations # type: ignore +from ._replication_links_operations import ReplicationLinksOperations # type: ignore +from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore +from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore from ._restore_points_operations import RestorePointsOperations # type: ignore +from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore +from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore +from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore from ._server_advisors_operations import ServerAdvisorsOperations # type: ignore from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations # type: ignore from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations # type: ignore from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore +from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore +from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore from ._server_dev_ops_audit_settings_operations import ServerDevOpsAuditSettingsOperations # type: ignore from ._server_dns_aliases_operations import ServerDnsAliasesOperations # type: ignore from ._server_keys_operations import ServerKeysOperations # type: ignore from ._server_operations_operations import ServerOperationsOperations # type: ignore +from ._servers_operations import ServersOperations # type: ignore from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations # type: ignore +from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore from ._server_trust_groups_operations import ServerTrustGroupsOperations # type: ignore +from ._server_usages_operations import ServerUsagesOperations # type: ignore from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations # type: ignore from ._sql_agent_operations import SqlAgentOperations # type: ignore -from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore -from ._sync_agents_operations import SyncAgentsOperations # type: ignore -from ._sync_groups_operations import SyncGroupsOperations # type: ignore -from ._sync_members_operations import SyncMembersOperations # type: ignore -from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore -from ._time_zones_operations import TimeZonesOperations # type: ignore -from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore -from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore -from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore -from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore -from ._database_usages_operations import DatabaseUsagesOperations # type: ignore -from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore -from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore -from ._usages_operations import UsagesOperations # type: ignore -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore -from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore -from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore -from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore -from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore -from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore -from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore -from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore -from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore -from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore -from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore -from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore -from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore -from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore -from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore -from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore -from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore -from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore -from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore -from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore -from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore -from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore @@ -148,52 +147,69 @@ from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations # type: ignore from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations # type: ignore -from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore -from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._failover_groups_operations import FailoverGroupsOperations # type: ignore -from ._instance_pools_operations import InstancePoolsOperations # type: ignore -from ._managed_instances_operations import ManagedInstancesOperations # type: ignore -from ._replication_links_operations import ReplicationLinksOperations # type: ignore -from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore -from ._servers_operations import ServersOperations # type: ignore -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore -from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore -from ._database_operations_operations import DatabaseOperationsOperations # type: ignore +from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore +from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore +from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore +from ._sync_agents_operations import SyncAgentsOperations # type: ignore +from ._sync_groups_operations import SyncGroupsOperations # type: ignore +from ._sync_members_operations import SyncMembersOperations # type: ignore +from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore +from ._time_zones_operations import TimeZonesOperations # type: ignore +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore +from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore +from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore +from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "DataMaskingPoliciesOperations", - "DataMaskingRulesOperations", - "GeoBackupPoliciesOperations", - "DatabasesOperations", - "ElasticPoolsOperations", - "ServerCommunicationLinksOperations", - "ServiceObjectivesOperations", - "ElasticPoolActivitiesOperations", - "ElasticPoolDatabaseActivitiesOperations", - "ServerUsagesOperations", + "BackupShortTermRetentionPoliciesOperations", + "ServerBlobAuditingPoliciesOperations", + "DatabaseBlobAuditingPoliciesOperations", + "ExtendedDatabaseBlobAuditingPoliciesOperations", + "ExtendedServerBlobAuditingPoliciesOperations", + "DatabaseAdvancedThreatProtectionSettingsOperations", "DatabaseAdvisorsOperations", "DatabaseAutomaticTuningOperations", "DatabaseColumnsOperations", + "DatabaseEncryptionProtectorsOperations", + "DatabaseExtensionsOperations", + "DatabaseOperationsOperations", "DatabaseRecommendedActionsOperations", + "DatabasesOperations", "DatabaseSchemasOperations", "DatabaseSecurityAlertPoliciesOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScanResultOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", "DatabaseTablesOperations", + "DatabaseUsagesOperations", "DatabaseVulnerabilityAssessmentRuleBaselinesOperations", "DatabaseVulnerabilityAssessmentsOperations", "DatabaseVulnerabilityAssessmentScansOperations", + "DataMaskingPoliciesOperations", + "DataMaskingRulesOperations", "DataWarehouseUserActivitiesOperations", "DeletedServersOperations", + "DistributedAvailabilityGroupsOperations", "ElasticPoolOperationsOperations", + "ElasticPoolsOperations", "EncryptionProtectorsOperations", + "EndpointCertificatesOperations", + "FailoverGroupsOperations", "FirewallRulesOperations", + "GeoBackupPoliciesOperations", + "InstanceFailoverGroupsOperations", + "InstancePoolOperationsOperations", + "InstancePoolsOperations", + "IPv6FirewallRulesOperations", "JobAgentsOperations", "JobCredentialsOperations", "JobExecutionsOperations", @@ -204,97 +220,78 @@ "JobTargetExecutionsOperations", "JobTargetGroupsOperations", "JobVersionsOperations", + "LedgerDigestUploadsOperations", "CapabilitiesOperations", + "LongTermRetentionBackupsOperations", + "LongTermRetentionManagedInstanceBackupsOperations", + "LongTermRetentionPoliciesOperations", "MaintenanceWindowOptionsOperations", "MaintenanceWindowsOperations", "ManagedBackupShortTermRetentionPoliciesOperations", + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedDatabaseColumnsOperations", + "ManagedDatabaseMoveOperationsOperations", "ManagedDatabaseQueriesOperations", + "ManagedDatabaseRestoreDetailsOperations", + "ManagedDatabasesOperations", "ManagedDatabaseSchemasOperations", "ManagedDatabaseSecurityAlertPoliciesOperations", "ManagedDatabaseSecurityEventsOperations", + "ManagedDatabaseSensitivityLabelsOperations", + "ManagedDatabaseRecommendedSensitivityLabelsOperations", "ManagedDatabaseTablesOperations", "ManagedDatabaseTransparentDataEncryptionOperations", "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", "ManagedDatabaseVulnerabilityAssessmentsOperations", "ManagedDatabaseVulnerabilityAssessmentScansOperations", "ManagedInstanceAdministratorsOperations", + "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAzureADOnlyAuthenticationsOperations", + "ManagedInstanceDtcsOperations", "ManagedInstanceEncryptionProtectorsOperations", "ManagedInstanceKeysOperations", "ManagedInstanceLongTermRetentionPoliciesOperations", "ManagedInstanceOperationsOperations", "ManagedInstancePrivateEndpointConnectionsOperations", "ManagedInstancePrivateLinkResourcesOperations", + "ManagedInstancesOperations", "ManagedInstanceTdeCertificatesOperations", "ManagedInstanceVulnerabilityAssessmentsOperations", + "ManagedLedgerDigestUploadsOperations", "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", + "ManagedServerDnsAliasesOperations", "ManagedServerSecurityAlertPoliciesOperations", + "NetworkSecurityPerimeterConfigurationsOperations", "Operations", + "OutboundFirewallRulesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", + "RecoverableDatabasesOperations", "RecoverableManagedDatabasesOperations", + "ReplicationLinksOperations", + "RestorableDroppedDatabasesOperations", + "RestorableDroppedManagedDatabasesOperations", "RestorePointsOperations", + "SensitivityLabelsOperations", + "RecommendedSensitivityLabelsOperations", + "ServerAdvancedThreatProtectionSettingsOperations", "ServerAdvisorsOperations", "ServerAutomaticTuningOperations", "ServerAzureADAdministratorsOperations", "ServerAzureADOnlyAuthenticationsOperations", + "ServerConfigurationOptionsOperations", + "ServerConnectionPoliciesOperations", "ServerDevOpsAuditSettingsOperations", "ServerDnsAliasesOperations", "ServerKeysOperations", "ServerOperationsOperations", + "ServersOperations", "ServerSecurityAlertPoliciesOperations", + "ServerTrustCertificatesOperations", "ServerTrustGroupsOperations", + "ServerUsagesOperations", "ServerVulnerabilityAssessmentsOperations", "SqlAgentOperations", - "SubscriptionUsagesOperations", - "SyncAgentsOperations", - "SyncGroupsOperations", - "SyncMembersOperations", - "TdeCertificatesOperations", - "TimeZonesOperations", - "VirtualNetworkRulesOperations", - "WorkloadClassifiersOperations", - "WorkloadGroupsOperations", - "BackupShortTermRetentionPoliciesOperations", - "DatabaseExtensionsOperations", - "DatabaseUsagesOperations", - "LedgerDigestUploadsOperations", - "OutboundFirewallRulesOperations", - "UsagesOperations", - "LongTermRetentionManagedInstanceBackupsOperations", - "RestorableDroppedManagedDatabasesOperations", - "ServerConnectionPoliciesOperations", - "ServerTrustCertificatesOperations", - "EndpointCertificatesOperations", - "ManagedDatabaseSensitivityLabelsOperations", - "ManagedDatabaseRecommendedSensitivityLabelsOperations", - "SensitivityLabelsOperations", - "RecommendedSensitivityLabelsOperations", - "ServerBlobAuditingPoliciesOperations", - "DatabaseBlobAuditingPoliciesOperations", - "ExtendedDatabaseBlobAuditingPoliciesOperations", - "ExtendedServerBlobAuditingPoliciesOperations", - "DatabaseAdvancedThreatProtectionSettingsOperations", - "ServerAdvancedThreatProtectionSettingsOperations", - "ManagedServerDnsAliasesOperations", - "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", - "ManagedInstanceAdvancedThreatProtectionSettingsOperations", - "ManagedDatabaseMoveOperationsOperations", - "ManagedInstanceDtcsOperations", - "SynapseLinkWorkspacesOperations", - "VirtualClustersOperations", - "InstanceFailoverGroupsOperations", - "ManagedDatabaseRestoreDetailsOperations", - "DatabaseEncryptionProtectorsOperations", - "ManagedDatabasesOperations", - "ManagedLedgerDigestUploadsOperations", - "RecoverableDatabasesOperations", - "RestorableDroppedDatabasesOperations", - "ServerConfigurationOptionsOperations", - "StartStopManagedInstanceSchedulesOperations", - "TransparentDataEncryptionsOperations", - "IPv6FirewallRulesOperations", "SqlVulnerabilityAssessmentBaselineOperations", "SqlVulnerabilityAssessmentBaselinesOperations", "SqlVulnerabilityAssessmentExecuteScanOperations", @@ -304,21 +301,20 @@ "SqlVulnerabilityAssessmentScansOperations", "SqlVulnerabilityAssessmentsSettingsOperations", "SqlVulnerabilityAssessmentsOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", - "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", - "FailoverGroupsOperations", - "InstancePoolsOperations", - "ManagedInstancesOperations", - "ReplicationLinksOperations", - "DistributedAvailabilityGroupsOperations", - "ServersOperations", - "LongTermRetentionBackupsOperations", - "LongTermRetentionPoliciesOperations", - "DatabaseOperationsOperations", + "StartStopManagedInstanceSchedulesOperations", + "SubscriptionUsagesOperations", + "SynapseLinkWorkspacesOperations", + "SyncAgentsOperations", + "SyncGroupsOperations", + "SyncMembersOperations", + "TdeCertificatesOperations", + "TimeZonesOperations", + "TransparentDataEncryptionsOperations", + "UsagesOperations", + "VirtualClustersOperations", + "VirtualNetworkRulesOperations", + "WorkloadClassifiersOperations", + "WorkloadGroupsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 7da3e128fb5c..ae5df95ea141 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.BackupShortTermRetentionPolicy"]: + """Gets a database's short term retention policy. + + :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 + :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -99,7 +192,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -123,7 +216,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -152,7 +249,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -193,12 +290,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -305,7 +410,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -371,7 +476,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -412,12 +517,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -524,7 +637,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -569,80 +682,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.BackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.BackupShortTermRetentionPolicy"]: - """Gets a database's short term retention policy. - - :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 - :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", "2021-02-01-preview")) - cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 d94594af61a8..f9bec1fb429a 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 @@ -62,8 +62,8 @@ async def list_by_location( :type location_name: str :param include: If specified, restricts the response to only include the selected item. Known values are: "supportedEditions", "supportedElasticPoolEditions", - "supportedManagedInstanceVersions", "supportedInstancePoolEditions", and - "supportedManagedInstanceEditions". Default value is None. + "supportedManagedInstanceVersions", "supportedInstancePoolEditions", + "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. :type include: str or ~azure.mgmt.sql.models.CapabilityGroup :return: LocationCapabilities or the result of cls(response) :rtype: ~azure.mgmt.sql.models.LocationCapabilities @@ -80,7 +80,7 @@ async def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) _request = build_list_by_location_request( @@ -102,7 +102,11 @@ async def list_by_location( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LocationCapabilities", pipeline_response.http_response) 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 2cff1329da80..7585863d06c6 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,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload from azure.core import AsyncPipelineClient from azure.core.exceptions import ( @@ -53,12 +53,86 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Gets the database data masking policy. + + :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 data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: DataMaskingPolicy or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload async def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: _models.DataMaskingPolicy, *, content_type: str = "application/json", @@ -73,6 +147,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Required. :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -89,6 +166,7 @@ async def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: IO[bytes], *, content_type: str = "application/json", @@ -103,6 +181,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -119,6 +200,7 @@ async def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: Union[_models.DataMaskingPolicy, IO[bytes]], **kwargs: Any ) -> _models.DataMaskingPolicy: @@ -131,6 +213,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Is either a DataMaskingPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or IO[bytes] @@ -149,8 +234,7 @@ async def 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) @@ -166,9 +250,9 @@ async def create_or_update( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + data_masking_policy_name=data_masking_policy_name, subscription_id=self._config.subscription_id, api_version=api_version, - data_masking_policy_name=data_masking_policy_name, content_type=content_type, json=_json, content=_content, @@ -184,71 +268,13 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Gets a database data masking policy. - - :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 - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - data_masking_policy_name=data_masking_policy_name, - headers=_headers, - params=_params, - ) - _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]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) 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 f4ca43fa3c06..aadbddc44faf 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 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -55,12 +56,112 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> AsyncItemPaged["_models.DataMaskingRule"]: + """Gets a list of database data masking rules. + + :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 data_masking_policy_name: The name of the database for which the data masking rule + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: An iterator like instance of either DataMaskingRule or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataMaskingRule] + :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", self._config.api_version)) + cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @overload async def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: _models.DataMaskingRule, *, @@ -76,6 +177,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. @@ -95,6 +199,7 @@ async def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: IO[bytes], *, @@ -110,6 +215,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. @@ -129,6 +237,7 @@ async def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: Union[_models.DataMaskingRule, IO[bytes]], **kwargs: Any @@ -142,6 +251,9 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. Is @@ -162,8 +274,7 @@ async def 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) @@ -179,10 +290,10 @@ async def create_or_update( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + data_masking_policy_name=data_masking_policy_name, data_masking_rule_name=data_masking_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, - data_masking_policy_name=data_masking_policy_name, content_type=content_type, json=_json, content=_content, @@ -200,7 +311,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DataMaskingRule", pipeline_response.http_response) @@ -208,80 +323,3 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DataMaskingRule"]: - """Gets a list of database data masking rules. - - :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 - :return: An iterator like instance of either DataMaskingRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataMaskingRule] - :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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - data_masking_policy_name=data_masking_policy_name, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 d90624e4ad46..6e5e7a0dfad2 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,76 +55,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - **kwargs: Any - ) -> _models.DataWarehouseUserActivities: - """Gets the user activities of a data warehouse which includes running and suspended queries. - - :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" - Required. - :type data_warehouse_user_activity_name: str or - ~azure.mgmt.sql.models.DataWarehouseUserActivityName - :return: DataWarehouseUserActivities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_warehouse_user_activity_name=data_warehouse_user_activity_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_database( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -146,7 +77,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -172,7 +103,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -195,8 +137,86 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + **kwargs: Any + ) -> _models.DataWarehouseUserActivities: + """Gets the user activities of a data warehouse which includes running and suspended queries. + + :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" + Required. + :type data_warehouse_user_activity_name: str or + ~azure.mgmt.sql.models.DataWarehouseUserActivityName + :return: DataWarehouseUserActivities or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_warehouse_user_activity_name=data_warehouse_user_activity_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 2b071f58ae50..56dfe4fd62bd 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -81,7 +82,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -173,7 +189,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -197,7 +213,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) @@ -317,7 +337,7 @@ async def 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) @@ -353,7 +373,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) 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 3a2746863940..790b8adaaa3b 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 @@ -92,7 +92,7 @@ async 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) _request = build_list_by_database_request( @@ -116,7 +116,11 @@ async def list_by_database( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("[Advisor]", pipeline_response.http_response) @@ -155,7 +159,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) _request = build_get_request( @@ -179,7 +183,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) @@ -293,7 +301,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) @@ -329,7 +337,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) 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 79f973c4f9e9..63a8dde7d110 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 @@ -81,7 +81,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) _request = build_get_request( @@ -104,7 +104,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) @@ -209,7 +213,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) @@ -244,7 +248,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) 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 2c3958e62ec2..1c9fe8f3cf9e 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -81,7 +82,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) @@ -295,7 +315,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) @@ -331,7 +351,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) 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 75c0be68acb7..00f928428263 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -98,7 +99,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -129,7 +130,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -152,7 +164,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -192,7 +208,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -221,7 +237,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -244,7 +271,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -291,7 +322,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) _request = build_get_request( @@ -317,7 +348,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseColumn", pipeline_response.http_response) 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 73d4007c24b6..dd09f5ab6fa5 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 @@ -75,7 +75,7 @@ async def _revalidate_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_revalidate_request( @@ -104,12 +104,20 @@ async def _revalidate_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -141,7 +149,7 @@ async def begin_revalidate( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -201,7 +209,7 @@ async def _revert_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_revert_request( @@ -230,12 +238,20 @@ async def _revert_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -267,7 +283,7 @@ async def begin_revert( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 6177f211e16c..f6a1ff20e110 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ImportExportExtensionsOperationResult"]: + """List database extension. This will return an empty list as it is not supported. + + :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 + :return: An iterator like instance of either ImportExportExtensionsOperationResult or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + :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", self._config.api_version)) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any @@ -93,7 +186,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_get_request( @@ -117,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -142,7 +239,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -183,12 +280,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -204,7 +309,8 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -239,7 +345,8 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -272,7 +379,8 @@ async def begin_create_or_update( parameters: Union[_models.DatabaseExtensions, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -295,7 +403,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportExtensionsOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -340,80 +448,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ImportExportExtensionsOperationResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ImportExportExtensionsOperationResult"]: - """List database extension. This will return an empty list as it is not supported. - - :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 - :return: An iterator like instance of either ImportExportExtensionsOperationResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", "2021-02-01-preview")) - cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 8226f3b07eab..3480329204c1 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -100,7 +101,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -123,7 +135,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -160,7 +175,7 @@ async def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( @@ -184,7 +199,10 @@ async def cancel( 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 748e0e6568ae..1e2ba9161d7e 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 @@ -60,7 +60,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace_async async def list_by_database_advisor( self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> List[_models.RecommendedAction]: + ) -> List[_models.RecommendedActionAutoGenerated]: """Gets list of Database Recommended Actions. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -72,8 +72,8 @@ async def list_by_database_advisor( :type database_name: str :param advisor_name: The name of the Database Advisor. Required. :type advisor_name: str - :return: list of RecommendedAction or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.RecommendedAction] + :return: list of RecommendedActionAutoGenerated or the result of cls(response) + :rtype: list[~azure.mgmt.sql.models.RecommendedActionAutoGenerated] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -87,8 +87,8 @@ async def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[List[_models.RecommendedActionAutoGenerated]] = kwargs.pop("cls", None) _request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -111,9 +111,13 @@ async def list_by_database_advisor( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("[RecommendedAction]", pipeline_response.http_response) + deserialized = self._deserialize("[RecommendedActionAutoGenerated]", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -129,7 +133,7 @@ async def get( advisor_name: str, recommended_action_name: str, **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Gets a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -143,8 +147,8 @@ async def get( :type advisor_name: str :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -158,8 +162,8 @@ 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", "2020-11-01-preview")) - cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, @@ -183,9 +187,13 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RecommendedAction", pipeline_response.http_response) + deserialized = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -200,11 +208,11 @@ async def update( database_name: str, advisor_name: str, recommended_action_name: str, - parameters: _models.RecommendedAction, + parameters: _models.RecommendedActionAutoGenerated, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -219,12 +227,12 @@ async def update( :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str :param parameters: The requested recommended action resource state. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedAction + :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ @@ -240,7 +248,7 @@ async def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -259,8 +267,8 @@ async def update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ @@ -272,9 +280,9 @@ async def update( database_name: str, advisor_name: str, recommended_action_name: str, - parameters: Union[_models.RecommendedAction, IO[bytes]], + parameters: Union[_models.RecommendedActionAutoGenerated, IO[bytes]], **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -289,10 +297,10 @@ async def update( :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str :param parameters: The requested recommended action resource state. Is either a - RecommendedAction type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedAction or IO[bytes] - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + RecommendedActionAutoGenerated type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated or IO[bytes] + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -306,9 +314,9 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -316,7 +324,7 @@ async def update( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "RecommendedAction") + _json = self._serialize.body(parameters, "RecommendedActionAutoGenerated") _request = build_update_request( resource_group_name=resource_group_name, @@ -343,9 +351,13 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RecommendedAction", pipeline_response.http_response) + deserialized = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore 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 9bf87dda5676..b3aac1b573e5 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -82,7 +83,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -168,7 +184,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSchema", pipeline_response.http_response) 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 175d4ae723b0..3516ce81ccfa 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -59,6 +60,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSecurityAlertPolicy"]: + """Gets a list of database's security alert policies. + + :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 for which the security alert policy is defined. + Required. + :type database_name: str + :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -78,7 +172,7 @@ async def get( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :return: DatabaseSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy @@ -95,7 +189,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -119,7 +213,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -150,7 +248,7 @@ async def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy @@ -184,7 +282,7 @@ async def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: IO[bytes] @@ -216,7 +314,7 @@ async def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Is either a DatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. @@ -236,7 +334,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) @@ -272,7 +370,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -280,81 +382,3 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSecurityAlertPolicy"]: - """Gets a list of database's security alert policies. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 0e95a3c18e30..3e877f854e21 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -89,7 +90,7 @@ def list_by_sql_vulnerability_assessment( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -116,7 +117,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -141,7 +153,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -186,7 +202,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) _request = build_get_request( @@ -211,7 +227,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response @@ -341,7 +361,7 @@ async def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) @@ -378,7 +398,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 39234b2649ba..0ec13ee3f0cc 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 @@ -75,7 +75,7 @@ async def _execute_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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_execute_request( @@ -104,12 +104,20 @@ async def _execute_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -141,7 +149,7 @@ async def begin_execute( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 fec0ff93510a..bf0448e5d5c7 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -93,7 +94,7 @@ def list_by_baseline( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -121,7 +122,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -146,7 +158,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -194,7 +210,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -220,7 +236,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -358,7 +378,7 @@ async def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -396,7 +416,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -449,7 +473,7 @@ async def 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -475,7 +499,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 f9297d7c6296..6c319ba0e545 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -92,7 +93,7 @@ def list_by_scan( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +121,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -143,7 +155,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -193,7 +209,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) _request = build_get_request( @@ -219,7 +235,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) 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 9b2c79f4b4aa..c41bbbc2ec8e 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -87,7 +88,7 @@ def list_by_sql_vulnerability_assessments( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -114,7 +115,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -137,7 +149,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -182,7 +198,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -207,7 +223,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) 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 b887f73260ad..fae0af0fade0 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -79,7 +80,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -105,7 +106,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -128,7 +140,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,7 +187,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -195,7 +211,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) 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 7db2758b5402..b8a1c43164e6 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -113,7 +114,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -136,7 +148,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -180,7 +196,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) _request = build_get_request( @@ -205,7 +221,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseTable", pipeline_response.http_response) 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 c24cf171614f..381caddb3140 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -73,7 +74,7 @@ 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -99,7 +100,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -122,7 +134,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 24754c79a635..651ec563aa72 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 @@ -102,7 +102,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -128,7 +128,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -273,7 +277,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -311,7 +315,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -365,7 +373,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -391,7 +399,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 9e97374ac2c2..1519d2780023 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,136 +64,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def _initiate_scan_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_initiate_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._initiate_scan_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace def list_by_database( self, @@ -223,7 +94,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -250,7 +121,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -273,7 +155,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -318,7 +204,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -343,7 +229,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) @@ -391,7 +281,7 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) _request = build_export_request( @@ -416,7 +306,11 @@ async def export( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) @@ -424,3 +318,141 @@ async def export( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + async def _initiate_scan_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_initiate_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_initiate_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Executes a Vulnerability Assessment database scan. + + :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :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", self._config.api_version)) + 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._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](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/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py index bcc68ab9991a..5d3c388b76c8 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -60,6 +61,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a database. + + :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 for which the vulnerability assessment policies + are defined. Required. + :type database_name: str + :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -97,7 +191,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -121,7 +215,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -241,7 +339,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -277,7 +375,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -323,7 +425,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -347,85 +449,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a database. - - :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 for which the vulnerability assessment policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 ddfb0d2723ef..c92a3d32b7cd 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,8 +44,6 @@ build_list_by_elastic_pool_request, build_list_by_server_request, build_list_inaccessible_by_server_request, - build_list_metric_definitions_request, - build_list_metrics_request, build_pause_request, build_rename_request, build_resume_request, @@ -77,160 +76,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_metrics( - self, resource_group_name: str, server_name: str, database_name: str, filter: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Metric"]: - """Returns database metrics. - - :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 filter: An OData filter expression that describes a subset of metrics to return. - Required. - :type filter: str - :return: An iterator like instance of either Metric or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Metric] - :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", "2014-04-01")) - cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metrics_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MetricListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_metric_definitions( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MetricDefinition"]: - """Returns database metric definitions. - - :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 - :return: An iterator like instance of either MetricDefinition or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.MetricDefinition] - :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", "2014-04-01")) - cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metric_definitions_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MetricDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace def list_by_server( self, resource_group_name: str, server_name: str, skip_token: Optional[str] = None, **kwargs: Any @@ -251,7 +96,7 @@ 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", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -277,7 +122,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -300,7 +156,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -345,7 +205,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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) _request = build_get_request( @@ -370,7 +230,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Database", pipeline_response.http_response) @@ -398,7 +262,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -438,12 +302,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -538,7 +410,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -600,7 +472,7 @@ async def _delete_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", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -628,12 +500,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -657,7 +537,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", self._config.api_version)) 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) @@ -716,7 +596,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -756,12 +636,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -856,7 +744,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -922,7 +810,7 @@ async def _export_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -962,12 +850,20 @@ async def _export_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1062,7 +958,7 @@ async def begin_export( _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1126,7 +1022,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", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1155,12 +1051,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1192,7 +1096,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", self._config.api_version)) 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) @@ -1250,7 +1154,7 @@ async def _import_method_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1290,12 +1194,20 @@ async def _import_method_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1390,7 +1302,7 @@ async def begin_import_method( _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1531,7 +1443,7 @@ async def rename( _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -1566,7 +1478,11 @@ async def rename( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -1585,7 +1501,7 @@ async def _pause_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", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_pause_request( @@ -1613,12 +1529,20 @@ async def _pause_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1643,7 +1567,7 @@ async def begin_pause( _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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1699,7 +1623,7 @@ async def _resume_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", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_resume_request( @@ -1727,12 +1651,20 @@ async def _resume_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1757,7 +1689,7 @@ async def begin_resume( _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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1813,7 +1745,7 @@ async def _upgrade_data_warehouse_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", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_upgrade_data_warehouse_request( @@ -1841,12 +1773,20 @@ async def _upgrade_data_warehouse_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1870,7 +1810,7 @@ async def begin_upgrade_data_warehouse( _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", self._config.api_version)) 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) @@ -1928,7 +1868,7 @@ def list_by_elastic_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-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1954,7 +1894,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1977,7 +1928,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2001,7 +1956,7 @@ def list_inaccessible_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", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2026,7 +1981,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -2049,7 +2015,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 fce2f3c22f6d..a4b4c826dfd4 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -97,7 +98,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -120,66 +132,16 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: - """Gets a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: DeletedServer or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DeletedServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DeletedServer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: """Gets a list of deleted servers for a location. @@ -193,7 +155,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged[ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -217,7 +179,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -240,12 +213,74 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async + async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: + """Gets a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: DeletedServer or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DeletedServer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) + + _request = build_get_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DeletedServer", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + async def _recover_initial( self, location_name: str, deleted_server_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: @@ -260,7 +295,7 @@ async def _recover_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_recover_request( @@ -287,12 +322,20 @@ async def _recover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -314,7 +357,7 @@ async def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServer] = 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/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py index 37835feff73d..f1a7885e72cd 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -88,7 +89,7 @@ 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", self._config.api_version)) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -113,7 +114,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -136,7 +148,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -175,7 +190,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", self._config.api_version)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -198,7 +213,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_response) @@ -227,7 +245,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -267,13 +285,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -368,7 +393,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", self._config.api_version)) 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) @@ -431,7 +456,7 @@ async def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -459,13 +484,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -493,7 +525,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", self._config.api_version)) 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) @@ -550,7 +582,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -590,13 +622,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -691,7 +730,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", self._config.api_version)) 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) @@ -755,7 +794,7 @@ async def _failover_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -795,7 +834,10 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -901,7 +943,7 @@ async def begin_failover( _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", self._config.api_version)) 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) @@ -967,7 +1009,7 @@ async def _set_role_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1007,13 +1049,20 @@ async def _set_role_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1108,7 +1157,7 @@ async def begin_set_role( _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", self._config.api_version)) 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) 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 deleted file mode 100644 index 8ceb1132e19f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_activities_operations.py +++ /dev/null @@ -1,130 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._elastic_pool_activities_operations import build_list_by_elastic_pool_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ElasticPoolActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`elastic_pool_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticPoolActivity"]: - """Returns elastic pool activities. - - :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 elastic_pool_name: The name of the elastic pool for which to get the current activity. - Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolActivity or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPoolActivity] - :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", "2014-04-01")) - cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolActivityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index c85af3f82b82..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_database_activities_operations.py +++ /dev/null @@ -1,131 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._elastic_pool_database_activities_operations import build_list_by_elastic_pool_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ElasticPoolDatabaseActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`elastic_pool_database_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticPoolDatabaseActivity"]: - """Returns activity on databases inside of an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolDatabaseActivity or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPoolDatabaseActivity] - :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", "2014-04-01")) - cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolDatabaseActivityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 b77d11dd1fb0..d43979849ec2 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -54,65 +55,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def cancel( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :param operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace def list_by_elastic_pool( self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -134,7 +76,7 @@ def list_by_elastic_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -160,7 +102,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -183,8 +136,75 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the elastic pool. + + :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 elastic_pool_name: Required. + :type elastic_pool_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 fad98e159dbf..4a0126e2f863 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -38,8 +39,6 @@ build_failover_request, build_get_request, build_list_by_server_request, - build_list_metric_definitions_request, - build_list_metrics_request, build_update_request, ) from .._configuration import SqlManagementClientConfiguration @@ -68,160 +67,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_metrics( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, filter: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Metric"]: - """Returns elastic pool metrics. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param filter: An OData filter expression that describes a subset of metrics to return. - Required. - :type filter: str - :return: An iterator like instance of either Metric or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Metric] - :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", "2014-04-01")) - cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metrics_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MetricListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_metric_definitions( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.MetricDefinition"]: - """Returns elastic pool metric definitions. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either MetricDefinition or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.MetricDefinition] - :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", "2014-04-01")) - cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metric_definitions_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MetricDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace def list_by_server( self, resource_group_name: str, server_name: str, skip: Optional[int] = None, **kwargs: Any @@ -242,7 +87,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -268,7 +113,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -291,7 +147,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -325,7 +185,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) _request = build_get_request( @@ -348,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ElasticPool", pipeline_response.http_response) @@ -376,7 +240,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -416,12 +280,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -516,7 +388,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -578,7 +450,7 @@ async def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -606,12 +478,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -635,7 +515,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -694,7 +574,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -734,12 +614,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -834,7 +722,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -895,7 +783,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -923,12 +811,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -952,7 +848,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 c95d9ba6372a..51929cdc1d16 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -82,7 +83,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -169,7 +185,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("EncryptionProtector", pipeline_response.http_response) @@ -220,7 +240,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -260,12 +280,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -363,7 +391,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -426,7 +454,7 @@ async def _revalidate_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_revalidate_request( @@ -454,12 +482,20 @@ async def _revalidate_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -488,7 +524,7 @@ async def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 b5fd7f3432f6..c31609cb68fa 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -72,7 +73,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -97,7 +98,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -120,7 +132,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -155,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) _request = build_get_request( @@ -178,7 +194,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("EndpointCertificate", pipeline_response.http_response) 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 2d3b9f20e5f8..b0c61bc6cfc4 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -81,7 +82,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) @@ -295,7 +315,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) @@ -331,7 +351,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) 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 5f5b5b9b9ac9..8ae425aea90e 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -164,7 +180,7 @@ async def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -187,7 +203,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_response) @@ -215,7 +235,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -255,12 +275,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -350,7 +378,7 @@ async def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 9ad66a34a332..92253aa07f7a 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -87,7 +88,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -112,7 +113,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -135,7 +147,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -169,7 +185,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", self._config.api_version)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("FailoverGroup", pipeline_response.http_response) @@ -220,7 +240,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -260,12 +280,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -360,7 +388,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", self._config.api_version)) 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) @@ -419,7 +447,7 @@ async def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -447,12 +475,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -476,7 +512,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", self._config.api_version)) 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) @@ -533,7 +569,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -573,12 +609,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -673,7 +717,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", self._config.api_version)) 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) @@ -732,7 +776,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -760,12 +804,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -790,7 +842,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", self._config.api_version)) 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) @@ -846,7 +898,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -874,12 +926,20 @@ async def _force_failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -905,7 +965,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -961,7 +1021,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_try_planned_before_forced_failover_request( @@ -989,7 +1049,11 @@ async def _try_planned_before_forced_failover_initial( # pylint: disable=name-t except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1024,7 +1088,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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 80dc30107e31..cb531551b386 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -61,23 +62,27 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.FirewallRule: - """Gets a firewall rule. + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FirewallRule"]: + """Gets a list of firewall rules. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: An iterator like instance of either FirewallRule or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FirewallRule] :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", self._config.api_version)) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -86,124 +91,137 @@ async def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @overload - async def create_or_update( + async def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, - parameters: _models.FirewallRule, + parameters: _models.FirewallRuleList, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def create_or_update( + async def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. + :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: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def create_or_update( + async def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, - parameters: Union[_models.FirewallRule, IO[bytes]], + parameters: Union[_models.FirewallRuleList, IO[bytes]], **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Is either - a FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :param parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -217,9 +235,9 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -227,12 +245,11 @@ async def create_or_update( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "FirewallRule") + _json = self._serialize.body(parameters, "FirewallRuleList") - _request = build_create_or_update_request( + _request = build_replace_request( resource_group_name=resource_group_name, server_name=server_name, - firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -250,11 +267,17 @@ async def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -262,8 +285,10 @@ async def create_or_update( return deserialized # type: ignore @distributed_trace_async - async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: - """Deletes a firewall rule. + async def get( + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.FirewallRule: + """Gets a firewall rule. :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. @@ -272,8 +297,8 @@ async def delete(self, resource_group_name: str, server_name: str, firewall_rule :type server_name: str :param firewall_rule_name: The name of the firewall rule. Required. :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -287,10 +312,10 @@ async def delete(self, resource_group_name: str, server_name: str, firewall_rule _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) - _request = build_delete_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, firewall_rule_name=firewall_rule_name, @@ -308,158 +333,104 @@ async def delete(self, resource_group_name: str, server_name: str, firewall_rule response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.FirewallRule"]: - """Gets a list of firewall rules. - - :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 - :return: An iterator like instance of either FirewallRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FirewallRule] - :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", "2020-11-01-preview")) - cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return AsyncItemPaged(get_next, extract_data) + return deserialized # type: ignore @overload - async def replace( + async def create_or_update( self, resource_group_name: str, server_name: str, - parameters: _models.FirewallRuleList, + firewall_rule_name: str, + parameters: _models.FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def replace( + async def create_or_update( self, resource_group_name: str, server_name: str, + firewall_rule_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Required. + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def replace( + async def create_or_update( self, resource_group_name: str, server_name: str, - parameters: Union[_models.FirewallRuleList, IO[bytes]], + firewall_rule_name: str, + parameters: Union[_models.FirewallRule, IO[bytes]], **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Is either + a FirewallRule type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -473,9 +444,9 @@ async def replace( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -483,11 +454,12 @@ async def replace( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "FirewallRuleList") + _json = self._serialize.body(parameters, "FirewallRule") - _request = build_replace_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, + firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -505,15 +477,75 @@ async def replace( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + 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("FirewallRule", pipeline_response.http_response) + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: + """Deletes a firewall rule. + + :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 firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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, 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 aa853962fe5e..63310a98d4a6 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -31,7 +32,7 @@ from ...operations._geo_backup_policies_operations import ( build_create_or_update_request, build_get_request, - build_list_by_database_request, + build_list_request, ) from .._configuration import SqlManagementClientConfiguration @@ -59,6 +60,169 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.GeoBackupPolicy"]: + """Gets a list of Geo backup policies for the given database resource. + + :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 + :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Gets a Geo backup policy for the given database resource. + + :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :return: GeoBackupPolicy or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload async def create_or_update( self, @@ -71,7 +235,7 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -80,7 +244,8 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Required. @@ -105,7 +270,7 @@ async def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -114,7 +279,8 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Required. @@ -137,7 +303,7 @@ async def create_or_update( parameters: Union[_models.GeoBackupPolicy, IO[bytes]], **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -146,7 +312,8 @@ async def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Is either a GeoBackupPolicy type or a IO[bytes] type. Required. @@ -166,7 +333,7 @@ async def 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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) @@ -202,75 +369,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Gets a geo backup policy. - - :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 geo_backup_policy_name: The name of the geo backup policy. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) @@ -278,78 +381,3 @@ async def get( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.GeoBackupPolicy"]: - """Returns a list of geo backup policies. - - :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 - :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] - :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", "2014-04-01")) - cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 9c3df0ba0c8d..bf37d74b8c0a 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ def list_by_location( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -110,7 +111,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -133,7 +145,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -167,7 +183,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -190,7 +206,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_response) @@ -218,7 +238,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -258,12 +278,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -358,7 +386,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -417,7 +445,7 @@ async def _delete_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -445,12 +473,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -474,7 +510,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -526,7 +562,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -554,12 +590,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -584,7 +628,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -640,7 +684,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -668,12 +712,20 @@ async def _force_failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -699,7 +751,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = 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/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pool_operations_operations.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_service_objectives_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pool_operations_operations.py index bf20c3cc892b..8080c5e33465 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/_instance_pool_operations_operations.py @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -27,7 +28,7 @@ from ... import models as _models from ..._utils.serialization import Deserializer, Serializer -from ...operations._service_objectives_operations import build_get_request, build_list_by_server_request +from ...operations._instance_pool_operations_operations import build_get_request, build_list_by_instance_pool_request from .._configuration import SqlManagementClientConfiguration T = TypeVar("T") @@ -35,14 +36,14 @@ List = list -class ServiceObjectivesOperations: +class InstancePoolOperationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`service_objectives` attribute. + :attr:`instance_pool_operations` attribute. """ models = _models @@ -54,86 +55,27 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, service_objective_name: str, **kwargs: Any - ) -> _models.ServiceObjective: - """Gets a database service objective. - - :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 service_objective_name: The name of the service objective to retrieve. Required. - :type service_objective_name: str - :return: ServiceObjective or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServiceObjective - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - service_objective_name=service_objective_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ServiceObjective", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServiceObjective"]: - """Returns database service objectives. + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.InstancePoolOperation"]: + """Gets a list of operations performed on the instance pool. :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 - :return: An iterator like instance of either ServiceObjective or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServiceObjective] + :param instance_pool_name: The name of the managed instance pool. Required. + :type instance_pool_name: str + :return: An iterator like instance of either InstancePoolOperation or the result of + cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] :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", "2014-04-01")) - cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.InstancePoolOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -146,9 +88,9 @@ def list_by_server( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_server_request( + _request = build_list_by_instance_pool_request( resource_group_name=resource_group_name, - server_name=server_name, + instance_pool_name=instance_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -157,17 +99,28 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("ServiceObjectiveListResult", pipeline_response) + deserialized = self._deserialize("InstancePoolOperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -180,8 +133,76 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.InstancePoolOperation: + """Gets a management operation on a instance pool. + + :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 instance_pool_name: The name of the managed instance pool. Required. + :type instance_pool_name: str + :param operation_id: Required. + :type operation_id: str + :return: InstancePoolOperation or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.InstancePoolOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("InstancePoolOperation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 940301cc189c..62c9ebef2fd2 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -77,7 +78,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.InstancePool"]: _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", self._config.api_version)) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -100,7 +101,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -123,7 +135,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -143,7 +159,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Asy _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", self._config.api_version)) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -167,7 +183,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -190,7 +217,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -220,7 +251,7 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: _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", self._config.api_version)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) _request = build_get_request( @@ -242,7 +273,11 @@ async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("InstancePool", pipeline_response.http_response) @@ -269,7 +304,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -308,12 +343,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -399,7 +442,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -457,7 +500,7 @@ async def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -484,12 +527,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -511,7 +562,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", self._config.api_version)) 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) @@ -566,7 +617,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -605,12 +656,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -696,7 +755,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 4d0b2b4e7d85..1b5e72e52294 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -78,7 +79,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -103,7 +104,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -126,7 +138,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -160,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -183,7 +199,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) @@ -290,7 +310,7 @@ async def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) @@ -325,7 +345,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) @@ -360,7 +384,7 @@ async def delete(self, resource_group_name: str, server_name: str, firewall_rule _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -383,7 +407,11 @@ async def delete(self, resource_group_name: str, server_name: str, firewall_rule if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 4f57a0298086..8ad6bdc19415 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) _request = build_get_request( @@ -188,7 +204,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobAgent", pipeline_response.http_response) @@ -216,7 +236,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -256,12 +276,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -356,7 +384,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,7 +443,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -443,12 +471,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -472,7 +508,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -529,7 +565,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -569,12 +605,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -669,7 +713,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 e5fe8d92e46d..f19284d52770 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -80,7 +81,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -106,7 +107,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -129,7 +141,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobCredential", pipeline_response.http_response) @@ -303,7 +323,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) @@ -339,7 +359,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobCredential", pipeline_response.http_response) @@ -378,7 +402,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -402,7 +426,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 9b3be94cf29d..4c6c2c81f537 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -116,7 +117,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -149,7 +150,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -172,14 +184,149 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_job( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists a job's executions. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :type create_time_min: ~datetime.datetime + :param create_time_max: If specified, only job executions created before the specified time are + included. Default value is None. + :type create_time_max: ~datetime.datetime + :param end_time_min: If specified, only job executions completed at or after the specified time + are included. Default value is None. + :type end_time_min: ~datetime.datetime + :param end_time_max: If specified, only job executions completed before the specified time are + included. Default value is None. + :type end_time_max: ~datetime.datetime + :param is_active: If specified, only active or only completed job executions are included. + Default value is None. + :type is_active: bool + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :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", self._config.api_version)) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("JobExecutionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def cancel( + async def get( self, resource_group_name: str, server_name: str, @@ -187,8 +334,8 @@ async def cancel( job_name: str, job_execution_id: str, **kwargs: Any - ) -> None: - """Requests cancellation of a job execution. + ) -> _models.JobExecution: + """Gets a job execution. :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. @@ -199,10 +346,10 @@ async def cancel( :type job_agent_name: str :param job_name: The name of the job. Required. :type job_name: str - :param job_execution_id: The id of the job execution to cancel. Required. + :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str - :return: None or the result of cls(response) - :rtype: None + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -216,10 +363,10 @@ async def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - _request = build_cancel_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -241,13 +388,27 @@ async def cancel( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore - async def _create_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -260,14 +421,15 @@ async def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, + job_execution_id=job_execution_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -283,26 +445,40 @@ async def _create_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def begin_create( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any ) -> AsyncLROPoller[_models.JobExecution]: - """Starts an elastic job execution. + """Creates or updates a job execution. :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. @@ -313,6 +489,8 @@ async def begin_create( :type job_agent_name: str :param job_name: The name of the job to get. Required. :type job_name: str + :param job_execution_id: The job execution id to create the job execution under. Required. + :type job_execution_id: str :return: An instance of AsyncLROPoller that returns either JobExecution or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] @@ -321,17 +499,18 @@ async def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = 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_initial( + raw_result = await self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, + job_execution_id=job_execution_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -364,124 +543,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_job( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists a job's executions. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", "2020-11-01-preview")) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def get( + async def cancel( self, resource_group_name: str, server_name: str, @@ -489,8 +552,8 @@ async def get( job_name: str, job_execution_id: str, **kwargs: Any - ) -> _models.JobExecution: - """Gets a job execution. + ) -> None: + """Requests cancellation of a job execution. :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. @@ -501,10 +564,10 @@ async def get( :type job_agent_name: str :param job_name: The name of the job. Required. :type job_name: str - :param job_execution_id: The id of the job execution. Required. + :param job_execution_id: The id of the job execution to cancel. Required. :type job_execution_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution + :return: None or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -518,10 +581,10 @@ 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", "2020-11-01-preview")) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_cancel_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -543,23 +606,17 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobExecution", pipeline_response.http_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any + async def _create_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -572,15 +629,14 @@ async def _create_or_update_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_or_update_request( + _request = build_create_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, - job_execution_id=job_execution_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -596,32 +652,34 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any + async def begin_create( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> AsyncLROPoller[_models.JobExecution]: - """Creates or updates a job execution. + """Starts an elastic job execution. :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. @@ -632,8 +690,6 @@ async def begin_create_or_update( :type job_agent_name: str :param job_name: The name of the job to get. Required. :type job_name: str - :param job_execution_id: The job execution id to create the job execution under. Required. - :type job_execution_id: str :return: An instance of AsyncLROPoller that returns either JobExecution or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] @@ -642,18 +698,17 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = 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( + raw_result = await self._create_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, - job_execution_id=job_execution_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, 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 4650712ca66a..ea53bd6d0afa 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ def list_by_agent( _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", self._config.api_version)) cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -110,7 +111,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -133,7 +145,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -169,7 +185,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", self._config.api_version)) cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) _request = build_get_request( @@ -193,7 +209,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobPrivateEndpoint", pipeline_response.http_response) @@ -222,7 +242,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -263,12 +283,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -372,7 +400,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -434,7 +462,7 @@ async def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -463,12 +491,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -494,7 +530,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", self._config.api_version)) 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) 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 bb8bff32d245..87f1f7ec5757 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -56,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_by_job_execution( + def list_by_job_execution( # pylint: disable=too-many-locals self, resource_group_name: str, server_name: str, @@ -111,7 +112,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -146,7 +147,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -169,7 +181,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -216,7 +232,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) _request = build_get_request( @@ -242,7 +258,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobExecution", pipeline_response.http_response) 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 3b6f6be8cfa2..73a73b0492f2 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -62,169 +63,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobStep"]: - """Gets all job steps in the specified job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] - :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", "2020-11-01-preview")) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets the specified version of a job step. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_job( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -247,7 +85,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -274,7 +112,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -297,7 +146,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -341,7 +194,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) _request = build_get_request( @@ -366,7 +219,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobStep", pipeline_response.http_response) @@ -489,7 +346,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) @@ -526,7 +383,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobStep", pipeline_response.http_response) @@ -573,7 +434,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -598,7 +459,193 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobStep"]: + """Gets all job steps in the specified job version. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: An iterator like instance of either JobStep or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] + :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", self._config.api_version)) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("JobStepListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets the specified version of a job step. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_get_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("JobStep", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 a0401ac966e5..69d20209e8e4 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -60,13 +61,14 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_by_job_execution( + def list_by_step( # pylint: disable=too-many-locals self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, job_execution_id: str, + step_name: str, create_time_min: Optional[datetime.datetime] = None, create_time_max: Optional[datetime.datetime] = None, end_time_min: Optional[datetime.datetime] = None, @@ -76,7 +78,7 @@ def list_by_job_execution( top: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists target executions for all steps of a job execution. + """Lists the target executions of a job step execution. :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. @@ -89,6 +91,8 @@ def list_by_job_execution( :type job_name: str :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str :param create_time_min: If specified, only job executions created at or after the specified time are included. Default value is None. :type create_time_min: ~datetime.datetime @@ -115,7 +119,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -129,12 +133,13 @@ def list_by_job_execution( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_job_execution_request( + _request = build_list_by_step_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, job_execution_id=job_execution_id, + step_name=step_name, subscription_id=self._config.subscription_id, create_time_min=create_time_min, create_time_max=create_time_max, @@ -150,7 +155,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -173,14 +189,18 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace - def list_by_step( + @distributed_trace_async + async def get( self, resource_group_name: str, server_name: str, @@ -188,6 +208,89 @@ def list_by_step( job_name: str, job_execution_id: str, step_name: str, + target_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a target execution. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :param target_id: The target id. Required. + :type target_id: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + target_id=target_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("JobExecution", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, create_time_min: Optional[datetime.datetime] = None, create_time_max: Optional[datetime.datetime] = None, end_time_min: Optional[datetime.datetime] = None, @@ -197,7 +300,7 @@ def list_by_step( top: Optional[int] = None, **kwargs: Any ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists the target executions of a job step execution. + """Lists target executions for all steps of a job execution. :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. @@ -210,8 +313,6 @@ def list_by_step( :type job_name: str :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str :param create_time_min: If specified, only job executions created at or after the specified time are included. Default value is None. :type create_time_min: ~datetime.datetime @@ -238,7 +339,7 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -252,13 +353,12 @@ def list_by_step( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_step_request( + _request = build_list_by_job_execution_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, job_execution_id=job_execution_id, - step_name=step_name, subscription_id=self._config.subscription_id, create_time_min=create_time_min, create_time_max=create_time_max, @@ -274,7 +374,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -297,88 +408,12 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - target_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a target execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param target_id: The target id. Required. - :type target_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - target_id=target_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 822928e4b117..4304645b50db 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -80,7 +81,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -106,7 +107,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -129,7 +141,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobTargetGroup", pipeline_response.http_response) @@ -303,7 +323,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) @@ -339,7 +359,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobTargetGroup", pipeline_response.http_response) @@ -378,7 +402,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -402,7 +426,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 865d9c9fcdc1..661f345a48ea 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -76,7 +77,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -103,7 +104,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -126,7 +138,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -170,7 +186,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) _request = build_get_request( @@ -195,7 +211,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobVersion", pipeline_response.http_response) 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 7087ffc555a9..37ca44243d70 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -80,7 +81,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -106,7 +107,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -129,7 +141,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Job", pipeline_response.http_response) @@ -302,7 +322,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) @@ -338,7 +358,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Job", pipeline_response.http_response) @@ -377,7 +401,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -401,7 +425,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 7b4dbe7d2214..f65005344a74 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :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 + :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] + :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", self._config.api_version)) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -99,7 +190,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) _request = build_get_request( @@ -123,7 +214,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_response) @@ -152,7 +247,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -193,12 +288,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -304,7 +407,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -350,81 +453,6 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.LedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 - :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", "2021-02-01-preview")) - cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - async def _disable_initial( self, resource_group_name: str, @@ -444,7 +472,7 @@ async def _disable_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_disable_request( @@ -473,12 +501,20 @@ async def _disable_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -511,7 +547,7 @@ async def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LedgerDigestUploads] = 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/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py index a13cb59efd48..24fb49846e99 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -111,7 +112,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -137,7 +138,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -160,7 +172,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -196,7 +211,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -223,7 +238,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -246,7 +272,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -285,7 +314,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -313,7 +342,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -336,7 +376,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -377,7 +420,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_request( @@ -401,7 +444,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) @@ -430,7 +476,7 @@ async def _delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -459,7 +505,10 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -499,7 +548,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -558,7 +607,7 @@ async def _change_access_tier_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -599,7 +648,10 @@ async def _change_access_tier_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -711,7 +763,7 @@ async def begin_change_access_tier( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -777,7 +829,7 @@ async def _copy_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -818,7 +870,10 @@ async def _copy_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -932,7 +987,7 @@ async def begin_copy( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -997,7 +1052,7 @@ async def _lock_time_based_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_lock_time_based_immutability_request( @@ -1026,7 +1081,10 @@ async def _lock_time_based_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1067,7 +1125,7 @@ async def begin_lock_time_based_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1129,7 +1187,7 @@ async def _remove_legal_hold_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_legal_hold_immutability_request( @@ -1158,7 +1216,10 @@ async def _remove_legal_hold_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1199,7 +1260,7 @@ async def begin_remove_legal_hold_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1261,7 +1322,7 @@ async def _remove_time_based_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_time_based_immutability_request( @@ -1290,7 +1351,10 @@ async def _remove_time_based_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1331,7 +1395,7 @@ async def begin_remove_time_based_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1393,7 +1457,7 @@ async def _set_legal_hold_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_set_legal_hold_immutability_request( @@ -1422,7 +1486,10 @@ async def _set_legal_hold_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1463,7 +1530,7 @@ async def begin_set_legal_hold_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1526,7 +1593,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1567,7 +1634,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1681,7 +1751,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1757,7 +1827,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1784,7 +1854,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1807,7 +1888,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1847,7 +1931,7 @@ def list_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1875,7 +1959,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1898,7 +1993,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1941,7 +2039,7 @@ def list_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1970,7 +2068,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1993,7 +2102,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2038,7 +2150,7 @@ async def get_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_by_resource_group_request( @@ -2063,7 +2175,10 @@ async def get_by_resource_group( 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) @@ -2093,7 +2208,7 @@ async def _delete_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_by_resource_group_request( @@ -2123,7 +2238,10 @@ async def _delete_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2167,7 +2285,7 @@ async def begin_delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -2228,7 +2346,7 @@ async def _change_access_tier_by_resource_group_initial( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2270,7 +2388,10 @@ async def _change_access_tier_by_resource_group_initial( # pylint: disable=name except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2394,7 +2515,7 @@ async def begin_change_access_tier_by_resource_group( # 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2462,7 +2583,7 @@ async def _copy_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -2504,7 +2625,10 @@ async def _copy_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2630,7 +2754,7 @@ async def begin_copy_by_resource_group( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -2697,7 +2821,7 @@ async def _lock_time_based_immutability_by_resource_group_initial( # pylint: di _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_lock_time_based_immutability_by_resource_group_request( @@ -2727,7 +2851,10 @@ async def _lock_time_based_immutability_by_resource_group_initial( # pylint: di except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2771,7 +2898,7 @@ async def begin_lock_time_based_immutability_by_resource_group( # pylint: disab _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2835,7 +2962,7 @@ async def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_legal_hold_immutability_by_resource_group_request( @@ -2865,7 +2992,10 @@ async def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2909,7 +3039,7 @@ async def begin_remove_legal_hold_immutability_by_resource_group( # pylint: dis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2973,7 +3103,7 @@ async def _remove_time_based_immutability_by_resource_group_initial( # pylint: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_time_based_immutability_by_resource_group_request( @@ -3003,7 +3133,10 @@ async def _remove_time_based_immutability_by_resource_group_initial( # pylint: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3047,7 +3180,7 @@ async def begin_remove_time_based_immutability_by_resource_group( # pylint: dis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3111,7 +3244,7 @@ async def _set_legal_hold_immutability_by_resource_group_initial( # pylint: dis _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_set_legal_hold_immutability_by_resource_group_request( @@ -3141,7 +3274,10 @@ async def _set_legal_hold_immutability_by_resource_group_initial( # pylint: dis except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3185,7 +3321,7 @@ async def begin_set_legal_hold_immutability_by_resource_group( # pylint: disabl _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3250,7 +3386,7 @@ async def _update_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -3292,7 +3428,10 @@ async def _update_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3418,7 +3557,7 @@ async def begin_update_by_resource_group( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 2272ced240dc..65b9e7cd72db 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -7,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -69,6 +71,221 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_location( + self, + location_name: str, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :param only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :type only_latest_per_database: bool + :param database_state: Whether to query against just live databases, just deleted databases, or + all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + location_name: str, + managed_instance_name: str, + database_name: str, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :type only_latest_per_database: bool + :param database_state: Whether to query against just live databases, just deleted databases, or + all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any @@ -98,7 +315,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_request( @@ -122,7 +339,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) @@ -145,7 +366,7 @@ async def _delete_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -174,12 +395,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -204,7 +433,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -244,23 +473,20 @@ 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 @distributed_trace - def list_by_database( + def list_by_instance( self, location_name: str, managed_instance_name: str, - database_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. + """Lists the long term retention backups for a given managed instance. :param location_name: The location of the database. Required. :type location_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool @@ -276,7 +502,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -290,10 +516,9 @@ def list_by_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_database_request( + _request = build_list_by_instance_request( location_name=location_name, managed_instance_name=managed_instance_name, - database_name=database_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, @@ -304,7 +529,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -327,33 +563,48 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_instance( + def list_by_resource_group_location( self, + resource_group_name: str, location_name: str, - managed_instance_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. + """Lists the long term retention backups for managed databases in a given location. + :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 location_name: The location of the database. Required. :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the result of cls(response) :rtype: @@ -363,7 +614,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -377,12 +628,15 @@ def list_by_instance( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_instance_request( + _request = build_list_by_resource_group_location_request( + resource_group_name=resource_group_name, location_name=location_name, - managed_instance_name=managed_instance_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, + skip=skip, + top=top, + filter=filter, api_version=api_version, headers=_headers, params=_params, @@ -390,7 +644,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -413,24 +678,38 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_by_location( + def list_by_resource_group_database( self, + resource_group_name: str, location_name: str, + managed_instance_name: str, + database_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. + """Lists all long term retention backups for a managed database. + :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 location_name: The location of the database. Required. :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool @@ -446,7 +725,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -460,8 +739,11 @@ def list_by_location( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_location_request( + _request = build_list_by_resource_group_database_request( + resource_group_name=resource_group_name, location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, @@ -472,7 +754,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -495,7 +788,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -539,7 +836,7 @@ async def get_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_by_resource_group_request( @@ -564,7 +861,11 @@ async def get_by_resource_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) @@ -593,7 +894,7 @@ async def _delete_by_resource_group_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_by_resource_group_request( @@ -623,12 +924,20 @@ async def _delete_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -662,7 +971,7 @@ async def begin_delete_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -702,101 +1011,6 @@ 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 - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace def list_by_resource_group_instance( self, @@ -831,7 +1045,7 @@ def list_by_resource_group_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -859,94 +1073,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -969,7 +1107,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 c87e9fa88aed..8f6b1331cb50 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -110,7 +111,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -133,7 +145,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -175,7 +190,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -199,7 +214,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_response) @@ -229,7 +247,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -270,7 +288,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -384,7 +405,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 3eaf3718a0d2..cc30fc1cb8a5 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 @@ -88,7 +88,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) _request = build_get_request( @@ -112,7 +112,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("MaintenanceWindowOptions", pipeline_response.http_response) 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 1089b4be605c..6bc2ff326a91 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 @@ -88,7 +88,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) _request = build_get_request( @@ -225,7 +225,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) 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 092481f58476..6df11ab27184 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a managed database's short term retention policy list. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -99,7 +192,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -123,7 +216,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -152,7 +249,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -193,12 +290,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -305,7 +410,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -371,7 +476,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -412,12 +517,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -524,7 +637,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -569,80 +682,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a managed database's short term retention policy list. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 2ec2020893f2..0f11c7ccf55b 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -81,7 +82,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -173,7 +189,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", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -197,7 +213,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) @@ -317,7 +337,7 @@ async def 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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) @@ -353,7 +373,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) 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 160954b49430..c29ee7b545cf 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -98,7 +99,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -129,7 +130,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -152,7 +164,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -192,7 +208,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -221,7 +237,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -244,7 +271,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -291,7 +322,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) _request = build_get_request( @@ -317,7 +348,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseColumn", pipeline_response.http_response) 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 acd45e3d4eeb..6fa03fe90cbd 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ def list_by_location( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -112,7 +113,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -135,7 +147,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -169,7 +185,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseMoveOperationResult", pipeline_response.http_response) 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 fdbb4a41113f..717f0da067d0 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) _request = build_get_request( @@ -108,7 +109,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceQuery", pipeline_response.http_response) @@ -154,7 +159,7 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -184,7 +189,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -207,7 +223,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 bb2e7f61ea41..84bbf63fc457 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 @@ -149,7 +149,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -184,7 +184,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 8dd92f59b30e..75778afa7d06 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 @@ -87,7 +87,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) _request = build_get_request( @@ -111,7 +111,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseRestoreDetailsResult", pipeline_response.http_response) 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 2c0da0246f47..7b2402bcf409 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -82,7 +83,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -168,7 +184,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSchema", pipeline_response.http_response) 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 27ce6965eda6..69762d125637 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -59,6 +60,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: + """Gets a list of managed database's security alert policies. + + :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 database_name: The name of the managed database for which the security alert policies + are defined. Required. + :type database_name: str + :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result + of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -78,7 +172,7 @@ async def get( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy @@ -95,7 +189,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -119,7 +213,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -150,7 +248,7 @@ async def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy @@ -184,7 +282,7 @@ async def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: IO[bytes] @@ -216,7 +314,7 @@ async def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Is either a ManagedDatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. @@ -236,7 +334,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) @@ -272,7 +370,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -280,81 +382,3 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: - """Gets a list of managed database's security alert policies. - - :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 database_name: The name of the managed database for which the security alert policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 fe8699556efd..8798206da9c2 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -92,7 +93,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -122,7 +123,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -145,7 +157,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 4aededf54396..132770f6e954 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +36,7 @@ build_disable_recommendation_request, build_enable_recommendation_request, build_get_request, + build_list_by_database_request, build_list_current_by_database_request, build_list_recommended_by_database_request, build_update_request, @@ -64,6 +67,360 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param skip_token: Default value is None. + :type skip_token: str + :param count: Default value is None. + :type count: bool + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_current_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: 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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = 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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "SensitivityLabelUpdateList") + + _request = build_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param skip_token: Default value is None. + :type skip_token: str + :param include_disabled_recommendations: Specifies whether to include disabled recommendations + or not. Default value is None. + :type include_disabled_recommendations: bool + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_recommended_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -109,7 +466,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) _request = build_get_request( @@ -136,7 +493,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -269,7 +630,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) @@ -308,7 +669,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -359,7 +724,7 @@ async def delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -386,7 +751,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -433,7 +802,7 @@ async def disable_recommendation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_disable_recommendation_request( @@ -460,7 +829,11 @@ async def disable_recommendation( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -508,7 +881,7 @@ async def enable_recommendation( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_enable_recommendation_request( @@ -535,246 +908,21 @@ async def enable_recommendation( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_recommended_by_database( + def list_by_database( self, resource_group_name: str, managed_instance_name: str, database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, filter: Optional[str] = None, **kwargs: Any ) -> AsyncItemPaged["_models.SensitivityLabel"]: @@ -787,11 +935,6 @@ def list_recommended_by_database( :type managed_instance_name: str :param database_name: The name of the database. Required. :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool :param filter: An OData filter expression that filters elements in the collection. Default value is None. :type filter: str @@ -802,7 +945,7 @@ def list_recommended_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -816,13 +959,11 @@ def list_recommended_by_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_recommended_by_database_request( + _request = build_list_by_database_request( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, filter=filter, api_version=api_version, headers=_headers, @@ -831,7 +972,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -854,7 +1006,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 f43933da4f0b..b1dad8aab2c6 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -113,7 +114,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -136,7 +148,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -180,7 +196,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) _request = build_get_request( @@ -205,7 +221,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseTable", pipeline_response.http_response) 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 1d39e4640d0d..c0633b7c3fe1 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -59,6 +60,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedTransparentDataEncryption"]: + """Gets a list of managed database's transparent data encryptions. + + :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 database_name: The name of the managed database for which the transparent data + encryption is defined. Required. + :type database_name: str + :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -95,7 +189,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) _request = build_get_request( @@ -119,7 +213,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) @@ -236,7 +334,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) @@ -272,7 +370,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) @@ -280,81 +382,3 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedTransparentDataEncryption"]: - """Gets a list of managed database's transparent data encryptions. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 849bd75e061e..2324b2617e1f 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 @@ -102,7 +102,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -128,7 +128,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -273,7 +277,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -311,7 +315,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -365,7 +373,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -391,7 +399,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 eb79a7054167..2e989517f22a 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,15 +64,39 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def _initiate_scan_initial( + @distributed_trace + def list_by_database( self, resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :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", self._config.api_version)) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -80,50 +105,68 @@ async def _initiate_scan_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def extract_data(pipeline_response): + deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def begin_initiate_scan( + async def get( self, resource_group_name: str, managed_instance_name: str, @@ -131,8 +174,8 @@ async def begin_initiate_scan( vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], scan_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. :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. @@ -146,52 +189,58 @@ async def begin_initiate_scan( :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. :type scan_id: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] + :return: VulnerabilityAssessmentScanRecord or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._initiate_scan_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + _request = build_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace_async async def export( @@ -232,7 +281,7 @@ async def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) _request = build_export_request( @@ -257,7 +306,11 @@ async def export( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) @@ -266,39 +319,15 @@ async def export( return deserialized # type: ignore - @distributed_trace - def list_by_database( + async def _initiate_scan_initial( self, resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, **kwargs: Any - ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", "2020-11-01-preview")) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - + ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -307,53 +336,58 @@ def list_by_database( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_initiate_scan_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - async def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - async def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - return pipeline_response + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - return AsyncItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace_async - async def get( + async def begin_initiate_scan( self, resource_group_name: str, managed_instance_name: str, @@ -361,8 +395,8 @@ async def get( vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], scan_id: str, **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. + ) -> AsyncLROPoller[None]: + """Executes a Vulnerability Assessment database scan. :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. @@ -376,51 +410,49 @@ async def get( :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :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: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + 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._initiate_scan_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](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/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py index 445452a0f57d..d4639db96be0 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -60,6 +61,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessments of a managed database. + + :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 database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -97,7 +191,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -121,7 +215,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -241,7 +339,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -277,7 +375,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -323,7 +425,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -347,85 +449,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessments of a managed database. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 6c6969a11535..7dff44d6aa54 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -42,6 +43,7 @@ build_get_request, build_list_by_instance_request, build_list_inaccessible_by_instance_request, + build_reevaluate_inaccessible_database_state_request, build_start_move_request, build_update_request, ) @@ -89,7 +91,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -114,7 +116,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -137,7 +150,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,7 +188,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -194,7 +211,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_response) @@ -222,7 +243,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -262,12 +283,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -362,7 +391,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -421,7 +450,7 @@ async def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -449,12 +478,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -478,7 +515,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -535,7 +572,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -575,12 +612,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -675,7 +720,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -739,7 +784,7 @@ async def _cancel_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -779,12 +824,20 @@ async def _cancel_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -876,7 +929,7 @@ async def begin_cancel_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -936,7 +989,7 @@ async def _complete_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -976,12 +1029,20 @@ async def _complete_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1073,7 +1134,7 @@ async def begin_complete_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1133,7 +1194,7 @@ async def _complete_restore_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1173,12 +1234,20 @@ async def _complete_restore_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1272,7 +1341,7 @@ async def begin_complete_restore( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1313,6 +1382,128 @@ 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 _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Reevaluates the inaccessibility state of a managed database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns either ManagedDatabase or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _start_move_initial( self, resource_group_name: str, @@ -1332,7 +1523,7 @@ async def _start_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1372,12 +1563,20 @@ async def _start_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1469,7 +1668,7 @@ async def begin_start_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1528,7 +1727,7 @@ def list_inaccessible_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1553,7 +1752,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1576,7 +1786,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 6148bb1709c2..25d026c23cd3 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -170,7 +186,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) _request = build_get_request( @@ -193,7 +209,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_response) @@ -221,7 +241,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -261,12 +281,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -361,7 +389,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -424,7 +452,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -452,12 +480,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -485,7 +521,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 2d6a1321aded..785a17b4e65c 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,7 +187,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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -194,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_response) @@ -222,7 +242,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -262,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -371,7 +399,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 c4fc8eece271..cf76c18ae8e1 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -97,7 +187,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) _request = build_get_request( @@ -120,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_response) @@ -148,7 +242,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -188,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -300,7 +402,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -365,7 +467,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -393,12 +495,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -427,7 +537,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -464,77 +574,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 23d23d9da1f8..06b358136661 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -81,7 +82,7 @@ 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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -106,7 +107,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -129,7 +141,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -163,7 +179,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) _request = build_get_request( @@ -186,7 +202,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceDtc", pipeline_response.http_response) @@ -214,7 +234,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -254,7 +274,11 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -354,7 +378,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 256f0fe3a951..d3a7ea51a2f3 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,124 +65,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - async def _revalidate_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_revalidate( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._revalidate_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -202,7 +85,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -227,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -250,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -289,7 +187,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) _request = build_get_request( @@ -312,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_response) @@ -340,7 +242,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -380,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -486,7 +396,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -530,3 +440,129 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + async def _revalidate_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_revalidate_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_revalidate( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Revalidates an existing encryption protector. + + :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 encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :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", self._config.api_version)) + 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._revalidate_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](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/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py index 809ec1da71c2..34bbf7a3d474 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -85,7 +86,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -111,7 +112,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -134,7 +146,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -168,7 +184,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) _request = build_get_request( @@ -191,7 +207,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceKey", pipeline_response.http_response) @@ -219,7 +239,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -259,12 +279,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -362,7 +390,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -421,7 +449,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -449,12 +477,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -478,7 +514,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 58c66a66f477..53a6c74251d7 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +35,7 @@ from ..._utils.serialization import Deserializer, Serializer from ...operations._managed_instance_long_term_retention_policies_operations import ( build_create_or_update_request, + build_delete_request, build_get_request, build_list_by_database_request, ) @@ -63,6 +65,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -98,7 +192,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -122,7 +216,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) @@ -151,7 +249,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -192,12 +290,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -304,7 +410,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -350,11 +456,81 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: - """Gets a database's long term retention policy. + async def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: + """Deletes a managed database's long term retention policy. :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. @@ -363,66 +539,56 @@ def list_by_database( :type managed_instance_name: str :param database_name: The name of the database. Required. :type database_name: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the - result of cls(response) + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: An instance of AsyncLROPoller that returns either + ManagedInstanceLongTermRetentionPolicy or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + return AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( + 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/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py index 673777bd9743..a0e3383da603 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -78,7 +79,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -103,7 +104,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -126,7 +138,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -160,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) _request = build_get_request( @@ -183,7 +199,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceOperation", pipeline_response.http_response) @@ -220,7 +240,7 @@ async def cancel( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( @@ -243,7 +263,11 @@ async def cancel( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 f856a333e906..be55a258063f 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -92,7 +182,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -115,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstancePrivateEndpointConnection", pipeline_response.http_response) @@ -143,7 +237,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -183,12 +277,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -286,7 +388,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -347,7 +449,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -375,12 +477,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -404,7 +514,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -441,77 +551,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 fa19f3653b48..26ec2f821f1a 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -77,7 +78,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -102,7 +103,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -125,7 +137,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -159,7 +175,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -182,7 +198,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstancePrivateLink", pipeline_response.http_response) 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 f688f03f18fa..33fe51f7d64e 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 @@ -75,7 +75,7 @@ async def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -114,12 +114,20 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -202,7 +210,7 @@ async def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 7ec847c2e061..c019d1e10789 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -60,6 +61,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: + """Gets the managed instance's vulnerability assessment policies. + + :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 for which the vulnerability + assessments is defined. Required. + :type managed_instance_name: str + :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -94,7 +185,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -117,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) @@ -234,7 +329,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -269,7 +364,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) @@ -312,7 +411,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -335,82 +434,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: - """Gets the managed instance's vulnerability assessment policies. - - :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 for which the vulnerability - assessments is defined. Required. - :type managed_instance_name: str - :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 20230ff9a013..344152ade434 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -43,10 +44,12 @@ build_list_by_resource_group_request, build_list_outbound_network_dependencies_by_managed_instance_request, build_list_request, + build_reevaluate_inaccessible_database_state_request, build_refresh_status_request, build_start_request, build_stop_request, build_update_request, + build_validate_azure_key_vault_encryption_key_request, ) from .._configuration import SqlManagementClientConfiguration @@ -55,7 +58,7 @@ List = list -class ManagedInstancesOperations: +class ManagedInstancesOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -87,7 +90,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_ _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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -111,7 +114,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -134,7 +148,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -160,7 +178,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -186,7 +204,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -209,7 +238,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -233,7 +266,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -258,7 +291,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -281,7 +325,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -315,7 +363,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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) _request = build_get_request( @@ -338,7 +386,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstance", pipeline_response.http_response) @@ -365,7 +417,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -404,12 +456,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -495,7 +555,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", self._config.api_version)) 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) @@ -553,7 +613,7 @@ async def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -580,12 +640,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -607,7 +675,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", self._config.api_version)) 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) @@ -662,7 +730,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -701,12 +769,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -792,7 +868,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", self._config.api_version)) 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) @@ -854,7 +930,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -882,12 +958,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -916,7 +1000,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", self._config.api_version)) 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) @@ -974,7 +1058,7 @@ 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", self._config.api_version)) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -999,7 +1083,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1022,12 +1117,129 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + async def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_reevaluate_inaccessible_database_state_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.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Reevaluates the inaccessibility state of all managed databases. + + :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 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", self._config.api_version)) + 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._reevaluate_inaccessible_database_state_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 + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + async def _refresh_status_initial( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: @@ -1042,7 +1254,7 @@ async def _refresh_status_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_status_request( @@ -1069,13 +1281,20 @@ async def _refresh_status_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1099,7 +1318,7 @@ async def begin_refresh_status( _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", self._config.api_version)) 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) @@ -1158,7 +1377,7 @@ 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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( @@ -1185,12 +1404,20 @@ async def _start_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1213,7 +1440,7 @@ async def begin_start( _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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1270,7 +1497,7 @@ 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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( @@ -1297,12 +1524,20 @@ async def _stop_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1325,7 +1560,7 @@ async def begin_stop( _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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1415,7 +1650,7 @@ 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", self._config.api_version)) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1447,7 +1682,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1470,8 +1716,207 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + async def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest") + + _request = build_validate_azure_key_vault_encryption_key_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key 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 None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key parameters. Is either a + ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or IO[bytes] + :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 = 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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._validate_azure_key_vault_encryption_key_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](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/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py index bfd876cac1f6..9852e0695e6a 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -86,7 +87,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -112,7 +113,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -135,7 +147,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -176,7 +192,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) _request = build_get_request( @@ -200,7 +216,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_response) @@ -229,7 +249,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -270,12 +290,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -385,7 +413,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -450,7 +478,7 @@ async def _disable_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_disable_request( @@ -479,12 +507,20 @@ async def _disable_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -517,7 +553,7 @@ async def begin_disable( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploads] = 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/_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 bfd1ae2b3476..1c10ac67031a 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_restorable_dropped_database( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a dropped database's short term retention policy list. + + :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 restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_restorable_dropped_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -99,7 +192,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -123,7 +216,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -152,7 +249,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -193,12 +290,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -305,7 +410,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -371,7 +476,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -412,12 +517,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -524,7 +637,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -569,80 +682,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_restorable_dropped_database( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a dropped database's short term retention policy list. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_restorable_dropped_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 5e14f9bd3fcc..82ccd6f8d893 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -166,7 +182,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_response) @@ -217,7 +237,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -257,12 +277,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -357,7 +385,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -416,7 +444,7 @@ async def _delete_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -444,12 +472,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -473,7 +509,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -530,7 +566,7 @@ async def _acquire_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -570,12 +606,20 @@ async def _acquire_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -670,7 +714,7 @@ async def begin_acquire( _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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 c00a2ad4a7e6..916a2b1bae18 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,12 +64,101 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedServerSecurityAlertPolicy"]: + """Get the managed server's threat detection policies. + + :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], **kwargs: Any ) -> _models.ManagedServerSecurityAlertPolicy: """Get a managed server's threat detection policy. @@ -79,7 +169,8 @@ async def get( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :return: ManagedServerSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -95,7 +186,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -118,7 +209,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_response) @@ -131,7 +226,7 @@ async def _create_or_update_initial( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: @@ -146,7 +241,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -186,12 +281,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -200,7 +303,7 @@ async def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: _models.ManagedServerSecurityAlertPolicy, *, content_type: str = "application/json", @@ -214,7 +317,8 @@ async def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -232,7 +336,7 @@ async def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: IO[bytes], *, content_type: str = "application/json", @@ -246,7 +350,8 @@ async def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -264,7 +369,7 @@ async def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: @@ -276,7 +381,8 @@ async def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Is either a ManagedServerSecurityAlertPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or IO[bytes] @@ -289,7 +395,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -333,77 +439,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedServerSecurityAlertPolicy"]: - """Get the managed server's threat detection policies. - - :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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/_network_security_perimeter_configurations_operations.py similarity index 50% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_communication_links_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_network_security_perimeter_configurations_operations.py index 38bc81958980..ccafa51b9827 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/_network_security_perimeter_configurations_operations.py @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -32,11 +32,10 @@ from ... import models as _models from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_communication_links_operations import ( - build_create_or_update_request, - build_delete_request, +from ...operations._network_security_perimeter_configurations_operations import ( build_get_request, build_list_by_server_request, + build_reconcile_request, ) from .._configuration import SqlManagementClientConfiguration @@ -45,14 +44,14 @@ List = list -class ServerCommunicationLinksOperations: +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_communication_links` attribute. + :attr:`network_security_perimeter_configurations` attribute. """ models = _models @@ -64,23 +63,29 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace_async - async def delete( - self, resource_group_name: str, server_name: str, communication_link_name: str, **kwargs: Any - ) -> None: - """Deletes a server communication link. + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for a server. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :return: None or the result of cls(response) - :rtype: None + :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the + result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] :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", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -89,52 +94,79 @@ async def delete( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - communication_link_name=communication_link_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) - response = pipeline_response.http_response + async def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, None, {}) # type: ignore + 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) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async async def get( - self, resource_group_name: str, server_name: str, communication_link_name: str, **kwargs: Any - ) -> _models.ServerCommunicationLink: - """Returns a server communication link. + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets a network security perimeter configuration. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :return: ServerCommunicationLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerCommunicationLink + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -148,13 +180,13 @@ 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", "2014-04-01")) - cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, + nsp_config_name=nsp_config_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -171,22 +203,21 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ServerCommunicationLink", pipeline_response.http_response) + deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: Union[_models.ServerCommunicationLink, IO[bytes]], - **kwargs: Any + async def _reconcile_initial( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -196,30 +227,18 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = 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, "ServerCommunicationLink") - - _request = build_create_or_update_request( + _request = build_reconcile_request( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, + nsp_config_name=nsp_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -233,126 +252,62 @@ async def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [201, 202]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: _models.ServerCommunicationLink, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. - - :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. Required. - :type parameters: ~azure.mgmt.sql.models.ServerCommunicationLink - :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 ServerCommunicationLink or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. - - :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. 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 ServerCommunicationLink or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: Union[_models.ServerCommunicationLink, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. + async def begin_reconcile( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile network security perimeter configuration for SQL Resource Provider. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. Is either - a ServerCommunicationLink type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerCommunicationLink or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerCommunicationLink or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: An instance of AsyncLROPoller that returns either + NetworkSecurityPerimeterConfiguration or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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( + raw_result = await self._reconcile_initial( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, - parameters=parameters, + nsp_config_name=nsp_config_name, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -362,97 +317,26 @@ async def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerCommunicationLink", pipeline_response.http_response) + deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_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)) + 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.ServerCommunicationLink].from_continuation_token( + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ServerCommunicationLink]( + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerCommunicationLink"]: - """Gets a list of server communication links. - - :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 - :return: An iterator like instance of either ServerCommunicationLink or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerCommunicationLink] - :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", "2014-04-01")) - cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerCommunicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 98111b23f429..89e0f5bed465 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,7 +65,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -86,7 +87,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -109,7 +121,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 de424589cfd5..937430ec97b8 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 @@ -6,8 +6,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +64,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.OutboundFirewallRule"]: + """Gets all outbound firewall rules on a server. + + :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 + :return: An iterator like instance of either OutboundFirewallRule or the result of + cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] + :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", self._config.api_version)) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -92,7 +180,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -115,7 +203,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("OutboundFirewallRule", pipeline_response.http_response) @@ -125,12 +217,7 @@ async def get( return deserialized # type: ignore async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: Union[_models.OutboundFirewallRule, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -140,30 +227,18 @@ async def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = 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, "OutboundFirewallRule") - _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -183,85 +258,26 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: _models.OutboundFirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.OutboundFirewallRule - :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 OutboundFirewallRule or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: 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 OutboundFirewallRule or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: Union[_models.OutboundFirewallRule, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> AsyncLROPoller[_models.OutboundFirewallRule]: """Create a outbound firewall rule with a given name. @@ -272,18 +288,15 @@ async def begin_create_or_update( :type server_name: str :param outbound_rule_fqdn: Required. :type outbound_rule_fqdn: str - :param parameters: Is either a OutboundFirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.OutboundFirewallRule or IO[bytes] :return: An instance of AsyncLROPoller that returns either OutboundFirewallRule or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -293,9 +306,7 @@ async def begin_create_or_update( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, - parameters=parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -341,7 +352,7 @@ async def _delete_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -369,12 +380,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -398,7 +417,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -435,76 +454,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundFirewallRule"]: - """Gets all outbound firewall rules on a server. - - :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 - :return: An iterator like instance of either OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", "2021-02-01-preview")) - cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 9a83237d6c53..a08b31993b9d 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -166,7 +182,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) @@ -217,7 +237,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -257,12 +277,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -356,7 +384,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -415,7 +443,7 @@ async def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -443,12 +471,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -472,7 +508,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 8286d23bf0cd..9bb6ff91f8d9 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -72,7 +73,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -97,7 +98,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -120,7 +132,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -154,7 +170,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) _request = build_get_request( @@ -177,7 +193,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) 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 20df45163564..7421a9b2ead3 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 @@ -149,7 +149,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -184,7 +184,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 323ad74b8373..b6c70c37c611 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -72,7 +73,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -97,7 +98,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -120,7 +132,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -165,7 +181,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -190,7 +206,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RecoverableDatabase", pipeline_response.http_response) 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 c3cb6055a908..b8a88ebd5f87 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -99,7 +100,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -122,7 +134,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -156,7 +172,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -179,7 +195,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RecoverableManagedDatabase", pipeline_response.http_response) 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 79b7e13d604d..7dd6eb83f19b 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -89,7 +90,7 @@ 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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -115,7 +116,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -138,7 +150,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -174,7 +190,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", self._config.api_version)) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -198,7 +214,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ReplicationLink", pipeline_response.http_response) @@ -227,7 +247,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -268,13 +288,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -377,7 +404,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", self._config.api_version)) 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) @@ -437,7 +464,7 @@ async def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -466,12 +493,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -497,7 +532,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", self._config.api_version)) 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) @@ -556,7 +591,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -597,13 +632,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -706,7 +748,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", self._config.api_version)) 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) @@ -766,7 +808,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -795,12 +837,20 @@ async def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -827,7 +877,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", self._config.api_version)) 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) @@ -884,7 +934,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_allow_data_loss_request( @@ -913,12 +963,20 @@ async def _failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -945,7 +1003,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1006,7 +1064,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1031,7 +1089,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1054,7 +1123,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 c1c5b4406c3f..70d11d0b640a 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -99,7 +100,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -122,7 +134,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -167,7 +183,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorableDroppedDatabase", pipeline_response.http_response) 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 9c1548d815af..7f02590e306b 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -77,7 +78,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -102,7 +103,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -125,7 +137,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -159,7 +175,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -182,7 +198,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorableDroppedManagedDatabase", pipeline_response.http_response) 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 9f8b2ee2f785..509944c98807 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -84,7 +85,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -110,7 +111,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -133,7 +145,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -158,7 +174,7 @@ async def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -198,12 +214,20 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -298,7 +322,7 @@ async def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -373,7 +397,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) _request = build_get_request( @@ -397,7 +421,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorePoint", pipeline_response.http_response) @@ -436,7 +464,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -460,7 +488,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 5ff9daa0b4f8..0264c68eea27 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 @@ -1,3 +1,4 @@ +# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -8,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -34,6 +36,7 @@ build_disable_recommendation_request, build_enable_recommendation_request, build_get_request, + build_list_by_database_request, build_list_current_by_database_request, build_list_recommended_by_database_request, build_update_request, @@ -98,7 +101,7 @@ def list_current_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -127,7 +130,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -150,7 +164,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -251,7 +269,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -286,7 +304,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -326,7 +348,7 @@ def list_recommended_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -355,7 +377,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -378,161 +411,16 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async - async def enable_recommendation( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def disable_recommendation( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace_async async def get( self, @@ -578,7 +466,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) _request = build_get_request( @@ -605,7 +493,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -738,7 +630,7 @@ async def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) @@ -777,7 +669,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -828,7 +724,7 @@ async def delete( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -855,7 +751,267 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def disable_recommendation( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :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 schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + sensitivity_label_source=sensitivity_label_source, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def enable_recommendation( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :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 schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_enable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + sensitivity_label_source=sensitivity_label_source, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) 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 3b165eefa14c..f9747ea0cdb9 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,7 +187,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -194,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_response) @@ -222,7 +242,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -262,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -371,7 +399,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 f2c38e2ec2dd..cd88a42beb63 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 @@ -85,7 +85,7 @@ async 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) _request = build_list_by_server_request( @@ -108,7 +108,11 @@ async def list_by_server( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("[Advisor]", pipeline_response.http_response) @@ -145,7 +149,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) _request = build_get_request( @@ -168,7 +172,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) @@ -273,7 +281,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) @@ -308,7 +316,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) 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 8dacd9c56128..7a94f94fca20 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 @@ -77,7 +77,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) _request = build_get_request( @@ -99,7 +99,11 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) @@ -195,7 +199,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) @@ -229,7 +233,11 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) 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 43640999bad8..4541e5366a4b 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerAzureADAdministrator"]: + """Gets a list of Azure Active Directory administrators in a server. + + :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 + :return: An iterator like instance of either ServerAzureADAdministrator or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :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", self._config.api_version)) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AdministratorListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -97,7 +187,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) _request = build_get_request( @@ -120,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_response) @@ -148,7 +242,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -188,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -291,7 +393,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -354,7 +456,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -382,12 +484,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -416,7 +526,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -453,77 +563,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerAzureADAdministrator"]: - """Gets a list of Azure Active Directory administrators in a server. - - :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 - :return: An iterator like instance of either ServerAzureADAdministrator or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", "2020-11-01-preview")) - cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 e5a57a8258ed..f23b5d26cc73 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :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 + :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :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", self._config.api_version)) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -97,7 +187,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) _request = build_get_request( @@ -120,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_response) @@ -148,7 +242,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -188,12 +282,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -300,7 +402,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -363,7 +465,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -391,12 +493,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -425,7 +535,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -462,77 +572,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 - :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", "2020-11-01-preview")) - cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 d7be53ff4673..b2d808691870 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -162,7 +178,7 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -185,7 +201,11 @@ async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) - if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_response) @@ -213,7 +233,7 @@ async def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -253,12 +273,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -345,7 +373,7 @@ async def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 220808483d70..919741680d5a 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -171,7 +187,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) _request = build_get_request( @@ -194,7 +210,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerConfigurationOption", pipeline_response.http_response) @@ -222,7 +242,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -262,7 +282,11 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -368,7 +392,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 23fdebd0a5ca..2f0da0edf488 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,6 +64,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerConnectionPolicy"]: + """Lists connection policy. + + :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 + :return: An iterator like instance of either ServerConnectionPolicy or the result of + cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -95,7 +184,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -118,7 +207,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerConnectionPolicy", pipeline_response.http_response) @@ -146,7 +239,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -186,12 +279,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -286,7 +387,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -330,76 +431,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ServerConnectionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerConnectionPolicy"]: - """Lists connection policy. - - :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 - :return: An iterator like instance of either ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 7f9e1561a427..24e69b564160 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -83,7 +84,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -108,7 +109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -131,7 +143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -169,7 +185,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", self._config.api_version)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) _request = build_get_request( @@ -192,7 +208,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_response) @@ -220,7 +240,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -260,12 +280,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -360,7 +388,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 91c8cec484e0..c233202e3855 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -65,6 +66,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerDnsAlias"]: + """Gets a list of server DNS aliases for a server. + + :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 that the alias is pointing to. Required. + :type server_name: str + :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] + :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", self._config.api_version)) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -93,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) _request = build_get_request( @@ -116,7 +204,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_response) @@ -139,7 +231,7 @@ async def _create_or_update_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_create_or_update_request( @@ -167,12 +259,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -197,7 +297,7 @@ async def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -253,7 +353,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -281,12 +381,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -310,7 +418,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -348,78 +456,6 @@ 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 - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerDnsAlias"]: - """Gets a list of server DNS aliases for a server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - async def _acquire_initial( self, resource_group_name: str, @@ -439,7 +475,7 @@ async def _acquire_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -479,12 +515,20 @@ async def _acquire_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -578,7 +622,7 @@ async def begin_acquire( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 0e1a37bde6af..7418d592a876 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -82,7 +83,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -162,7 +178,7 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) _request = build_get_request( @@ -185,7 +201,11 @@ async def get(self, resource_group_name: str, server_name: str, key_name: str, * if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerKey", pipeline_response.http_response) @@ -213,7 +233,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -253,12 +273,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -362,7 +390,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -421,7 +449,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -449,12 +477,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -478,7 +514,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 ebe1319a818a..dc9744f5950f 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -71,7 +72,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -96,7 +97,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -119,7 +131,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 7160dfcae642..3a5e72df000a 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -63,12 +64,101 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerSecurityAlertPolicy"]: + """Get the server's threat detection policies. + + :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 + :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], **kwargs: Any ) -> _models.ServerSecurityAlertPolicy: """Get a server's security alert policy. @@ -79,7 +169,8 @@ async def get( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :return: ServerSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -95,7 +186,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -118,7 +209,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_response) @@ -131,7 +226,7 @@ async def _create_or_update_initial( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: @@ -146,7 +241,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -186,12 +281,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -200,7 +303,7 @@ async def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: _models.ServerSecurityAlertPolicy, *, content_type: str = "application/json", @@ -214,7 +317,8 @@ async def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -231,7 +335,7 @@ async def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: IO[bytes], *, content_type: str = "application/json", @@ -245,7 +349,8 @@ async def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -262,7 +367,7 @@ async def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: @@ -274,7 +379,8 @@ async def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or IO[bytes] @@ -286,7 +392,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -330,77 +436,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ServerSecurityAlertPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerSecurityAlertPolicy"]: - """Get the server's threat detection policies. - - :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 - :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 d5042a0e8f51..f45b0cf7664f 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -68,8 +69,8 @@ def __init__(self, *args, **kwargs) -> None: def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> AsyncItemPaged["_models.ServerTrustCertificate"]: - """Gets a list of server trust certificates that were uploaded from box to the given Sql Managed - Instance. + """Gets a list of the server trust certificates used to secure communication between SQL Server + and the specified SQL Managed Instance. :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. @@ -84,7 +85,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -109,7 +110,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -132,7 +144,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -142,7 +158,7 @@ async def get_next(next_link=None): async def get( self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> _models.ServerTrustCertificate: - """Gets a server trust certificate that was uploaded from box to Sql Managed Instance. + """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. :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. @@ -166,7 +182,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) _request = build_get_request( @@ -189,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerTrustCertificate", pipeline_response.http_response) @@ -217,7 +237,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -257,12 +277,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -277,7 +305,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -308,7 +336,7 @@ async def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -337,7 +365,7 @@ async def begin_create_or_update( parameters: Union[_models.ServerTrustCertificate, IO[bytes]], **kwargs: Any ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -357,7 +385,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -416,7 +444,7 @@ async def _delete_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -444,12 +472,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -457,7 +493,7 @@ async def _delete_initial( async def begin_delete( self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: - """Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. + """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. :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. @@ -473,7 +509,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 9ce670c6605d..2cf01606f91c 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -65,6 +66,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerTrustGroup"]: + """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :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", self._config.api_version)) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -93,7 +181,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -116,7 +204,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerTrustGroup", pipeline_response.http_response) @@ -144,7 +236,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -184,12 +276,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -284,7 +384,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -343,7 +443,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -371,12 +471,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -400,7 +508,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -438,78 +546,6 @@ 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 - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerTrustGroup"]: - """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -528,7 +564,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -553,7 +589,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -576,7 +623,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 2e66005e2bf0..720193881cc5 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -57,7 +58,7 @@ def __init__(self, *args, **kwargs) -> None: def list_by_server( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> AsyncItemPaged["_models.ServerUsage"]: - """Returns server usages. + """Gets server usages. :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. @@ -71,7 +72,7 @@ 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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -96,7 +97,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -106,7 +118,7 @@ async def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -119,7 +131,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 cc77298d2b23..6b2e726db273 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -60,6 +61,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a server. + + :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 + :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -94,7 +184,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -117,7 +207,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) @@ -234,7 +328,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -269,7 +363,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) @@ -312,7 +410,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -335,81 +433,11 @@ async def delete( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a server. - - :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 - :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 9d882620819f..d8c48c4e5f7d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -126,7 +127,7 @@ async def check_name_availability( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) @@ -158,7 +159,10 @@ async def check_name_availability( 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response.http_response) @@ -181,7 +185,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -205,7 +209,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -228,7 +243,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -253,7 +271,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -278,7 +296,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -301,7 +330,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -336,7 +368,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) _request = build_get_request( @@ -359,7 +391,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Server", pipeline_response.http_response) @@ -383,7 +418,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -422,7 +457,10 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -514,7 +552,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -570,7 +608,7 @@ async def _delete_initial(self, resource_group_name: str, server_name: str, **kw _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -597,7 +635,10 @@ async def _delete_initial(self, resource_group_name: str, server_name: str, **kw except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -627,7 +668,7 @@ async def begin_delete(self, resource_group_name: str, server_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -682,7 +723,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -721,7 +762,10 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -817,7 +861,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -879,7 +923,7 @@ async def _import_database_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -918,7 +962,10 @@ async def _import_database_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1014,7 +1061,7 @@ async def begin_import_database( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1072,7 +1119,7 @@ async def _refresh_status_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_status_request( @@ -1099,7 +1146,10 @@ async def _refresh_status_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1133,7 +1183,7 @@ async def begin_refresh_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py index 080d0abc42eb..f82c52885509 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 @@ -79,7 +79,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -101,7 +101,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) @@ -196,7 +200,7 @@ async def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) @@ -230,7 +234,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) 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 0bf4f77131ff..bd375ae6375a 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -87,7 +88,7 @@ def list_by_sql_vulnerability_assessment( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -114,7 +115,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -139,7 +151,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -184,7 +200,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) _request = build_get_request( @@ -209,7 +225,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 32fc47a66730..2b66d42ff890 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 @@ -166,7 +166,7 @@ async def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) @@ -203,7 +203,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 c41a29b6a007..8be3bf13e420 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 @@ -77,7 +77,7 @@ async def _execute_initial( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_execute_request( @@ -106,12 +106,20 @@ async def _execute_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -143,7 +151,7 @@ async def begin_execute( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 dbac66dd7252..237773960c33 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -92,7 +93,7 @@ def list_by_baseline( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +121,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -145,7 +157,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -193,7 +209,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -219,7 +235,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -351,7 +371,7 @@ async def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -389,7 +409,11 @@ async def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response 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 de384381ca92..85a0033bfc3c 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 @@ -94,7 +94,7 @@ async def delete( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -120,7 +120,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 68bf49112f30..244d37864704 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -92,7 +93,7 @@ def list_by_scan( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -120,7 +121,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -143,7 +155,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -193,7 +209,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) _request = build_get_request( @@ -219,7 +235,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) 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 37c10aea5fb5..0c47ac926430 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -87,7 +88,7 @@ def list_by_sql_vulnerability_assessments( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -114,7 +115,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -137,7 +149,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -182,7 +198,7 @@ async def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -207,7 +223,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) 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 f7b827e0b94d..ae72c57967c7 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 @@ -85,7 +85,7 @@ async def 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -108,7 +108,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 fc57b748316c..29221ecf790d 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -79,7 +80,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -104,7 +105,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -127,7 +139,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -167,7 +183,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -190,7 +206,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) @@ -298,7 +318,7 @@ async def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -333,7 +353,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) 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 3010f8adf613..7e967fd254ae 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -80,7 +81,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -105,7 +106,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -128,7 +140,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -167,7 +183,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) _request = build_get_request( @@ -190,7 +206,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) @@ -298,7 +318,7 @@ async def 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) @@ -333,7 +353,11 @@ async def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) @@ -375,7 +399,7 @@ async def 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -398,7 +422,11 @@ async def delete( if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 044b11e21400..a555b8171da2 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -67,7 +68,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged[ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -91,7 +92,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -114,7 +126,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -143,7 +159,7 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) _request = build_get_request( @@ -165,7 +181,11 @@ async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _mode if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SubscriptionUsage", pipeline_response.http_response) 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 55e3dda45ebc..ea9021bd1de1 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -100,7 +101,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -123,7 +135,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 47b63fcffc3c..92a35b6971a6 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -66,6 +67,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncAgent"]: + """Lists sync agents in a server. + + :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 on which the sync agent is hosted. Required. + :type server_name: str + :return: An iterator like instance of either SyncAgent or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgent] + :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", self._config.api_version)) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SyncAgentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -94,7 +182,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) _request = build_get_request( @@ -117,7 +205,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncAgent", pipeline_response.http_response) @@ -145,7 +237,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -185,12 +277,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -285,7 +385,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -344,7 +444,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -372,12 +472,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -401,7 +509,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -439,78 +547,6 @@ 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 - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncAgent"]: - """Lists sync agents in a server. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :return: An iterator like instance of either SyncAgent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgent] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - @distributed_trace_async async def generate_key( self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -539,7 +575,7 @@ async def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) _request = build_generate_key_request( @@ -562,7 +598,11 @@ async def generate_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncAgentKeyProperties", pipeline_response.http_response) @@ -592,7 +632,7 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -618,7 +658,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -641,7 +692,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 b174069b8b45..d190eec21c19 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -89,7 +90,7 @@ def list_sync_database_ids( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -113,7 +114,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -136,219 +148,21 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _refresh_hub_schema_initial( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_hub_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh_hub_schema( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes a hub database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._refresh_hub_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_hub_schemas( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a collection of hub database schemas. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_hub_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace - def list_logs( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SyncGroupLogProperties"]: - """Gets a collection of sync group logs. + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncGroup"]: + """Lists sync groups under a hub database. :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. @@ -357,28 +171,15 @@ def list_logs( :type server_name: str :param database_name: The name of the database on which the sync group is hosted. Required. :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param start_time: Get logs generated after this time. Required. - :type start_time: str - :param end_time: Get logs generated before this time. Required. - :type end_time: str - :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and - "Success". Required. - :type type: str or ~azure.mgmt.sql.models.SyncGroupsType - :param continuation_token_parameter: The continuation token for this operation. Default value - is None. - :type continuation_token_parameter: str - :return: An iterator like instance of either SyncGroupLogProperties or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :return: An iterator like instance of either SyncGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroup] :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -391,16 +192,11 @@ def list_logs( def prepare_request(next_link=None): if not next_link: - _request = build_list_logs_request( + _request = build_list_by_database_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, - sync_group_name=sync_group_name, subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - type=type, - continuation_token_parameter=continuation_token_parameter, api_version=api_version, headers=_headers, params=_params, @@ -408,13 +204,24 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) + deserialized = self._deserialize("SyncGroupListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -431,17 +238,21 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def cancel_sync( + async def get( self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Cancels a sync group synchronization. + ) -> _models.SyncGroup: + """Gets a sync 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. @@ -452,8 +263,8 @@ async def cancel_sync( :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None + :return: SyncGroup or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.SyncGroup :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -467,10 +278,10 @@ async def cancel_sync( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - _request = build_cancel_sync_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -491,130 +302,16 @@ async def cancel_sync( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("SyncGroup", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def trigger_sync( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Triggers a sync group synchronization. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_trigger_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> _models.SyncGroup: - """Gets a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SyncGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore @@ -638,7 +335,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -679,12 +376,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -788,7 +493,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -848,7 +553,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -877,12 +582,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -908,7 +621,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -967,7 +680,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -1008,12 +721,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1117,7 +838,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -1163,11 +884,74 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + @distributed_trace_async + async def cancel_sync( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Cancels a sync group synchronization. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_cancel_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncGroup"]: - """Lists sync groups under a hub database. + def list_hub_schemas( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a collection of hub database schemas. :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. @@ -1176,15 +960,19 @@ def list_by_database( :type server_name: str :param database_name: The name of the database on which the sync group is hosted. Required. :type database_name: str - :return: An iterator like instance of either SyncGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroup] + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of either SyncFullSchemaProperties or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1197,10 +985,11 @@ def list_by_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_database_request( + _request = build_list_hub_schemas_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + sync_group_name=sync_group_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -1209,13 +998,24 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupListResult", pipeline_response) + deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1232,8 +1032,313 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_logs( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SyncGroupLogProperties"]: + """Gets a collection of sync group logs. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param start_time: Get logs generated after this time. Required. + :type start_time: str + :param end_time: Get logs generated before this time. Required. + :type end_time: str + :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and + "Success". Required. + :type type: str or ~azure.mgmt.sql.models.SyncGroupsType + :param continuation_token_parameter: The continuation token for this operation. Default value + is None. + :type continuation_token_parameter: str + :return: An iterator like instance of either SyncGroupLogProperties or the result of + cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :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", self._config.api_version)) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_logs_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + type=type, + continuation_token_parameter=continuation_token_parameter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _refresh_hub_schema_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_refresh_hub_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_refresh_hub_schema( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Refreshes a hub database schema. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :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", self._config.api_version)) + 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._refresh_hub_schema_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace_async + async def trigger_sync( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Triggers a sync group synchronization. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_trigger_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 42dd0f0f0c23..6de7f2f52303 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -68,6 +69,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_sync_group( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncMember"]: + """Lists sync members in the given sync 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 server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of either SyncMember or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncMember] + :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", self._config.api_version)) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_sync_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SyncMemberListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -107,7 +201,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) _request = build_get_request( @@ -132,7 +226,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncMember", pipeline_response.http_response) @@ -162,7 +260,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -204,12 +302,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -325,7 +431,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -392,7 +498,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -422,12 +528,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -462,7 +576,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -523,7 +637,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -565,12 +679,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -686,7 +808,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -733,174 +855,6 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_sync_group( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncMember"]: - """Lists sync members in the given sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncMember or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncMember] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sync_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncMemberListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_member_schemas( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_member_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - async def _refresh_member_schema_initial( self, resource_group_name: str, @@ -921,7 +875,7 @@ async def _refresh_member_schema_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_member_schema_request( @@ -951,12 +905,20 @@ async def _refresh_member_schema_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -991,7 +953,7 @@ async def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1030,3 +992,108 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_member_schemas( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a sync member database schema. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group on which the sync member is hosted. + Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An iterator like instance of either SyncFullSchemaProperties or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :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", self._config.api_version)) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_member_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) 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 48ff54c5e5b9..1eb0745635d9 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 @@ -75,7 +75,7 @@ async def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -114,12 +114,20 @@ async def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -202,7 +210,7 @@ async def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) 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 fb2bc11fcabb..de604ced2993 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -67,7 +68,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged[ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -91,7 +92,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -114,7 +126,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -143,7 +159,7 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) _request = build_get_request( @@ -165,7 +181,11 @@ async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _mo if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("TimeZone", pipeline_response.http_response) 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 e85f7b9d4fbf..0eedb328ec41 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -36,6 +37,8 @@ build_create_or_update_request, build_get_request, build_list_by_database_request, + build_resume_request, + build_suspend_request, ) from .._configuration import SqlManagementClientConfiguration @@ -86,7 +89,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -112,7 +115,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -135,7 +149,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -177,7 +195,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) _request = build_get_request( @@ -201,7 +219,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryption", pipeline_response.http_response) @@ -230,7 +252,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -271,12 +293,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -386,7 +416,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -436,3 +466,283 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + async def _resume_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_resume( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Resume ongoing logical database's Transparent Data Encryption scan configuration. + + :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 logical database for which the Transparent Data + Encryption is defined. Required. + :type database_name: str + :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of AsyncLROPoller that returns either + LogicalDatabaseTransparentDataEncryption or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _suspend_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_suspend_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_suspend( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Suspend ongoing logical database's Transparent Data Encryption scan configuration. + + :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 logical database for which the Transparent Data + Encryption is defined. Required. + :type database_name: str + :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of AsyncLROPoller that returns either + LogicalDatabaseTransparentDataEncryption or the result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + 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/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py index 04e09943b289..029b220cc2a8 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -74,7 +75,7 @@ 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -100,7 +101,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -123,7 +135,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 10d19bec2dde..02c27ea09ea1 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -33,6 +34,7 @@ from ... import models as _models from ..._utils.serialization import Deserializer, Serializer from ...operations._virtual_clusters_operations import ( + build_create_or_update_request, build_delete_request, build_get_request, build_list_by_resource_group_request, @@ -77,7 +79,7 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.VirtualCluster"]: _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -100,7 +102,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -123,7 +136,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -145,7 +162,7 @@ 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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -169,7 +186,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -192,7 +220,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -222,7 +254,7 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -244,7 +276,11 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualCluster", pipeline_response.http_response) @@ -253,6 +289,206 @@ async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwarg return deserialized # type: ignore + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster + :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 VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is either a VirtualCluster + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster or IO[bytes] + :return: An instance of AsyncLROPoller that returns either VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + async def _delete_initial( self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: @@ -267,7 +503,7 @@ async def _delete_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -294,12 +530,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -321,7 +565,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -376,7 +620,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -415,12 +659,20 @@ async def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -506,7 +758,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -564,7 +816,7 @@ async def _update_dns_servers_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_update_dns_servers_request( @@ -591,12 +843,20 @@ async def _update_dns_servers_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -621,7 +881,7 @@ async def begin_update_dns_servers( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py index 146d69ad7b5c..33014a11d7ce 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.VirtualNetworkRule"]: + """Gets a list of virtual network rules in a server. + + :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 + :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] + :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", self._config.api_version)) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -92,7 +180,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -115,7 +203,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualNetworkRule", pipeline_response.http_response) @@ -143,7 +235,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -183,12 +275,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -283,7 +383,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -342,7 +442,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -370,12 +470,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -399,7 +507,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -436,75 +544,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.VirtualNetworkRule"]: - """Gets a list of virtual network rules in a server. - - :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 - :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", "2020-11-01-preview")) - cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 7a32cff5ccfc..d325230fa315 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,100 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_workload_group( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.WorkloadClassifier"]: + """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the + classifiers from. Required. + :type workload_group_name: str + :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] + :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", self._config.api_version)) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_workload_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, @@ -103,7 +198,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) _request = build_get_request( @@ -128,7 +223,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadClassifier", pipeline_response.http_response) @@ -158,7 +257,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -200,12 +299,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -324,7 +431,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -391,7 +498,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -421,12 +528,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -461,7 +576,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -500,82 +615,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_workload_group( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.WorkloadClassifier"]: - """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the - classifiers from. Required. - :type workload_group_name: str - :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] - :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", "2020-11-01-preview")) - cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_workload_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 79c54c9236b0..000f5f09074c 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 @@ -8,6 +8,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import AsyncPipelineClient from azure.core.async_paging import AsyncItemPaged, AsyncList @@ -64,6 +65,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.WorkloadGroup"]: + """Gets the list of workload groups. + + :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 + :return: An iterator like instance of either WorkloadGroup or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadGroup] + :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", self._config.api_version)) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + @distributed_trace_async async def get( self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -94,7 +185,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -118,7 +209,11 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadGroup", pipeline_response.http_response) @@ -147,7 +242,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) @@ -188,12 +283,20 @@ async def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -297,7 +400,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) @@ -357,7 +460,7 @@ async def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -386,12 +489,20 @@ async def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -417,7 +528,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -455,78 +566,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.WorkloadGroup"]: - """Gets the list of workload groups. - - :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 - :return: An iterator like instance of either WorkloadGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadGroup] - :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", "2020-11-01-preview")) - cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 dd7ea514048c..a70ba9ec1923 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 @@ -82,10 +82,6 @@ DistributedAvailabilityGroupsListResult, EditionCapability, ElasticPool, - ElasticPoolActivity, - ElasticPoolActivityListResult, - ElasticPoolDatabaseActivity, - ElasticPoolDatabaseActivityListResult, ElasticPoolEditionCapability, ElasticPoolListResult, ElasticPoolOperation, @@ -117,6 +113,7 @@ FirewallRule, FirewallRuleList, FirewallRuleListResult, + FreeLimitExhaustionBehaviorCapability, GeoBackupPolicy, GeoBackupPolicyListResult, IPv6FirewallRule, @@ -134,12 +131,19 @@ InstancePoolEditionCapability, InstancePoolFamilyCapability, InstancePoolListResult, + InstancePoolOperation, + InstancePoolOperationListResult, InstancePoolUpdate, InstancePoolVcoresCapability, Job, JobAgent, + JobAgentEditionCapability, + JobAgentIdentity, JobAgentListResult, + JobAgentServiceLevelObjectiveCapability, JobAgentUpdate, + JobAgentUserAssignedIdentity, + JobAgentVersionCapability, JobCredential, JobCredentialListResult, JobExecution, @@ -182,6 +186,7 @@ ManagedDatabase, ManagedDatabaseAdvancedThreatProtection, ManagedDatabaseAdvancedThreatProtectionListResult, + ManagedDatabaseExtendedAccessibilityInfo, ManagedDatabaseListResult, ManagedDatabaseMoveDefinition, ManagedDatabaseMoveOperationListResult, @@ -234,6 +239,7 @@ ManagedInstanceQuery, ManagedInstanceQueryStatistics, ManagedInstanceUpdate, + ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, ManagedInstanceVcoresCapability, ManagedInstanceVersionCapability, ManagedInstanceVulnerabilityAssessment, @@ -248,21 +254,25 @@ ManagedServerSecurityAlertPolicyListResult, ManagedTransparentDataEncryption, ManagedTransparentDataEncryptionListResult, + MaxLimitRangeCapability, MaxSizeCapability, MaxSizeRangeCapability, - Metric, - MetricAvailability, - MetricDefinition, - MetricDefinitionListResult, - MetricListResult, - MetricName, - MetricValue, MinCapacityCapability, + NSPConfigAccessRule, + NSPConfigAccessRuleProperties, + NSPConfigAssociation, + NSPConfigNetworkSecurityPerimeterRule, + NSPConfigPerimeter, + NSPConfigProfile, + NSPProvisioningIssue, + NSPProvisioningIssueProperties, Name, NetworkIsolationSettings, + NetworkIsolationSettingsAutoGenerated, + NetworkSecurityPerimeterConfiguration, + NetworkSecurityPerimeterConfigurationListResult, Operation, OperationDisplay, - OperationImpact, OperationListResult, OutboundEnvironmentEndpoint, OutboundEnvironmentEndpointCollection, @@ -270,6 +280,7 @@ OutboundFirewallRuleListResult, PartnerInfo, PartnerRegionInfo, + PerDatabaseAutoPauseDelayTimeRange, PerformanceLevelCapability, PhaseDetails, PrivateEndpointConnection, @@ -285,12 +296,12 @@ ProxyResourceWithWritableName, QueryCheck, QueryMetricInterval, - QueryMetricIntervalAutoGenerated, QueryMetricProperties, QueryStatistics, QueryStatisticsProperties, ReadScaleCapability, RecommendedAction, + RecommendedActionAutoGenerated, RecommendedActionErrorInfo, RecommendedActionImpactRecord, RecommendedActionImplementationInfo, @@ -335,8 +346,6 @@ ServerAzureADOnlyAuthentication, ServerBlobAuditingPolicy, ServerBlobAuditingPolicyListResult, - ServerCommunicationLink, - ServerCommunicationLinkListResult, ServerConfigurationOption, ServerConfigurationOptionListResult, ServerConnectionPolicy, @@ -365,12 +374,9 @@ ServerVersionCapability, ServerVulnerabilityAssessment, ServerVulnerabilityAssessmentListResult, - ServiceObjective, ServiceObjectiveCapability, - ServiceObjectiveListResult, ServicePrincipal, Sku, - SloUsageMetric, SqlAgentConfiguration, SqlVulnerabilityAssessment, SqlVulnerabilityAssessmentListResult, @@ -416,7 +422,7 @@ UpdateLongTermRetentionBackupParameters, UpdateVirtualClusterDnsServersOperation, UpsertManagedServerOperationParameters, - UpsertManagedServerOperationStep, + UpsertManagedServerOperationStepWithEstimatesAndDuration, Usage, UsageListResult, UserIdentity, @@ -434,6 +440,7 @@ WorkloadClassifierListResult, WorkloadGroup, WorkloadGroupListResult, + ZonePinningCapability, ) from ._sql_management_client_enums import ( # type: ignore @@ -463,12 +470,14 @@ CapabilityStatus, CatalogCollationType, CheckNameAvailabilityReason, + ClientClassificationSource, ColumnDataType, ConnectionPolicyName, CreateMode, CreatedByType, DNSRefreshOperationStatus, DataMaskingFunction, + DataMaskingPolicyName, DataMaskingRuleState, DataMaskingState, DataWarehouseUserActivityName, @@ -485,23 +494,25 @@ ElasticPoolLicenseType, ElasticPoolState, EncryptionProtectorName, + ErrorType, ExternalGovernanceStatus, FailoverGroupDatabasesSecondaryType, FailoverGroupReplicationRole, FailoverModeType, FailoverType, FreeLimitExhaustionBehavior, - FreemiumType, GeoBackupPolicyName, GeoBackupPolicyState, HybridSecondaryUsage, HybridSecondaryUsageDetected, IdentityType, ImplementationMethod, + InaccessibilityReason, InstanceFailoverGroupReplicationRole, InstancePoolLicenseType, InstanceRole, IsRetryable, + JobAgentIdentityType, JobAgentState, JobExecutionLifecycle, JobScheduleType, @@ -536,7 +547,7 @@ PauseDelayTimeUnit, PerformanceLevelUnit, Phase, - PrimaryAggregationType, + PricingModel, PrincipalType, PrivateEndpointProvisioningState, PrivateLinkServiceConnectionStateActionsRequire, @@ -566,6 +577,7 @@ SecondaryInstanceType, SecondaryType, SecurityAlertPolicyName, + SecurityAlertPolicyNameAutoGenerated, SecurityAlertPolicyState, SecurityAlertsPolicyState, SecurityEventType, @@ -581,7 +593,6 @@ ServerPublicNetworkAccessFlag, ServerTrustGroupPropertiesTrustScopesItem, ServerWorkspaceFeature, - ServiceObjectiveName, ServicePrincipalType, SetLegalHoldImmutability, ShortTermRetentionPolicyName, @@ -603,10 +614,9 @@ TimeBasedImmutability, TimeBasedImmutabilityMode, TransparentDataEncryptionName, + TransparentDataEncryptionScanState, TransparentDataEncryptionState, - UnitDefinitionType, - UnitType, - UpsertManagedServerOperationStepStatus, + UpsertManagedServerOperationStepWithEstimatesAndDurationStatus, VirtualNetworkRuleState, VulnerabilityAssessmentName, VulnerabilityAssessmentPolicyBaselineName, @@ -685,10 +695,6 @@ "DistributedAvailabilityGroupsListResult", "EditionCapability", "ElasticPool", - "ElasticPoolActivity", - "ElasticPoolActivityListResult", - "ElasticPoolDatabaseActivity", - "ElasticPoolDatabaseActivityListResult", "ElasticPoolEditionCapability", "ElasticPoolListResult", "ElasticPoolOperation", @@ -720,6 +726,7 @@ "FirewallRule", "FirewallRuleList", "FirewallRuleListResult", + "FreeLimitExhaustionBehaviorCapability", "GeoBackupPolicy", "GeoBackupPolicyListResult", "IPv6FirewallRule", @@ -737,12 +744,19 @@ "InstancePoolEditionCapability", "InstancePoolFamilyCapability", "InstancePoolListResult", + "InstancePoolOperation", + "InstancePoolOperationListResult", "InstancePoolUpdate", "InstancePoolVcoresCapability", "Job", "JobAgent", + "JobAgentEditionCapability", + "JobAgentIdentity", "JobAgentListResult", + "JobAgentServiceLevelObjectiveCapability", "JobAgentUpdate", + "JobAgentUserAssignedIdentity", + "JobAgentVersionCapability", "JobCredential", "JobCredentialListResult", "JobExecution", @@ -785,6 +799,7 @@ "ManagedDatabase", "ManagedDatabaseAdvancedThreatProtection", "ManagedDatabaseAdvancedThreatProtectionListResult", + "ManagedDatabaseExtendedAccessibilityInfo", "ManagedDatabaseListResult", "ManagedDatabaseMoveDefinition", "ManagedDatabaseMoveOperationListResult", @@ -837,6 +852,7 @@ "ManagedInstanceQuery", "ManagedInstanceQueryStatistics", "ManagedInstanceUpdate", + "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", "ManagedInstanceVcoresCapability", "ManagedInstanceVersionCapability", "ManagedInstanceVulnerabilityAssessment", @@ -851,21 +867,25 @@ "ManagedServerSecurityAlertPolicyListResult", "ManagedTransparentDataEncryption", "ManagedTransparentDataEncryptionListResult", + "MaxLimitRangeCapability", "MaxSizeCapability", "MaxSizeRangeCapability", - "Metric", - "MetricAvailability", - "MetricDefinition", - "MetricDefinitionListResult", - "MetricListResult", - "MetricName", - "MetricValue", "MinCapacityCapability", + "NSPConfigAccessRule", + "NSPConfigAccessRuleProperties", + "NSPConfigAssociation", + "NSPConfigNetworkSecurityPerimeterRule", + "NSPConfigPerimeter", + "NSPConfigProfile", + "NSPProvisioningIssue", + "NSPProvisioningIssueProperties", "Name", "NetworkIsolationSettings", + "NetworkIsolationSettingsAutoGenerated", + "NetworkSecurityPerimeterConfiguration", + "NetworkSecurityPerimeterConfigurationListResult", "Operation", "OperationDisplay", - "OperationImpact", "OperationListResult", "OutboundEnvironmentEndpoint", "OutboundEnvironmentEndpointCollection", @@ -873,6 +893,7 @@ "OutboundFirewallRuleListResult", "PartnerInfo", "PartnerRegionInfo", + "PerDatabaseAutoPauseDelayTimeRange", "PerformanceLevelCapability", "PhaseDetails", "PrivateEndpointConnection", @@ -888,12 +909,12 @@ "ProxyResourceWithWritableName", "QueryCheck", "QueryMetricInterval", - "QueryMetricIntervalAutoGenerated", "QueryMetricProperties", "QueryStatistics", "QueryStatisticsProperties", "ReadScaleCapability", "RecommendedAction", + "RecommendedActionAutoGenerated", "RecommendedActionErrorInfo", "RecommendedActionImpactRecord", "RecommendedActionImplementationInfo", @@ -938,8 +959,6 @@ "ServerAzureADOnlyAuthentication", "ServerBlobAuditingPolicy", "ServerBlobAuditingPolicyListResult", - "ServerCommunicationLink", - "ServerCommunicationLinkListResult", "ServerConfigurationOption", "ServerConfigurationOptionListResult", "ServerConnectionPolicy", @@ -968,12 +987,9 @@ "ServerVersionCapability", "ServerVulnerabilityAssessment", "ServerVulnerabilityAssessmentListResult", - "ServiceObjective", "ServiceObjectiveCapability", - "ServiceObjectiveListResult", "ServicePrincipal", "Sku", - "SloUsageMetric", "SqlAgentConfiguration", "SqlVulnerabilityAssessment", "SqlVulnerabilityAssessmentListResult", @@ -1019,7 +1035,7 @@ "UpdateLongTermRetentionBackupParameters", "UpdateVirtualClusterDnsServersOperation", "UpsertManagedServerOperationParameters", - "UpsertManagedServerOperationStep", + "UpsertManagedServerOperationStepWithEstimatesAndDuration", "Usage", "UsageListResult", "UserIdentity", @@ -1037,6 +1053,7 @@ "WorkloadClassifierListResult", "WorkloadGroup", "WorkloadGroupListResult", + "ZonePinningCapability", "AdministratorName", "AdministratorType", "AdvancedThreatProtectionName", @@ -1063,12 +1080,14 @@ "CapabilityStatus", "CatalogCollationType", "CheckNameAvailabilityReason", + "ClientClassificationSource", "ColumnDataType", "ConnectionPolicyName", "CreateMode", "CreatedByType", "DNSRefreshOperationStatus", "DataMaskingFunction", + "DataMaskingPolicyName", "DataMaskingRuleState", "DataMaskingState", "DataWarehouseUserActivityName", @@ -1085,23 +1104,25 @@ "ElasticPoolLicenseType", "ElasticPoolState", "EncryptionProtectorName", + "ErrorType", "ExternalGovernanceStatus", "FailoverGroupDatabasesSecondaryType", "FailoverGroupReplicationRole", "FailoverModeType", "FailoverType", "FreeLimitExhaustionBehavior", - "FreemiumType", "GeoBackupPolicyName", "GeoBackupPolicyState", "HybridSecondaryUsage", "HybridSecondaryUsageDetected", "IdentityType", "ImplementationMethod", + "InaccessibilityReason", "InstanceFailoverGroupReplicationRole", "InstancePoolLicenseType", "InstanceRole", "IsRetryable", + "JobAgentIdentityType", "JobAgentState", "JobExecutionLifecycle", "JobScheduleType", @@ -1136,7 +1157,7 @@ "PauseDelayTimeUnit", "PerformanceLevelUnit", "Phase", - "PrimaryAggregationType", + "PricingModel", "PrincipalType", "PrivateEndpointProvisioningState", "PrivateLinkServiceConnectionStateActionsRequire", @@ -1166,6 +1187,7 @@ "SecondaryInstanceType", "SecondaryType", "SecurityAlertPolicyName", + "SecurityAlertPolicyNameAutoGenerated", "SecurityAlertPolicyState", "SecurityAlertsPolicyState", "SecurityEventType", @@ -1181,7 +1203,6 @@ "ServerPublicNetworkAccessFlag", "ServerTrustGroupPropertiesTrustScopesItem", "ServerWorkspaceFeature", - "ServiceObjectiveName", "ServicePrincipalType", "SetLegalHoldImmutability", "ShortTermRetentionPolicyName", @@ -1203,10 +1224,9 @@ "TimeBasedImmutability", "TimeBasedImmutabilityMode", "TransparentDataEncryptionName", + "TransparentDataEncryptionScanState", "TransparentDataEncryptionState", - "UnitDefinitionType", - "UnitType", - "UpsertManagedServerOperationStepStatus", + "UpsertManagedServerOperationStepWithEstimatesAndDurationStatus", "VirtualNetworkRuleState", "VulnerabilityAssessmentName", "VulnerabilityAssessmentPolicyBaselineName", 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 57e0a2a0f2ab..febaf8120837 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 @@ -976,8 +976,8 @@ class Database(TrackedResource): values are: "Enabled" and "Disabled". :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar high_availability_replica_count: The number of secondary replicas associated with the - database that are used to provide high availability. Not applicable to a Hyperscale database - within an elastic pool. + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. :vartype high_availability_replica_count: int :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". @@ -1320,8 +1320,8 @@ def __init__( # pylint: disable=too-many-locals pool. Known values are: "Enabled" and "Disabled". :paramtype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :keyword high_availability_replica_count: The number of secondary replicas associated with the - database that are used to provide high availability. Not applicable to a Hyperscale database - within an elastic pool. + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. :paramtype high_availability_replica_count: int :keyword secondary_type: The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". @@ -1724,8 +1724,8 @@ class DatabaseBlobAuditingPolicy(ProxyResource): or `Diagnostic Settings PowerShell `_. :vartype is_azure_monitor_target_enabled: bool :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. :vartype queue_delay_ms: int :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -1891,8 +1891,8 @@ def __init__( or `Diagnostic Settings PowerShell `_. :paramtype is_azure_monitor_target_enabled: bool :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + audit actions are forced to be processed. The default minimum value is 1000 (1 second). The + maximum is 2,147,483,647. :paramtype queue_delay_ms: int :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -1978,7 +1978,7 @@ class DatabaseColumn(ProxyResource): "date", "time", "datetime2", "datetimeoffset", "tinyint", "smallint", "int", "smalldatetime", "real", "money", "datetime", "float", "sql_variant", "ntext", "bit", "decimal", "numeric", "smallmoney", "bigint", "hierarchyid", "geometry", "geography", "varbinary", "varchar", - "binary", "char", "timestamp", "nvarchar", "nchar", "xml", "sysname", and "int". + "binary", "char", "timestamp", "nvarchar", "nchar", "xml", and "sysname". :vartype column_type: str or ~azure.mgmt.sql.models.ColumnDataType :ivar temporal_type: The table temporal type. Known values are: "NonTemporalTable", "HistoryTable", and "SystemVersionedTemporalTable". @@ -2019,8 +2019,8 @@ def __init__( "uniqueidentifier", "date", "time", "datetime2", "datetimeoffset", "tinyint", "smallint", "int", "smalldatetime", "real", "money", "datetime", "float", "sql_variant", "ntext", "bit", "decimal", "numeric", "smallmoney", "bigint", "hierarchyid", "geometry", "geography", - "varbinary", "varchar", "binary", "char", "timestamp", "nvarchar", "nchar", "xml", "sysname", - and "int". + "varbinary", "varchar", "binary", "char", "timestamp", "nvarchar", "nchar", "xml", and + "sysname". :paramtype column_type: str or ~azure.mgmt.sql.models.ColumnDataType :keyword temporal_type: The table temporal type. Known values are: "NonTemporalTable", "HistoryTable", and "SystemVersionedTemporalTable". @@ -2066,7 +2066,7 @@ def __init__(self, **kwargs: Any) -> None: class DatabaseExtensions(ProxyResource): - """An export managed database operation result resource. + """An Import, Export, or PolybaseImport resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -2076,15 +2076,37 @@ class DatabaseExtensions(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar operation_mode: Operation Mode. "PolybaseImport" + :ivar operation_mode: Operation mode of the operation: Import, Export, or PolybaseImport. Known + values are: "PolybaseImport", "Import", and "Export". :vartype operation_mode: str or ~azure.mgmt.sql.models.OperationMode - :ivar storage_key_type: Storage key type. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity. + Known values are: "SharedAccessKey", "StorageAccessKey", and "ManagedIdentity". :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key. + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. :vartype storage_key: str - :ivar storage_uri: Storage Uri. + :ivar storage_uri: Storage Uri for the storage account. :vartype storage_uri: str + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. + :vartype administrator_login: str + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :vartype administrator_login_password: str + :ivar authentication_type: Authentication type used to access the SQL: Sql, ADPassword or + ManagedIdentity. + :vartype authentication_type: str + :ivar database_edition: Database edition for the newly created database in the case of an + import operation. + :vartype database_edition: str + :ivar service_objective_name: Database service level objective for the newly created database + in the case of an import operation. + :vartype service_objective_name: str + :ivar max_size_bytes: Database max size in bytes for the newly created database in the case of + an import operation. + :vartype max_size_bytes: str + :ivar network_isolation: Optional resource information to enable network isolation for request. + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ _validation = { @@ -2101,6 +2123,13 @@ class DatabaseExtensions(ProxyResource): "storage_key_type": {"key": "properties.storageKeyType", "type": "str"}, "storage_key": {"key": "properties.storageKey", "type": "str"}, "storage_uri": {"key": "properties.storageUri", "type": "str"}, + "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, + "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, + "authentication_type": {"key": "properties.authenticationType", "type": "str"}, + "database_edition": {"key": "properties.databaseEdition", "type": "str"}, + "service_objective_name": {"key": "properties.serviceObjectiveName", "type": "str"}, + "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "str"}, + "network_isolation": {"key": "properties.networkIsolation", "type": "NetworkIsolationSettings"}, } def __init__( @@ -2110,24 +2139,62 @@ def __init__( storage_key_type: Optional[Union[str, "_models.StorageKeyType"]] = None, storage_key: Optional[str] = None, storage_uri: Optional[str] = None, + administrator_login: Optional[str] = None, + administrator_login_password: Optional[str] = None, + authentication_type: Optional[str] = None, + database_edition: Optional[str] = None, + service_objective_name: Optional[str] = None, + max_size_bytes: Optional[str] = None, + network_isolation: Optional["_models.NetworkIsolationSettings"] = None, **kwargs: Any ) -> None: """ - :keyword operation_mode: Operation Mode. "PolybaseImport" + :keyword operation_mode: Operation mode of the operation: Import, Export, or PolybaseImport. + Known values are: "PolybaseImport", "Import", and "Export". :paramtype operation_mode: str or ~azure.mgmt.sql.models.OperationMode - :keyword storage_key_type: Storage key type. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey or + ManagedIdentity. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key. + :keyword storage_key: Storage key for the storage account. If StorageKeyType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. :paramtype storage_key: str - :keyword storage_uri: Storage Uri. + :keyword storage_uri: Storage Uri for the storage account. :paramtype storage_uri: str + :keyword administrator_login: Administrator login name. If AuthenticationType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. + :paramtype administrator_login: str + :keyword administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :paramtype administrator_login_password: str + :keyword authentication_type: Authentication type used to access the SQL: Sql, ADPassword or + ManagedIdentity. + :paramtype authentication_type: str + :keyword database_edition: Database edition for the newly created database in the case of an + import operation. + :paramtype database_edition: str + :keyword service_objective_name: Database service level objective for the newly created + database in the case of an import operation. + :paramtype service_objective_name: str + :keyword max_size_bytes: Database max size in bytes for the newly created database in the case + of an import operation. + :paramtype max_size_bytes: str + :keyword network_isolation: Optional resource information to enable network isolation for + request. + :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ super().__init__(**kwargs) self.operation_mode = operation_mode self.storage_key_type = storage_key_type self.storage_key = storage_key self.storage_uri = storage_uri + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.authentication_type = authentication_type + self.database_edition = database_edition + self.service_objective_name = service_objective_name + self.max_size_bytes = max_size_bytes + self.network_isolation = network_isolation class DatabaseIdentity(_serialization.Model): @@ -2185,6 +2252,8 @@ class DatabaseKey(_serialization.Model): :vartype creation_date: ~datetime.datetime :ivar subregion: Subregion of the server key. :vartype subregion: str + :ivar key_version: The database key's version. + :vartype key_version: str """ _validation = { @@ -2192,6 +2261,7 @@ class DatabaseKey(_serialization.Model): "thumbprint": {"readonly": True}, "creation_date": {"readonly": True}, "subregion": {"readonly": True}, + "key_version": {"readonly": True}, } _attribute_map = { @@ -2199,6 +2269,7 @@ class DatabaseKey(_serialization.Model): "thumbprint": {"key": "thumbprint", "type": "str"}, "creation_date": {"key": "creationDate", "type": "iso-8601"}, "subregion": {"key": "subregion", "type": "str"}, + "key_version": {"key": "keyVersion", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -2208,6 +2279,7 @@ def __init__(self, **kwargs: Any) -> None: self.thumbprint: Optional[str] = None self.creation_date: Optional[datetime.datetime] = None self.subregion: Optional[str] = None + self.key_version: Optional[str] = None class DatabaseListResult(_serialization.Model): @@ -2982,8 +3054,8 @@ class DatabaseUpdate(_serialization.Model): values are: "Enabled" and "Disabled". :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar high_availability_replica_count: The number of secondary replicas associated with the - database that are used to provide high availability. Not applicable to a Hyperscale database - within an elastic pool. + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. :vartype high_availability_replica_count: int :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". @@ -3266,8 +3338,8 @@ def __init__( # pylint: disable=too-many-locals pool. Known values are: "Enabled" and "Disabled". :paramtype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :keyword high_availability_replica_count: The number of secondary replicas associated with the - database that are used to provide high availability. Not applicable to a Hyperscale database - within an elastic pool. + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. :paramtype high_availability_replica_count: int :keyword secondary_type: The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". @@ -3515,11 +3587,13 @@ class DatabaseVulnerabilityAssessment(ProxyResource): :vartype storage_container_path: str :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' - isn't specified, StorageContainerSasKey is required. + isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not + behind a Vnet or a firewall. :vartype storage_container_sas_key: str :ivar storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. + storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet + or a firewall. :vartype storage_account_access_key: str :ivar recurring_scans: The recurring scans settings. :vartype recurring_scans: @@ -3561,11 +3635,13 @@ def __init__( :paramtype storage_container_path: str :keyword storage_container_sas_key: A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. If - 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. + 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. Applies only if + the storage account is not behind a Vnet or a firewall. :paramtype storage_container_sas_key: str :keyword storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. + storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet + or a firewall. :paramtype storage_account_access_key: str :keyword recurring_scans: The recurring scans settings. :paramtype recurring_scans: @@ -3716,7 +3792,7 @@ def __init__(self, **kwargs: Any) -> None: class DataMaskingPolicy(ProxyResource): - """Represents a database data masking policy. + """A database data masking policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -3728,10 +3804,10 @@ class DataMaskingPolicy(ProxyResource): :vartype type: str :ivar location: The location of the data masking policy. :vartype location: str - :ivar kind: The kind of data masking policy. Metadata, used for Azure portal. + :ivar kind: The kind of Data Masking Policy. Metadata, used for Azure portal. :vartype kind: str - :ivar data_masking_state: The state of the data masking policy. Known values are: "Disabled" - and "Enabled". + :ivar data_masking_state: The state of the data masking policy. Known values are: "Enabled" and + "Disabled". :vartype data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState :ivar exempt_principals: The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. The specified users @@ -3774,8 +3850,8 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword data_masking_state: The state of the data masking policy. Known values are: "Disabled" - and "Enabled". + :keyword data_masking_state: The state of the data masking policy. Known values are: "Enabled" + and "Disabled". :paramtype data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState :keyword exempt_principals: The list of the exempt principals. Specifies the semicolon-separated list of database users for which the data masking policy does not apply. @@ -3792,7 +3868,7 @@ def __init__( class DataMaskingRule(ProxyResource): - """Represents a database data masking rule. + """A database data masking rule. Variables are only populated by the server, and will be ignored when sending a request. @@ -3808,13 +3884,11 @@ class DataMaskingRule(ProxyResource): :vartype kind: str :ivar id_properties_id: The rule Id. :vartype id_properties_id: str - :ivar alias_name: The alias name. This is a legacy parameter and is no longer used. - :vartype alias_name: str :ivar rule_state: The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Known values are: "Disabled" and - "Enabled". + enabled, regardless of the provided value of ruleState. Known values are: "Enabled" and + "Disabled". :vartype rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState :ivar schema_name: The schema name on which the data masking rule is applied. :vartype schema_name: str @@ -3822,6 +3896,8 @@ class DataMaskingRule(ProxyResource): :vartype table_name: str :ivar column_name: The column name on which the data masking rule is applied. :vartype column_name: str + :ivar alias_name: The alias name. This is a legacy parameter and is no longer used. + :vartype alias_name: str :ivar masking_function: The masking function that is used for the data masking rule. Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text". :vartype masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction @@ -3858,11 +3934,11 @@ class DataMaskingRule(ProxyResource): "location": {"key": "location", "type": "str"}, "kind": {"key": "kind", "type": "str"}, "id_properties_id": {"key": "properties.id", "type": "str"}, - "alias_name": {"key": "properties.aliasName", "type": "str"}, "rule_state": {"key": "properties.ruleState", "type": "str"}, "schema_name": {"key": "properties.schemaName", "type": "str"}, "table_name": {"key": "properties.tableName", "type": "str"}, "column_name": {"key": "properties.columnName", "type": "str"}, + "alias_name": {"key": "properties.aliasName", "type": "str"}, "masking_function": {"key": "properties.maskingFunction", "type": "str"}, "number_from": {"key": "properties.numberFrom", "type": "str"}, "number_to": {"key": "properties.numberTo", "type": "str"}, @@ -3874,11 +3950,11 @@ class DataMaskingRule(ProxyResource): def __init__( self, *, - alias_name: Optional[str] = None, rule_state: Optional[Union[str, "_models.DataMaskingRuleState"]] = None, schema_name: Optional[str] = None, table_name: Optional[str] = None, column_name: Optional[str] = None, + alias_name: Optional[str] = None, masking_function: Optional[Union[str, "_models.DataMaskingFunction"]] = None, number_from: Optional[str] = None, number_to: Optional[str] = None, @@ -3888,13 +3964,11 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword alias_name: The alias name. This is a legacy parameter and is no longer used. - :paramtype alias_name: str :keyword rule_state: The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Known values are: "Disabled" and - "Enabled". + enabled, regardless of the provided value of ruleState. Known values are: "Enabled" and + "Disabled". :paramtype rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState :keyword schema_name: The schema name on which the data masking rule is applied. :paramtype schema_name: str @@ -3902,6 +3976,8 @@ def __init__( :paramtype table_name: str :keyword column_name: The column name on which the data masking rule is applied. :paramtype column_name: str + :keyword alias_name: The alias name. This is a legacy parameter and is no longer used. + :paramtype alias_name: str :keyword masking_function: The masking function that is used for the data masking rule. Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text". :paramtype masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction @@ -3925,11 +4001,11 @@ def __init__( self.location: Optional[str] = None self.kind: Optional[str] = None self.id_properties_id: Optional[str] = None - self.alias_name = alias_name self.rule_state = rule_state self.schema_name = schema_name self.table_name = table_name self.column_name = column_name + self.alias_name = alias_name self.masking_function = masking_function self.number_from = number_from self.number_to = number_to @@ -3939,23 +4015,31 @@ def __init__( class DataMaskingRuleListResult(_serialization.Model): - """The response to a list data masking rules request. + """The list of database data masking rules. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of database data masking rules. + :ivar value: Array of results. :vartype value: list[~azure.mgmt.sql.models.DataMaskingRule] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + _attribute_map = { "value": {"key": "value", "type": "[DataMaskingRule]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[list["_models.DataMaskingRule"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of database data masking rules. - :paramtype value: list[~azure.mgmt.sql.models.DataMaskingRule] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.value = value + self.value: Optional[list["_models.DataMaskingRule"]] = None + self.next_link: Optional[str] = None class DataWarehouseUserActivities(ProxyResource): @@ -4114,8 +4198,7 @@ class DistributedAvailabilityGroup(ProxyResource): :vartype distributed_availability_group_name: str :ivar distributed_availability_group_id: ID of the distributed availability group. :vartype distributed_availability_group_id: str - :ivar replication_mode: Replication mode of the link. Known values are: "Async", "Sync", and - "Async". + :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". @@ -4180,8 +4263,7 @@ def __init__( **kwargs: Any ) -> None: """ - :keyword replication_mode: Replication mode of the link. Known values are: "Async", "Sync", and - "Async". + :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 @@ -4461,6 +4543,8 @@ class EditionCapability(_serialization.Model): :ivar supported_storage_capabilities: The list of supported storage capabilities for this edition. :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] + :ivar zone_pinning: Whether or not zone pinning is supported for the edition. + :vartype zone_pinning: bool :ivar status: The status of the capability. Known values are: "Visible", "Available", "Default", and "Disabled". :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus @@ -4474,6 +4558,7 @@ class EditionCapability(_serialization.Model): "zone_redundant": {"readonly": True}, "read_scale": {"readonly": True}, "supported_storage_capabilities": {"readonly": True}, + "zone_pinning": {"readonly": True}, "status": {"readonly": True}, } @@ -4486,6 +4571,7 @@ class EditionCapability(_serialization.Model): "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, "read_scale": {"key": "readScale", "type": "ReadScaleCapability"}, "supported_storage_capabilities": {"key": "supportedStorageCapabilities", "type": "[StorageCapability]"}, + "zone_pinning": {"key": "zonePinning", "type": "bool"}, "status": {"key": "status", "type": "str"}, "reason": {"key": "reason", "type": "str"}, } @@ -4501,6 +4587,7 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: self.zone_redundant: Optional[bool] = None self.read_scale: Optional["_models.ReadScaleCapability"] = None self.supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = None + self.zone_pinning: Optional[bool] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None self.reason = reason @@ -4556,9 +4643,12 @@ class ElasticPool(TrackedResource): This configuration defines the period when the maintenance updates will will occur. :vartype maintenance_configuration_id: str :ivar high_availability_replica_count: The number of secondary replicas associated with the - elastic pool that are used to provide high availability. Applicable only to Hyperscale elastic - pools. + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. :vartype high_availability_replica_count: int + :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: "Default" and "VBS". :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType @@ -4594,6 +4684,7 @@ class ElasticPool(TrackedResource): "license_type": {"key": "properties.licenseType", "type": "str"}, "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, + "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, "availability_zone": {"key": "properties.availabilityZone", "type": "str"}, } @@ -4611,6 +4702,7 @@ def __init__( license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, maintenance_configuration_id: Optional[str] = None, high_availability_replica_count: Optional[int] = None, + auto_pause_delay: Optional[int] = None, preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, **kwargs: Any @@ -4648,9 +4740,12 @@ def __init__( pool. This configuration defines the period when the maintenance updates will will occur. :paramtype maintenance_configuration_id: str :keyword high_availability_replica_count: The number of secondary replicas associated with the - elastic pool that are used to provide high availability. Applicable only to Hyperscale elastic - pools. + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. :paramtype high_availability_replica_count: int + :keyword auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :paramtype auto_pause_delay: int :keyword preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: "Default" and "VBS". :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType @@ -4670,176 +4765,99 @@ def __init__( self.license_type = license_type self.maintenance_configuration_id = maintenance_configuration_id self.high_availability_replica_count = high_availability_replica_count + self.auto_pause_delay = auto_pause_delay self.preferred_enclave_type = preferred_enclave_type self.availability_zone = availability_zone -class ElasticPoolActivity(ProxyResource): - """Represents the activity on an elastic pool. +class ElasticPoolEditionCapability(_serialization.Model): + """The elastic pool edition capability. 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. + :ivar name: The elastic pool edition name. :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: ~datetime.datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. - :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. - :vartype percent_complete: int - :ivar requested_database_dtu_max: The requested max DTU per database if available. - :vartype requested_database_dtu_max: int - :ivar requested_database_dtu_min: The requested min DTU per database if available. - :vartype requested_database_dtu_min: int - :ivar requested_dtu: The requested DTU for the pool if available. - :vartype requested_dtu: int - :ivar requested_elastic_pool_name: The requested name for the elastic pool if available. - :vartype requested_elastic_pool_name: str - :ivar requested_storage_limit_in_gb: The requested storage limit for the pool in GB if - available. - :vartype requested_storage_limit_in_gb: int - :ivar elastic_pool_name: The name of the elastic pool. - :vartype elastic_pool_name: str - :ivar server_name: The name of the server the elastic pool is in. - :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). - :vartype start_time: ~datetime.datetime - :ivar state: The current state of the operation. - :vartype state: str - :ivar requested_storage_limit_in_mb: The requested storage limit in MB. - :vartype requested_storage_limit_in_mb: int - :ivar requested_database_dtu_guarantee: The requested per database DTU guarantee. - :vartype requested_database_dtu_guarantee: int - :ivar requested_database_dtu_cap: The requested per database DTU cap. - :vartype requested_database_dtu_cap: int - :ivar requested_dtu_guarantee: The requested DTU guarantee. - :vartype requested_dtu_guarantee: int + :ivar supported_elastic_pool_performance_levels: The list of supported elastic pool DTU levels + for the edition. + :vartype supported_elastic_pool_performance_levels: + list[~azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability] + :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. + :vartype zone_redundant: bool + :ivar zone_pinning: Whether or not zone pinning is supported for the edition. + :vartype zone_pinning: bool + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str """ _validation = { - "id": {"readonly": True}, "name": {"readonly": True}, - "type": {"readonly": True}, - "end_time": {"readonly": True}, - "error_code": {"readonly": True}, - "error_message": {"readonly": True}, - "error_severity": {"readonly": True}, - "operation": {"readonly": True}, - "operation_id": {"readonly": True}, - "percent_complete": {"readonly": True}, - "requested_database_dtu_max": {"readonly": True}, - "requested_database_dtu_min": {"readonly": True}, - "requested_dtu": {"readonly": True}, - "requested_elastic_pool_name": {"readonly": True}, - "requested_storage_limit_in_gb": {"readonly": True}, - "elastic_pool_name": {"readonly": True}, - "server_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "requested_storage_limit_in_mb": {"readonly": True}, - "requested_database_dtu_guarantee": {"readonly": True}, - "requested_database_dtu_cap": {"readonly": True}, - "requested_dtu_guarantee": {"readonly": True}, + "supported_elastic_pool_performance_levels": {"readonly": True}, + "zone_redundant": {"readonly": True}, + "zone_pinning": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_id": {"key": "properties.operationId", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "requested_database_dtu_max": {"key": "properties.requestedDatabaseDtuMax", "type": "int"}, - "requested_database_dtu_min": {"key": "properties.requestedDatabaseDtuMin", "type": "int"}, - "requested_dtu": {"key": "properties.requestedDtu", "type": "int"}, - "requested_elastic_pool_name": {"key": "properties.requestedElasticPoolName", "type": "str"}, - "requested_storage_limit_in_gb": {"key": "properties.requestedStorageLimitInGB", "type": "int"}, - "elastic_pool_name": {"key": "properties.elasticPoolName", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "requested_storage_limit_in_mb": {"key": "properties.requestedStorageLimitInMB", "type": "int"}, - "requested_database_dtu_guarantee": {"key": "properties.requestedDatabaseDtuGuarantee", "type": "int"}, - "requested_database_dtu_cap": {"key": "properties.requestedDatabaseDtuCap", "type": "int"}, - "requested_dtu_guarantee": {"key": "properties.requestedDtuGuarantee", "type": "int"}, + "supported_elastic_pool_performance_levels": { + "key": "supportedElasticPoolPerformanceLevels", + "type": "[ElasticPoolPerformanceLevelCapability]", + }, + "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, + "zone_pinning": {"key": "zonePinning", "type": "bool"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, } - def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=too-many-locals + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword location: The geo-location where the resource lives. - :paramtype location: str + :keyword reason: The reason for the capability not being available. + :paramtype reason: str """ super().__init__(**kwargs) - self.location = location - self.end_time: Optional[datetime.datetime] = None - self.error_code: Optional[int] = None - self.error_message: Optional[str] = None - self.error_severity: Optional[int] = None - self.operation: Optional[str] = None - self.operation_id: Optional[str] = None - self.percent_complete: Optional[int] = None - self.requested_database_dtu_max: Optional[int] = None - self.requested_database_dtu_min: Optional[int] = None - self.requested_dtu: Optional[int] = None - self.requested_elastic_pool_name: Optional[str] = None - self.requested_storage_limit_in_gb: Optional[int] = None - self.elastic_pool_name: Optional[str] = None - self.server_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[str] = None - self.requested_storage_limit_in_mb: Optional[int] = None - self.requested_database_dtu_guarantee: Optional[int] = None - self.requested_database_dtu_cap: Optional[int] = None - self.requested_dtu_guarantee: Optional[int] = None + self.name: Optional[str] = None + self.supported_elastic_pool_performance_levels: Optional[ + list["_models.ElasticPoolPerformanceLevelCapability"] + ] = None + self.zone_redundant: Optional[bool] = None + self.zone_pinning: Optional[bool] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason -class ElasticPoolActivityListResult(_serialization.Model): - """Represents the response to a list elastic pool activity request. +class ElasticPoolListResult(_serialization.Model): + """The result of an elastic pool list request. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of elastic pool activities. Required. - :vartype value: list[~azure.mgmt.sql.models.ElasticPoolActivity] + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.ElasticPool] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { - "value": {"required": True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ElasticPoolActivity]"}, + "value": {"key": "value", "type": "[ElasticPool]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: list["_models.ElasticPoolActivity"], **kwargs: Any) -> None: - """ - :keyword value: The list of elastic pool activities. Required. - :paramtype value: list[~azure.mgmt.sql.models.ElasticPoolActivity] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.value = value + self.value: Optional[list["_models.ElasticPool"]] = None + self.next_link: Optional[str] = None -class ElasticPoolDatabaseActivity(ProxyResource): - """Represents the activity on an elastic pool. +class ElasticPoolOperation(ProxyResource): + """A elastic pool operation. Variables are only populated by the server, and will be ignored when sending a request. @@ -4849,295 +4867,74 @@ class ElasticPoolDatabaseActivity(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar location: The geo-location where the resource lives. - :vartype location: str - :ivar database_name: The database name. - :vartype database_name: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: ~datetime.datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. + :ivar elastic_pool_name: The name of the elastic pool the operation is being performed on. + :vartype elastic_pool_name: str + :ivar operation: The name of operation. :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. :vartype percent_complete: int - :ivar requested_elastic_pool_name: The name for the elastic pool the database is moving into if - available. - :vartype requested_elastic_pool_name: str - :ivar current_elastic_pool_name: The name of the current elastic pool the database is in if - available. - :vartype current_elastic_pool_name: str - :ivar current_service_objective: The name of the current service objective if available. - :vartype current_service_objective: str - :ivar requested_service_objective: The name of the requested service objective if available. - :vartype requested_service_objective: str - :ivar server_name: The name of the server the elastic pool is in. + :ivar server_name: The name of the server. :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). + :ivar start_time: The operation start time. :vartype start_time: ~datetime.datetime - :ivar state: The current state of the operation. + :ivar state: The operation state. :vartype state: str + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "database_name": {"readonly": True}, - "end_time": {"readonly": True}, - "error_code": {"readonly": True}, - "error_message": {"readonly": True}, - "error_severity": {"readonly": True}, + "elastic_pool_name": {"readonly": True}, "operation": {"readonly": True}, - "operation_id": {"readonly": True}, + "operation_friendly_name": {"readonly": True}, "percent_complete": {"readonly": True}, - "requested_elastic_pool_name": {"readonly": True}, - "current_elastic_pool_name": {"readonly": True}, - "current_service_objective": {"readonly": True}, - "requested_service_objective": {"readonly": True}, "server_name": {"readonly": True}, "start_time": {"readonly": True}, "state": {"readonly": True}, + "error_code": {"readonly": True}, + "error_description": {"readonly": True}, + "error_severity": {"readonly": True}, + "is_user_error": {"readonly": True}, + "estimated_completion_time": {"readonly": True}, + "description": {"readonly": True}, + "is_cancellable": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, + "elastic_pool_name": {"key": "properties.elasticPoolName", "type": "str"}, "operation": {"key": "properties.operation", "type": "str"}, - "operation_id": {"key": "properties.operationId", "type": "str"}, + "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "requested_elastic_pool_name": {"key": "properties.requestedElasticPoolName", "type": "str"}, - "current_elastic_pool_name": {"key": "properties.currentElasticPoolName", "type": "str"}, - "current_service_objective": {"key": "properties.currentServiceObjective", "type": "str"}, - "requested_service_objective": {"key": "properties.requestedServiceObjective", "type": "str"}, "server_name": {"key": "properties.serverName", "type": "str"}, "start_time": {"key": "properties.startTime", "type": "iso-8601"}, "state": {"key": "properties.state", "type": "str"}, - } - - def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword location: The geo-location where the resource lives. - :paramtype location: str - """ - super().__init__(**kwargs) - self.location = location - self.database_name: Optional[str] = None - self.end_time: Optional[datetime.datetime] = None - self.error_code: Optional[int] = None - self.error_message: Optional[str] = None - self.error_severity: Optional[int] = None - self.operation: Optional[str] = None - self.operation_id: Optional[str] = None - self.percent_complete: Optional[int] = None - self.requested_elastic_pool_name: Optional[str] = None - self.current_elastic_pool_name: Optional[str] = None - self.current_service_objective: Optional[str] = None - self.requested_service_objective: Optional[str] = None - self.server_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[str] = None - - -class ElasticPoolDatabaseActivityListResult(_serialization.Model): - """Represents the response to a list elastic pool database activity request. - - All required parameters must be populated in order to send to server. - - :ivar value: The list of elastic pool database activities. Required. - :vartype value: list[~azure.mgmt.sql.models.ElasticPoolDatabaseActivity] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ElasticPoolDatabaseActivity]"}, - } - - def __init__(self, *, value: list["_models.ElasticPoolDatabaseActivity"], **kwargs: Any) -> None: - """ - :keyword value: The list of elastic pool database activities. Required. - :paramtype value: list[~azure.mgmt.sql.models.ElasticPoolDatabaseActivity] - """ - super().__init__(**kwargs) - self.value = value - - -class ElasticPoolEditionCapability(_serialization.Model): - """The elastic pool edition capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The elastic pool edition name. - :vartype name: str - :ivar supported_elastic_pool_performance_levels: The list of supported elastic pool DTU levels - for the edition. - :vartype supported_elastic_pool_performance_levels: - list[~azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. - :vartype zone_redundant: bool - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_elastic_pool_performance_levels": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_elastic_pool_performance_levels": { - "key": "supportedElasticPoolPerformanceLevels", - "type": "[ElasticPoolPerformanceLevelCapability]", - }, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_elastic_pool_performance_levels: Optional[ - list["_models.ElasticPoolPerformanceLevelCapability"] - ] = None - self.zone_redundant: Optional[bool] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPoolListResult(_serialization.Model): - """The result of an elastic pool list request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ElasticPool] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ElasticPool]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ElasticPool"]] = None - self.next_link: Optional[str] = None - - -class ElasticPoolOperation(ProxyResource): - """A elastic pool operation. - - 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 elastic_pool_name: The name of the elastic pool the operation is being performed on. - :vartype elastic_pool_name: str - :ivar operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar server_name: The name of the server. - :vartype server_name: str - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. - :vartype state: str - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "elastic_pool_name": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "server_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "elastic_pool_name": {"key": "properties.elasticPoolName", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, + "error_code": {"key": "properties.errorCode", "type": "int"}, + "error_description": {"key": "properties.errorDescription", "type": "str"}, + "error_severity": {"key": "properties.errorSeverity", "type": "int"}, + "is_user_error": {"key": "properties.isUserError", "type": "bool"}, + "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, + "description": {"key": "properties.description", "type": "str"}, + "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, } def __init__(self, **kwargs: Any) -> None: @@ -5288,25 +5085,36 @@ class ElasticPoolPerDatabaseSettings(_serialization.Model): :vartype min_capacity: float :ivar max_capacity: The maximum capacity any one database can consume. :vartype max_capacity: float + :ivar auto_pause_delay: Auto Pause Delay for per database within pool. + :vartype auto_pause_delay: int """ _attribute_map = { "min_capacity": {"key": "minCapacity", "type": "float"}, "max_capacity": {"key": "maxCapacity", "type": "float"}, + "auto_pause_delay": {"key": "autoPauseDelay", "type": "int"}, } def __init__( - self, *, min_capacity: Optional[float] = None, max_capacity: Optional[float] = None, **kwargs: Any + self, + *, + min_capacity: Optional[float] = None, + max_capacity: Optional[float] = None, + auto_pause_delay: Optional[int] = None, + **kwargs: Any ) -> None: """ :keyword min_capacity: The minimum capacity all databases are guaranteed. :paramtype min_capacity: float :keyword max_capacity: The maximum capacity any one database can consume. :paramtype max_capacity: float + :keyword auto_pause_delay: Auto Pause Delay for per database within pool. + :paramtype auto_pause_delay: int """ super().__init__(**kwargs) self.min_capacity = min_capacity self.max_capacity = max_capacity + self.auto_pause_delay = auto_pause_delay class ElasticPoolPerformanceLevelCapability(_serialization.Model): @@ -5337,6 +5145,16 @@ class ElasticPoolPerformanceLevelCapability(_serialization.Model): :ivar supported_maintenance_configurations: List of supported maintenance configurations. :vartype supported_maintenance_configurations: list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] + :ivar supported_min_capacities: List of supported min capacities. + :vartype supported_min_capacities: list[~azure.mgmt.sql.models.MinCapacityCapability] + :ivar supported_auto_pause_delay: Supported time range for auto pause delay. + :vartype supported_auto_pause_delay: ~azure.mgmt.sql.models.AutoPauseDelayTimeRange + :ivar supported_per_database_auto_pause_delay: Supported time range for per database auto pause + delay. + :vartype supported_per_database_auto_pause_delay: + ~azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange + :ivar supported_zones: List of supported availability zones. + :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] :ivar status: The status of the capability. Known values are: "Visible", "Available", "Default", and "Disabled". :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus @@ -5355,6 +5173,10 @@ class ElasticPoolPerformanceLevelCapability(_serialization.Model): "supported_per_database_max_performance_levels": {"readonly": True}, "zone_redundant": {"readonly": True}, "supported_maintenance_configurations": {"readonly": True}, + "supported_min_capacities": {"readonly": True}, + "supported_auto_pause_delay": {"readonly": True}, + "supported_per_database_auto_pause_delay": {"readonly": True}, + "supported_zones": {"readonly": True}, "status": {"readonly": True}, } @@ -5375,6 +5197,13 @@ class ElasticPoolPerformanceLevelCapability(_serialization.Model): "key": "supportedMaintenanceConfigurations", "type": "[MaintenanceConfigurationCapability]", }, + "supported_min_capacities": {"key": "supportedMinCapacities", "type": "[MinCapacityCapability]"}, + "supported_auto_pause_delay": {"key": "supportedAutoPauseDelay", "type": "AutoPauseDelayTimeRange"}, + "supported_per_database_auto_pause_delay": { + "key": "supportedPerDatabaseAutoPauseDelay", + "type": "PerDatabaseAutoPauseDelayTimeRange", + }, + "supported_zones": {"key": "supportedZones", "type": "[ZonePinningCapability]"}, "status": {"key": "status", "type": "str"}, "reason": {"key": "reason", "type": "str"}, } @@ -5397,6 +5226,10 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: ] = None self.zone_redundant: Optional[bool] = None self.supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = None + self.supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = None + self.supported_auto_pause_delay: Optional["_models.AutoPauseDelayTimeRange"] = None + self.supported_per_database_auto_pause_delay: Optional["_models.PerDatabaseAutoPauseDelayTimeRange"] = None + self.supported_zones: Optional[list["_models.ZonePinningCapability"]] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None self.reason = reason @@ -5424,9 +5257,12 @@ class ElasticPoolUpdate(_serialization.Model): This configuration defines the period when the maintenance updates will will occur. :vartype maintenance_configuration_id: str :ivar high_availability_replica_count: The number of secondary replicas associated with the - elastic pool that are used to provide high availability. Applicable only to Hyperscale elastic - pools. + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. :vartype high_availability_replica_count: int + :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: "Default" and "VBS". :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType @@ -5445,6 +5281,7 @@ class ElasticPoolUpdate(_serialization.Model): "license_type": {"key": "properties.licenseType", "type": "str"}, "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, + "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, "availability_zone": {"key": "properties.availabilityZone", "type": "str"}, } @@ -5461,6 +5298,7 @@ def __init__( license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, maintenance_configuration_id: Optional[str] = None, high_availability_replica_count: Optional[int] = None, + auto_pause_delay: Optional[int] = None, preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, **kwargs: Any @@ -5487,9 +5325,12 @@ def __init__( pool. This configuration defines the period when the maintenance updates will will occur. :paramtype maintenance_configuration_id: str :keyword high_availability_replica_count: The number of secondary replicas associated with the - elastic pool that are used to provide high availability. Applicable only to Hyperscale elastic - pools. + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. :paramtype high_availability_replica_count: int + :keyword auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :paramtype auto_pause_delay: int :keyword preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: "Default" and "VBS". :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType @@ -5507,6 +5348,7 @@ def __init__( self.license_type = license_type self.maintenance_configuration_id = maintenance_configuration_id self.high_availability_replica_count = high_availability_replica_count + self.auto_pause_delay = auto_pause_delay self.preferred_enclave_type = preferred_enclave_type self.availability_zone = availability_zone @@ -5540,6 +5382,8 @@ class EncryptionProtector(ProxyResource): :vartype thumbprint: str :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. :vartype auto_rotation_enabled: bool + :ivar key_version: The version of the server key being used as encryption protector. + :vartype key_version: str """ _validation = { @@ -5551,6 +5395,7 @@ class EncryptionProtector(ProxyResource): "subregion": {"readonly": True}, "uri": {"readonly": True}, "thumbprint": {"readonly": True}, + "key_version": {"readonly": True}, } _attribute_map = { @@ -5565,6 +5410,7 @@ class EncryptionProtector(ProxyResource): "uri": {"key": "properties.uri", "type": "str"}, "thumbprint": {"key": "properties.thumbprint", "type": "str"}, "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, + "key_version": {"key": "properties.keyVersion", "type": "str"}, } def __init__( @@ -5593,6 +5439,7 @@ def __init__( self.uri: Optional[str] = None self.thumbprint: Optional[str] = None self.auto_rotation_enabled = auto_rotation_enabled + self.key_version: Optional[str] = None class EncryptionProtectorListResult(_serialization.Model): @@ -5838,18 +5685,23 @@ class ExportDatabaseDefinition(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar storage_key_type: Storage key type. Required. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key. Required. + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. :vartype storage_key: str :ivar storage_uri: Storage Uri. Required. :vartype storage_uri: str - :ivar administrator_login: Administrator login name. Required. + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. Required. + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. :vartype administrator_login_password: str - :ivar authentication_type: Authentication type. + :ivar authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. :vartype authentication_type: str :ivar network_isolation: Optional resource information to enable network isolation for request. :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings @@ -5860,7 +5712,6 @@ class ExportDatabaseDefinition(_serialization.Model): "storage_key": {"required": True}, "storage_uri": {"required": True}, "administrator_login": {"required": True}, - "administrator_login_password": {"required": True}, } _attribute_map = { @@ -5880,24 +5731,29 @@ def __init__( storage_key: str, storage_uri: str, administrator_login: str, - administrator_login_password: str, + administrator_login_password: Optional[str] = None, authentication_type: Optional[str] = None, network_isolation: Optional["_models.NetworkIsolationSettings"] = None, **kwargs: Any ) -> None: """ - :keyword storage_key_type: Storage key type. Required. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key. Required. + :keyword storage_key: Storage key for the storage account. If StorageKeyType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. :paramtype storage_key: str :keyword storage_uri: Storage Uri. Required. :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. Required. + :keyword administrator_login: Administrator login name. If AuthenticationType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. Required. + :keyword administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. :paramtype administrator_login_password: str - :keyword authentication_type: Authentication type. + :keyword authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. :paramtype authentication_type: str :keyword network_isolation: Optional resource information to enable network isolation for request. @@ -6023,8 +5879,8 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): or `Diagnostic Settings PowerShell `_. :vartype is_azure_monitor_target_enabled: bool :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. :vartype queue_delay_ms: int :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -6192,8 +6048,8 @@ def __init__( or `Diagnostic Settings PowerShell `_. :paramtype is_azure_monitor_target_enabled: bool :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + audit actions are forced to be processed. The default minimum value is 1000 (1 second). The + maximum is 2,147,483,647. :paramtype queue_delay_ms: int :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -6390,8 +6246,8 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): or `Diagnostic Settings PowerShell `_. :vartype is_azure_monitor_target_enabled: bool :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. :vartype queue_delay_ms: int :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -6577,8 +6433,8 @@ def __init__( or `Diagnostic Settings PowerShell `_. :paramtype is_azure_monitor_target_enabled: bool :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + audit actions are forced to be processed. The default minimum value is 1000 (1 second). The + maximum is 2,147,483,647. :paramtype queue_delay_ms: int :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -7072,25 +6928,52 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None -class GeoBackupPolicy(ProxyResource): - """A database geo backup policy. +class FreeLimitExhaustionBehaviorCapability(_serialization.Model): + """Supported free limit exhaustion behavior options. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. + :ivar exhaustion_behavior_type: Free limit exhaustion behavior type. Known values are: + "AutoPause" and "BillOverUsage". + :vartype exhaustion_behavior_type: str or ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior + :ivar status: Free limit exhaustion behavior status. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + """ - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. + _validation = { + "exhaustion_behavior_type": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "exhaustion_behavior_type": {"key": "exhaustionBehaviorType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.exhaustion_behavior_type: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + + +class GeoBackupPolicy(ProxyResource): + """A Geo backup policy. + + 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 kind: Kind of geo backup policy. This is metadata used for the Azure portal experience. - :vartype kind: str :ivar location: Backup policy location. :vartype location: str - :ivar state: The state of the geo backup policy. Required. Known values are: "Disabled" and - "Enabled". + :ivar kind: Kind of geo backup policy. This is metadata used for the Azure portal experience. + :vartype kind: str + :ivar state: The state of the geo backup policy. Known values are: "Enabled" and "Disabled". :vartype state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState :ivar storage_type: The storage type of the geo backup policy. :vartype storage_type: str @@ -7100,9 +6983,8 @@ class GeoBackupPolicy(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "kind": {"readonly": True}, "location": {"readonly": True}, - "state": {"required": True}, + "kind": {"readonly": True}, "storage_type": {"readonly": True}, } @@ -7110,43 +6992,50 @@ class GeoBackupPolicy(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, "location": {"key": "location", "type": "str"}, + "kind": {"key": "kind", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, "storage_type": {"key": "properties.storageType", "type": "str"}, } - def __init__(self, *, state: Union[str, "_models.GeoBackupPolicyState"], **kwargs: Any) -> None: + def __init__(self, *, state: Optional[Union[str, "_models.GeoBackupPolicyState"]] = None, **kwargs: Any) -> None: """ - :keyword state: The state of the geo backup policy. Required. Known values are: "Disabled" and - "Enabled". + :keyword state: The state of the geo backup policy. Known values are: "Enabled" and "Disabled". :paramtype state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState """ super().__init__(**kwargs) - self.kind: Optional[str] = None self.location: Optional[str] = None + self.kind: Optional[str] = None self.state = state self.storage_type: Optional[str] = None class GeoBackupPolicyListResult(_serialization.Model): - """The response to a list geo backup policies request. + """The list of geo backup policies. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of geo backup policies. + :ivar value: Array of results. :vartype value: list[~azure.mgmt.sql.models.GeoBackupPolicy] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + _attribute_map = { "value": {"key": "value", "type": "[GeoBackupPolicy]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: Optional[list["_models.GeoBackupPolicy"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of geo backup policies. - :paramtype value: list[~azure.mgmt.sql.models.GeoBackupPolicy] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.value = value + self.value: Optional[list["_models.GeoBackupPolicy"]] = None + self.next_link: Optional[str] = None class ImportExistingDatabaseDefinition(_serialization.Model): @@ -7154,18 +7043,23 @@ class ImportExistingDatabaseDefinition(_serialization.Model): All required parameters must be populated in order to send to server. - :ivar storage_key_type: Storage key type. Required. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key. Required. + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. :vartype storage_key: str :ivar storage_uri: Storage Uri. Required. :vartype storage_uri: str - :ivar administrator_login: Administrator login name. Required. + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. Required. + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. :vartype administrator_login_password: str - :ivar authentication_type: Authentication type. + :ivar authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. :vartype authentication_type: str :ivar network_isolation: Optional resource information to enable network isolation for request. :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings @@ -7176,7 +7070,6 @@ class ImportExistingDatabaseDefinition(_serialization.Model): "storage_key": {"required": True}, "storage_uri": {"required": True}, "administrator_login": {"required": True}, - "administrator_login_password": {"required": True}, } _attribute_map = { @@ -7196,24 +7089,29 @@ def __init__( storage_key: str, storage_uri: str, administrator_login: str, - administrator_login_password: str, + administrator_login_password: Optional[str] = None, authentication_type: Optional[str] = None, network_isolation: Optional["_models.NetworkIsolationSettings"] = None, **kwargs: Any ) -> None: """ - :keyword storage_key_type: Storage key type. Required. Known values are: "SharedAccessKey", - "StorageAccessKey", and "ManagedIdentity". + :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key. Required. + :keyword storage_key: Storage key for the storage account. If StorageKeyType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. :paramtype storage_key: str :keyword storage_uri: Storage Uri. Required. :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. Required. + :keyword administrator_login: Administrator login name. If AuthenticationType is + ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. Required. + :keyword administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. :paramtype administrator_login_password: str - :keyword authentication_type: Authentication type. + :keyword authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. :paramtype authentication_type: str :keyword network_isolation: Optional resource information to enable network isolation for request. @@ -7282,6 +7180,14 @@ class ImportExportExtensionsOperationResult(ProxyResource): :vartype status: str :ivar error_message: Error message. :vartype error_message: str + :ivar queued_time: Queued time. + :vartype queued_time: str + :ivar blob_uri: Blob URI. + :vartype blob_uri: str + :ivar private_endpoint_connections: Gets the status of private endpoints associated with this + request. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] """ _validation = { @@ -7295,6 +7201,9 @@ class ImportExportExtensionsOperationResult(ProxyResource): "database_name": {"readonly": True}, "status": {"readonly": True}, "error_message": {"readonly": True}, + "queued_time": {"readonly": True}, + "blob_uri": {"readonly": True}, + "private_endpoint_connections": {"readonly": True}, } _attribute_map = { @@ -7308,6 +7217,12 @@ class ImportExportExtensionsOperationResult(ProxyResource): "database_name": {"key": "properties.databaseName", "type": "str"}, "status": {"key": "properties.status", "type": "str"}, "error_message": {"key": "properties.errorMessage", "type": "str"}, + "queued_time": {"key": "properties.queuedTime", "type": "str"}, + "blob_uri": {"key": "properties.blobUri", "type": "str"}, + "private_endpoint_connections": { + "key": "properties.privateEndpointConnections", + "type": "[PrivateEndpointConnectionRequestStatus]", + }, } def __init__(self, **kwargs: Any) -> None: @@ -7320,6 +7235,9 @@ def __init__(self, **kwargs: Any) -> None: self.database_name: Optional[str] = None self.status: Optional[str] = None self.error_message: Optional[str] = None + self.queued_time: Optional[str] = None + self.blob_uri: Optional[str] = None + self.private_endpoint_connections: Optional[list["_models.PrivateEndpointConnectionRequestStatus"]] = None class ImportExportOperationResult(ProxyResource): @@ -7439,7 +7357,7 @@ class ImportNewDatabaseDefinition(_serialization.Model): SQL, ADPassword or ManagedIdentity. :vartype authentication_type: str :ivar network_isolation: Optional resource information to enable network isolation for request. - :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated """ _validation = { @@ -7460,7 +7378,7 @@ class ImportNewDatabaseDefinition(_serialization.Model): "administrator_login": {"key": "administratorLogin", "type": "str"}, "administrator_login_password": {"key": "administratorLoginPassword", "type": "str"}, "authentication_type": {"key": "authenticationType", "type": "str"}, - "network_isolation": {"key": "networkIsolation", "type": "NetworkIsolationSettings"}, + "network_isolation": {"key": "networkIsolation", "type": "NetworkIsolationSettingsAutoGenerated"}, } def __init__( @@ -7476,7 +7394,7 @@ def __init__( max_size_bytes: Optional[str] = None, administrator_login_password: Optional[str] = None, authentication_type: Optional[str] = None, - network_isolation: Optional["_models.NetworkIsolationSettings"] = None, + network_isolation: Optional["_models.NetworkIsolationSettingsAutoGenerated"] = None, **kwargs: Any ) -> None: """ @@ -7508,7 +7426,7 @@ def __init__( :paramtype authentication_type: str :keyword network_isolation: Optional resource information to enable network isolation for request. - :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated """ super().__init__(**kwargs) self.database_name = database_name @@ -7922,6 +7840,130 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None +class InstancePoolOperation(ProxyResource): + """A instance pool operation. + + 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 instance_pool_name: The name of the instance pool the operation is being performed on. + :vartype instance_pool_name: str + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar error_type: Error type (e.g. None, User). Known values are: "None" and "User". + :vartype error_type: str or ~azure.mgmt.sql.models.ErrorType + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "instance_pool_name": {"readonly": True}, + "operation": {"readonly": True}, + "operation_friendly_name": {"readonly": True}, + "percent_complete": {"readonly": True}, + "start_time": {"readonly": True}, + "state": {"readonly": True}, + "error_code": {"readonly": True}, + "error_description": {"readonly": True}, + "error_severity": {"readonly": True}, + "error_type": {"readonly": True}, + "estimated_completion_time": {"readonly": True}, + "description": {"readonly": True}, + "is_cancellable": {"readonly": True}, + } + + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "instance_pool_name": {"key": "properties.instancePoolName", "type": "str"}, + "operation": {"key": "properties.operation", "type": "str"}, + "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, + "percent_complete": {"key": "properties.percentComplete", "type": "int"}, + "start_time": {"key": "properties.startTime", "type": "iso-8601"}, + "state": {"key": "properties.state", "type": "str"}, + "error_code": {"key": "properties.errorCode", "type": "int"}, + "error_description": {"key": "properties.errorDescription", "type": "str"}, + "error_severity": {"key": "properties.errorSeverity", "type": "int"}, + "error_type": {"key": "properties.errorType", "type": "str"}, + "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, + "description": {"key": "properties.description", "type": "str"}, + "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.instance_pool_name: Optional[str] = None + self.operation: Optional[str] = None + self.operation_friendly_name: Optional[str] = None + self.percent_complete: Optional[int] = None + self.start_time: Optional[datetime.datetime] = None + self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None + self.error_code: Optional[int] = None + self.error_description: Optional[str] = None + self.error_severity: Optional[int] = None + self.error_type: Optional[Union[str, "_models.ErrorType"]] = None + self.estimated_completion_time: Optional[datetime.datetime] = None + self.description: Optional[str] = None + self.is_cancellable: Optional[bool] = None + + +class InstancePoolOperationListResult(_serialization.Model): + """The response to a list instance pool operations request. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.InstancePoolOperation] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[InstancePoolOperation]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value: Optional[list["_models.InstancePoolOperation"]] = None + self.next_link: Optional[str] = None + + class InstancePoolUpdate(_serialization.Model): """An update to an Instance pool. @@ -8194,6 +8236,8 @@ class JobAgent(TrackedResource): :vartype tags: dict[str, str] :ivar sku: The name and tier of the SKU. :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar identity: The identity of the job agent. + :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity :ivar database_id: Resource ID of the database to store job metadata in. :vartype database_id: str :ivar state: The state of the job agent. Known values are: "Creating", "Ready", "Updating", @@ -8216,6 +8260,7 @@ class JobAgent(TrackedResource): "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, "sku": {"key": "sku", "type": "Sku"}, + "identity": {"key": "identity", "type": "JobAgentIdentity"}, "database_id": {"key": "properties.databaseId", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, } @@ -8226,6 +8271,7 @@ def __init__( location: str, tags: Optional[dict[str, str]] = None, sku: Optional["_models.Sku"] = None, + identity: Optional["_models.JobAgentIdentity"] = None, database_id: Optional[str] = None, **kwargs: Any ) -> None: @@ -8236,63 +8282,292 @@ def __init__( :paramtype tags: dict[str, str] :keyword sku: The name and tier of the SKU. :paramtype sku: ~azure.mgmt.sql.models.Sku + :keyword identity: The identity of the job agent. + :paramtype identity: ~azure.mgmt.sql.models.JobAgentIdentity :keyword database_id: Resource ID of the database to store job metadata in. :paramtype database_id: str """ super().__init__(location=location, tags=tags, **kwargs) self.sku = sku + self.identity = identity self.database_id = database_id self.state: Optional[Union[str, "_models.JobAgentState"]] = None -class JobAgentListResult(_serialization.Model): - """A list of Azure SQL job agents. +class JobAgentEditionCapability(_serialization.Model): + """The job agent edition capability. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobAgent] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str + :ivar name: The job agent edition name. + :vartype name: str + :ivar supported_service_level_objectives: The list of supported service level objectives for + the edition. + :vartype supported_service_level_objectives: + list[~azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "name": {"readonly": True}, + "supported_service_level_objectives": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[JobAgent]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "supported_service_level_objectives": { + "key": "supportedServiceLevelObjectives", + "type": "[JobAgentServiceLevelObjectiveCapability]", + }, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ super().__init__(**kwargs) - self.value: Optional[list["_models.JobAgent"]] = None - self.next_link: Optional[str] = None + self.name: Optional[str] = None + self.supported_service_level_objectives: Optional[list["_models.JobAgentServiceLevelObjectiveCapability"]] = ( + None + ) + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason -class JobAgentUpdate(_serialization.Model): - """An update to an Azure SQL job agent. +class JobAgentIdentity(_serialization.Model): + """Azure Active Directory identity configuration for a resource. - :ivar tags: Resource tags. - :vartype tags: dict[str, str] + All required parameters must be populated in order to send to server. + + :ivar tenant_id: The job agent identity tenant id. + :vartype tenant_id: str + :ivar type: The job agent identity type. Required. Known values are: "None", "SystemAssigned", + "UserAssigned", and "SystemAssignedUserAssigned". + :vartype type: str or ~azure.mgmt.sql.models.JobAgentIdentityType + :ivar user_assigned_identities: The resource ids of the user assigned identities to use. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.JobAgentUserAssignedIdentity] """ - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - } + _validation = { + "type": {"required": True}, + } + + _attribute_map = { + "tenant_id": {"key": "tenantId", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{JobAgentUserAssignedIdentity}"}, + } + + def __init__( + self, + *, + type: Union[str, "_models.JobAgentIdentityType"], + tenant_id: Optional[str] = None, + user_assigned_identities: Optional[dict[str, "_models.JobAgentUserAssignedIdentity"]] = None, + **kwargs: Any + ) -> None: + """ + :keyword tenant_id: The job agent identity tenant id. + :paramtype tenant_id: str + :keyword type: The job agent identity type. Required. Known values are: "None", + "SystemAssigned", "UserAssigned", and "SystemAssignedUserAssigned". + :paramtype type: str or ~azure.mgmt.sql.models.JobAgentIdentityType + :keyword user_assigned_identities: The resource ids of the user assigned identities to use. + :paramtype user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.JobAgentUserAssignedIdentity] + """ + super().__init__(**kwargs) + self.tenant_id = tenant_id + self.type = type + self.user_assigned_identities = user_assigned_identities + + +class JobAgentListResult(_serialization.Model): + """A list of Azure SQL job agents. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.JobAgent] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + "value": {"readonly": True}, + "next_link": {"readonly": True}, + } + + _attribute_map = { + "value": {"key": "value", "type": "[JobAgent]"}, + "next_link": {"key": "nextLink", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.value: Optional[list["_models.JobAgent"]] = None + self.next_link: Optional[str] = None + + +class JobAgentServiceLevelObjectiveCapability(_serialization.Model): + """The job agent service level objective capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The service objective name. + :vartype name: str + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + _validation = { + "name": {"readonly": True}, + "sku": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "sku": {"key": "sku", "type": "Sku"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.name: Optional[str] = None + self.sku: Optional["_models.Sku"] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason + + +class JobAgentUpdate(_serialization.Model): + """An update to an Azure SQL job agent. + + :ivar identity: Managed identity assigned to job agent. + :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + _attribute_map = { + "identity": {"key": "identity", "type": "JobAgentIdentity"}, + "sku": {"key": "sku", "type": "Sku"}, + "tags": {"key": "tags", "type": "{str}"}, + } - def __init__(self, *, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + identity: Optional["_models.JobAgentIdentity"] = None, + sku: Optional["_models.Sku"] = None, + tags: Optional[dict[str, str]] = None, + **kwargs: Any + ) -> None: """ + :keyword identity: Managed identity assigned to job agent. + :paramtype identity: ~azure.mgmt.sql.models.JobAgentIdentity + :keyword sku: The name and tier of the SKU. + :paramtype sku: ~azure.mgmt.sql.models.Sku :keyword tags: Resource tags. :paramtype tags: dict[str, str] """ super().__init__(**kwargs) + self.identity = identity + self.sku = sku self.tags = tags +class JobAgentUserAssignedIdentity(_serialization.Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + _validation = { + "principal_id": {"readonly": True}, + "client_id": {"readonly": True}, + } + + _attribute_map = { + "principal_id": {"key": "principalId", "type": "str"}, + "client_id": {"key": "clientId", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.principal_id: Optional[str] = None + self.client_id: Optional[str] = None + + +class JobAgentVersionCapability(_serialization.Model): + """The job agent version capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar name: The job agent version name. + :vartype name: str + :ivar supported_editions: The list of supported editions. + :vartype supported_editions: list[~azure.mgmt.sql.models.JobAgentEditionCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + _validation = { + "name": {"readonly": True}, + "supported_editions": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "supported_editions": {"key": "supportedEditions", "type": "[JobAgentEditionCapability]"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.name: Optional[str] = None + self.supported_editions: Optional[list["_models.JobAgentEditionCapability"]] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason + + class JobCredential(ProxyResource): """A stored credential that can be used by a job to connect to target databases. @@ -8653,8 +8928,8 @@ class JobSchedule(_serialization.Model): def __init__( self, *, - start_time: datetime.datetime = "0001-01-01T00:00:00+00:00", - end_time: datetime.datetime = "9999-12-31T11:59:59+00:00", + start_time: datetime.datetime = "0001-01-01T16:00:00-08:00", + end_time: datetime.datetime = "9999-12-31T03:59:59-08:00", type: Union[str, "_models.JobScheduleType"] = "Once", enabled: Optional[bool] = None, interval: Optional[str] = None, @@ -8917,7 +9192,7 @@ class JobStepOutput(_serialization.Model): :ivar table_name: The output destination table. Required. :vartype table_name: str :ivar credential: The resource ID of the credential to use to connect to the output - destination. Required. + destination. :vartype credential: str """ @@ -8925,7 +9200,6 @@ class JobStepOutput(_serialization.Model): "server_name": {"required": True}, "database_name": {"required": True}, "table_name": {"required": True}, - "credential": {"required": True}, } _attribute_map = { @@ -8945,11 +9219,11 @@ def __init__( server_name: str, database_name: str, table_name: str, - credential: str, type: Union[str, "_models.JobStepOutputType"] = "SqlDatabase", subscription_id: Optional[str] = None, resource_group_name: Optional[str] = None, schema_name: str = "dbo", + credential: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -8968,7 +9242,7 @@ def __init__( :keyword table_name: The output destination table. Required. :paramtype table_name: str :keyword credential: The resource ID of the credential to use to connect to the output - destination. Required. + destination. :paramtype credential: str """ super().__init__(**kwargs) @@ -9290,6 +9564,11 @@ class LocationCapabilities(_serialization.Model): :ivar supported_managed_instance_versions: The list of supported managed instance versions. :vartype supported_managed_instance_versions: list[~azure.mgmt.sql.models.ManagedInstanceVersionCapability] + :ivar supported_job_agent_versions: The list of supported job agent versions. + :vartype supported_job_agent_versions: list[~azure.mgmt.sql.models.JobAgentVersionCapability] + :ivar is_zone_resilient_provisioning_allowed: Whether or not the subscription is allowed to + provision zone resilient resources. + :vartype is_zone_resilient_provisioning_allowed: bool :ivar status: The status of the capability. Known values are: "Visible", "Available", "Default", and "Disabled". :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus @@ -9301,6 +9580,8 @@ class LocationCapabilities(_serialization.Model): "name": {"readonly": True}, "supported_server_versions": {"readonly": True}, "supported_managed_instance_versions": {"readonly": True}, + "supported_job_agent_versions": {"readonly": True}, + "is_zone_resilient_provisioning_allowed": {"readonly": True}, "status": {"readonly": True}, } @@ -9311,6 +9592,8 @@ class LocationCapabilities(_serialization.Model): "key": "supportedManagedInstanceVersions", "type": "[ManagedInstanceVersionCapability]", }, + "supported_job_agent_versions": {"key": "supportedJobAgentVersions", "type": "[JobAgentVersionCapability]"}, + "is_zone_resilient_provisioning_allowed": {"key": "isZoneResilientProvisioningAllowed", "type": "bool"}, "status": {"key": "status", "type": "str"}, "reason": {"key": "reason", "type": "str"}, } @@ -9324,12 +9607,14 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: self.name: Optional[str] = None self.supported_server_versions: Optional[list["_models.ServerVersionCapability"]] = None self.supported_managed_instance_versions: Optional[list["_models.ManagedInstanceVersionCapability"]] = None + self.supported_job_agent_versions: Optional[list["_models.JobAgentVersionCapability"]] = None + self.is_zone_resilient_provisioning_allowed: Optional[bool] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None self.reason = reason class LogicalDatabaseTransparentDataEncryption(ProxyResource): - """A logical database transparent data encryption state. + """A logical database transparent data encryption scan state. Variables are only populated by the server, and will be ignored when sending a request. @@ -9342,6 +9627,9 @@ class LogicalDatabaseTransparentDataEncryption(ProxyResource): :ivar state: Specifies the state of the transparent data encryption. Known values are: "Enabled" and "Disabled". :vartype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + :ivar scan_state: Specifies the encryption scan state of the transparent data encryption. Known + values are: "None", "Resume", "Running", "Suspend", "Aborted", and "Completed". + :vartype scan_state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionScanState """ _validation = { @@ -9355,22 +9643,31 @@ class LogicalDatabaseTransparentDataEncryption(ProxyResource): "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, "state": {"key": "properties.state", "type": "str"}, + "scan_state": {"key": "properties.scanState", "type": "str"}, } def __init__( - self, *, state: Optional[Union[str, "_models.TransparentDataEncryptionState"]] = None, **kwargs: Any + self, + *, + state: Optional[Union[str, "_models.TransparentDataEncryptionState"]] = None, + scan_state: Optional[Union[str, "_models.TransparentDataEncryptionScanState"]] = None, + **kwargs: Any ) -> None: """ :keyword state: Specifies the state of the transparent data encryption. Known values are: "Enabled" and "Disabled". :paramtype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + :keyword scan_state: Specifies the encryption scan state of the transparent data encryption. + Known values are: "None", "Resume", "Running", "Suspend", "Aborted", and "Completed". + :paramtype scan_state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionScanState """ super().__init__(**kwargs) self.state = state + self.scan_state = scan_state class LogicalDatabaseTransparentDataEncryptionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of transparent data encryptions. + """A list of transparent data encryption scan objects. Variables are only populated by the server, and will be ignored when sending a request. @@ -10195,6 +10492,10 @@ class ManagedDatabase(TrackedResource): in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. :vartype is_ledger_on: bool + :ivar extended_accessibility_info: Additional observability and troubleshooting information for + databases in ‘Inaccessible’ state. + :vartype extended_accessibility_info: + ~azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo """ _validation = { @@ -10207,6 +10508,7 @@ class ManagedDatabase(TrackedResource): "earliest_restore_point": {"readonly": True}, "default_secondary_location": {"readonly": True}, "failover_group_id": {"readonly": True}, + "extended_accessibility_info": {"readonly": True}, } _attribute_map = { @@ -10246,6 +10548,10 @@ class ManagedDatabase(TrackedResource): "type": "str", }, "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, + "extended_accessibility_info": { + "key": "properties.extendedAccessibilityInfo", + "type": "ManagedDatabaseExtendedAccessibilityInfo", + }, } def __init__( # pylint: disable=too-many-locals @@ -10363,6 +10669,7 @@ def __init__( # pylint: disable=too-many-locals self.last_backup_name = last_backup_name self.cross_subscription_target_managed_instance_id = cross_subscription_target_managed_instance_id self.is_ledger_on = is_ledger_on + self.extended_accessibility_info: Optional["_models.ManagedDatabaseExtendedAccessibilityInfo"] = None class ManagedDatabaseAdvancedThreatProtection(ProxyResource): @@ -10446,6 +10753,51 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None +class ManagedDatabaseExtendedAccessibilityInfo(_serialization.Model): + """Managed Database Extended Accessibility Information. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to server. + + :ivar inaccessibility_reason_error_code: SQL Server error code connected to the inaccessibility + root cause. Required. + :vartype inaccessibility_reason_error_code: str + :ivar inaccessibility_reason_description: Root cause explanation and mitigation action. + Required. + :vartype inaccessibility_reason_description: str + :ivar inaccessibility_reason_kind: Root cause kind. Allowed values are + “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”. Required. Known values are: + "Unknown", "TransparentDataEncryption", and "DatabaseReplication". + :vartype inaccessibility_reason_kind: str or ~azure.mgmt.sql.models.InaccessibilityReason + :ivar inaccessibility_reason_tde_key_uri: For the root cause kind “TransparentDataEncryption”, + the CMK URI. + :vartype inaccessibility_reason_tde_key_uri: str + """ + + _validation = { + "inaccessibility_reason_error_code": {"required": True, "readonly": True}, + "inaccessibility_reason_description": {"required": True, "readonly": True}, + "inaccessibility_reason_kind": {"required": True, "readonly": True}, + "inaccessibility_reason_tde_key_uri": {"readonly": True}, + } + + _attribute_map = { + "inaccessibility_reason_error_code": {"key": "inaccessibilityReasonErrorCode", "type": "str"}, + "inaccessibility_reason_description": {"key": "inaccessibilityReasonDescription", "type": "str"}, + "inaccessibility_reason_kind": {"key": "inaccessibilityReasonKind", "type": "str"}, + "inaccessibility_reason_tde_key_uri": {"key": "inaccessibilityReasonTdeKeyUri", "type": "str"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.inaccessibility_reason_error_code: Optional[str] = None + self.inaccessibility_reason_description: Optional[str] = None + self.inaccessibility_reason_kind: Optional[Union[str, "_models.InaccessibilityReason"]] = None + self.inaccessibility_reason_tde_key_uri: Optional[str] = None + + class ManagedDatabaseListResult(_serialization.Model): """A list of managed databases. @@ -10816,7 +11168,7 @@ class ManagedDatabaseRestoreDetailsResult(ProxyResource): }, } - def __init__(self, **kwargs: Any) -> None: # pylint: disable=too-many-locals + def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.type_properties_type: Optional[str] = None @@ -11119,6 +11471,10 @@ class ManagedDatabaseUpdate(_serialization.Model): in the database are ledger tables. Note: the value of this property cannot be changed after the database has been created. :vartype is_ledger_on: bool + :ivar extended_accessibility_info: Additional observability and troubleshooting information for + databases in ‘Inaccessible’ state. + :vartype extended_accessibility_info: + ~azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo """ _validation = { @@ -11127,6 +11483,7 @@ class ManagedDatabaseUpdate(_serialization.Model): "earliest_restore_point": {"readonly": True}, "default_secondary_location": {"readonly": True}, "failover_group_id": {"readonly": True}, + "extended_accessibility_info": {"readonly": True}, } _attribute_map = { @@ -11162,6 +11519,10 @@ class ManagedDatabaseUpdate(_serialization.Model): "type": "str", }, "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, + "extended_accessibility_info": { + "key": "properties.extendedAccessibilityInfo", + "type": "ManagedDatabaseExtendedAccessibilityInfo", + }, } def __init__( @@ -11277,6 +11638,7 @@ def __init__( self.last_backup_name = last_backup_name self.cross_subscription_target_managed_instance_id = cross_subscription_target_managed_instance_id self.is_ledger_on = is_ledger_on + self.extended_accessibility_info: Optional["_models.ManagedDatabaseExtendedAccessibilityInfo"] = None class ManagedInstance(TrackedResource): @@ -11298,8 +11660,11 @@ class ManagedInstance(TrackedResource): :vartype tags: dict[str, str] :ivar identity: The Azure Active Directory identity of the managed instance. :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity - :ivar sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, - BC_Gen5, BC_G8IM, BC_G8IH. + :ivar sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, + Standard-series); GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, + Premium-series memory optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM + (Business Critical, Premium-series); BC_G8IH (Business Critical, Premium-series memory + optimized). :vartype sku: ~azure.mgmt.sql.models.Sku :ivar provisioning_state: Provisioning state of managed instance. Known values are: "Created", "InProgress", "Succeeded", "Failed", and "Canceled". @@ -11340,9 +11705,10 @@ class ManagedInstance(TrackedResource): 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. + :ivar v_cores: The number of vCores. Allowed values: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, + 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service tier. :vartype v_cores: int - :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. + :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :vartype storage_size_in_gb: int @@ -11352,6 +11718,10 @@ class ManagedInstance(TrackedResource): :ivar storage_throughput_mbps: Storage throughput MBps parameter is not supported in the instance create/update operation. :vartype storage_throughput_mbps: int + :ivar memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and + maximum value depend on the number of vCores and service tier. Read more about resource limits: + https://aka.ms/mi-resource-limits-api. + :vartype memory_size_in_gb: int :ivar collation: Collation of the managed instance. :vartype collation: str :ivar dns_zone: The Dns Zone that the managed instance is in. @@ -11372,12 +11742,11 @@ class ManagedInstance(TrackedResource): :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. - 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 - PowerShell. - An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + 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 PowerShell. An example of valid timezone id is + "Pacific Standard Time" or "W. Europe Standard Time". :vartype timezone_id: str :ivar instance_pool_id: The Id of the instance pool this managed server belongs to. :vartype instance_pool_id: str @@ -11400,16 +11769,16 @@ class ManagedInstance(TrackedResource): values are: "Geo", "Local", "Zone", and "GeoZone". :vartype requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar zone_redundant: Whether or not the multi-az is enabled. + :ivar zone_redundant: Whether or not the zone-redundancy is enabled. :vartype zone_redundant: bool :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :vartype primary_user_assigned_identity_id: str :ivar key_id: A CMK URI of the key to use for encryption. :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator of the instance. This can only - be used at instance create time. If used for instance update, it will be ignored or it will - result in an error. For updates individual APIs will need to be used. + :ivar administrators: The Azure Active Directory administrator can be utilized during instance + creation and for instance updates, except for the azureADOnlyAuthentication property. To update + the azureADOnlyAuthentication property, individual API must be used. :vartype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :ivar service_principal: The managed instance's service principal. :vartype service_principal: ~azure.mgmt.sql.models.ServicePrincipal @@ -11418,9 +11787,9 @@ class ManagedInstance(TrackedResource): :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 pricing_model: Pricing model of Managed Instance. Known values are: "Regular" and + "Freemium". + :vartype pricing_model: str or ~azure.mgmt.sql.models.PricingModel :ivar create_time: Specifies the point in time (ISO8601 format) of the Managed Instance creation. :vartype create_time: ~datetime.datetime @@ -11428,8 +11797,12 @@ class ManagedInstance(TrackedResource): 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". + engine version. Known values are: "AlwaysUpToDate", "SQLServer2022", and "SQLServer2025". :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat + :ivar requested_logical_availability_zone: Specifies the logical availability zone Managed + Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". + :vartype requested_logical_availability_zone: str or + ~azure.mgmt.sql.models.AvailabilityZoneType """ _validation = { @@ -11472,6 +11845,7 @@ class ManagedInstance(TrackedResource): "storage_size_in_gb": {"key": "properties.storageSizeInGB", "type": "int"}, "storage_iops": {"key": "properties.storageIOps", "type": "int"}, "storage_throughput_mbps": {"key": "properties.storageThroughputMBps", "type": "int"}, + "memory_size_in_gb": {"key": "properties.memorySizeInGB", "type": "int"}, "collation": {"key": "properties.collation", "type": "str"}, "dns_zone": {"key": "properties.dnsZone", "type": "str"}, "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, @@ -11500,6 +11874,7 @@ class ManagedInstance(TrackedResource): "create_time": {"key": "properties.createTime", "type": "iso-8601"}, "authentication_metadata": {"key": "properties.authenticationMetadata", "type": "str"}, "database_format": {"key": "properties.databaseFormat", "type": "str"}, + "requested_logical_availability_zone": {"key": "properties.requestedLogicalAvailabilityZone", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -11520,6 +11895,7 @@ def __init__( # pylint: disable=too-many-locals storage_size_in_gb: Optional[int] = None, storage_iops: Optional[int] = None, storage_throughput_mbps: Optional[int] = None, + memory_size_in_gb: Optional[int] = None, collation: Optional[str] = None, dns_zone_partner: Optional[str] = None, public_data_endpoint_enabled: Optional[bool] = None, @@ -11536,9 +11912,10 @@ 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, + pricing_model: Optional[Union[str, "_models.PricingModel"]] = None, authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, + requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, **kwargs: Any ) -> None: """ @@ -11548,8 +11925,11 @@ def __init__( # pylint: disable=too-many-locals :paramtype tags: dict[str, str] :keyword identity: The Azure Active Directory identity of the managed instance. :paramtype identity: ~azure.mgmt.sql.models.ResourceIdentity - :keyword sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5, GP_G8IM, GP_G8IH, - BC_Gen5, BC_G8IM, BC_G8IH. + :keyword sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, + Standard-series); GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, + Premium-series memory optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM + (Business Critical, Premium-series); BC_G8IH (Business Critical, Premium-series memory + optimized). :paramtype sku: ~azure.mgmt.sql.models.Sku :keyword managed_instance_create_mode: Specifies the mode of database creation. @@ -11578,9 +11958,11 @@ def __init__( # pylint: disable=too-many-locals 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. + :keyword v_cores: The number of vCores. Allowed values: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, + 48, 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service + tier. :paramtype v_cores: int - :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. + :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :paramtype storage_size_in_gb: int @@ -11590,6 +11972,10 @@ def __init__( # pylint: disable=too-many-locals :keyword storage_throughput_mbps: Storage throughput MBps parameter is not supported in the instance create/update operation. :paramtype storage_throughput_mbps: int + :keyword memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum + and maximum value depend on the number of vCores and service tier. Read more about resource + limits: https://aka.ms/mi-resource-limits-api. + :paramtype memory_size_in_gb: 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 @@ -11608,12 +11994,11 @@ 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. - 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 - PowerShell. - An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + 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 PowerShell. An example of valid timezone id is + "Pacific Standard Time" or "W. Europe Standard Time". :paramtype timezone_id: str :keyword instance_pool_id: The Id of the instance pool this managed server belongs to. :paramtype instance_pool_id: str @@ -11628,28 +12013,32 @@ def __init__( # pylint: disable=too-many-locals values are: "Geo", "Local", "Zone", and "GeoZone". :paramtype requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword zone_redundant: Whether or not the multi-az is enabled. + :keyword zone_redundant: Whether or not the zone-redundancy is enabled. :paramtype zone_redundant: bool :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :paramtype primary_user_assigned_identity_id: str :keyword key_id: A CMK URI of the key to use for encryption. :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator of the instance. This can - only be used at instance create time. If used for instance update, it will be ignored or it - will result in an error. For updates individual APIs will need to be used. + :keyword administrators: The Azure Active Directory administrator can be utilized during + instance creation and for instance updates, except for the azureADOnlyAuthentication property. + To update the azureADOnlyAuthentication property, individual API must be used. :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 pricing_model: Pricing model of Managed Instance. Known values are: "Regular" and + "Freemium". + :paramtype pricing_model: str or ~azure.mgmt.sql.models.PricingModel :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". + SQL engine version. Known values are: "AlwaysUpToDate", "SQLServer2022", and "SQLServer2025". :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat + :keyword requested_logical_availability_zone: Specifies the logical availability zone Managed + Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". + :paramtype requested_logical_availability_zone: str or + ~azure.mgmt.sql.models.AvailabilityZoneType """ super().__init__(location=location, tags=tags, **kwargs) self.identity = identity @@ -11669,6 +12058,7 @@ def __init__( # pylint: disable=too-many-locals self.storage_size_in_gb = storage_size_in_gb self.storage_iops = storage_iops self.storage_throughput_mbps = storage_throughput_mbps + self.memory_size_in_gb = memory_size_in_gb self.collation = collation self.dns_zone: Optional[str] = None self.dns_zone_partner = dns_zone_partner @@ -11694,6 +12084,7 @@ def __init__( # pylint: disable=too-many-locals self.create_time: Optional[datetime.datetime] = None self.authentication_metadata = authentication_metadata self.database_format = database_format + self.requested_logical_availability_zone = requested_logical_availability_zone class ManagedInstanceAdministrator(ProxyResource): @@ -12139,13 +12530,13 @@ class ManagedInstanceEditionCapability(_serialization.Model): :ivar name: The managed server version name. :vartype 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 supported_families: The supported families. :vartype supported_families: list[~azure.mgmt.sql.models.ManagedInstanceFamilyCapability] :ivar supported_storage_capabilities: The list of supported storage capabilities for this edition. :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. - :vartype zone_redundant: bool :ivar status: The status of the capability. Known values are: "Visible", "Available", "Default", and "Disabled". :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus @@ -12155,17 +12546,17 @@ class ManagedInstanceEditionCapability(_serialization.Model): _validation = { "name": {"readonly": True}, + "is_general_purpose_v2": {"readonly": True}, "supported_families": {"readonly": True}, "supported_storage_capabilities": {"readonly": True}, - "zone_redundant": {"readonly": True}, "status": {"readonly": True}, } _attribute_map = { "name": {"key": "name", "type": "str"}, + "is_general_purpose_v2": {"key": "isGeneralPurposeV2", "type": "bool"}, "supported_families": {"key": "supportedFamilies", "type": "[ManagedInstanceFamilyCapability]"}, "supported_storage_capabilities": {"key": "supportedStorageCapabilities", "type": "[StorageCapability]"}, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, "status": {"key": "status", "type": "str"}, "reason": {"key": "reason", "type": "str"}, } @@ -12177,9 +12568,9 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: """ super().__init__(**kwargs) self.name: Optional[str] = None + self.is_general_purpose_v2: Optional[bool] = None self.supported_families: Optional[list["_models.ManagedInstanceFamilyCapability"]] = None self.supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = None - self.zone_redundant: Optional[bool] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None self.reason = reason @@ -12357,6 +12748,8 @@ class ManagedInstanceFamilyCapability(_serialization.Model): :vartype name: str :ivar sku: SKU name. :vartype sku: str + :ivar zone_redundant: Whether or not zone redundancy is supported for the family. + :vartype zone_redundant: bool :ivar supported_license_types: List of supported license types. :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] :ivar supported_vcores_values: List of supported virtual cores values. @@ -12371,6 +12764,7 @@ class ManagedInstanceFamilyCapability(_serialization.Model): _validation = { "name": {"readonly": True}, "sku": {"readonly": True}, + "zone_redundant": {"readonly": True}, "supported_license_types": {"readonly": True}, "supported_vcores_values": {"readonly": True}, "status": {"readonly": True}, @@ -12379,6 +12773,7 @@ class ManagedInstanceFamilyCapability(_serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, "sku": {"key": "sku", "type": "str"}, + "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, "supported_license_types": {"key": "supportedLicenseTypes", "type": "[LicenseTypeCapability]"}, "supported_vcores_values": {"key": "supportedVcoresValues", "type": "[ManagedInstanceVcoresCapability]"}, "status": {"key": "status", "type": "str"}, @@ -12393,6 +12788,7 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: super().__init__(**kwargs) self.name: Optional[str] = None self.sku: Optional[str] = None + self.zone_redundant: Optional[bool] = None self.supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = None self.supported_vcores_values: Optional[list["_models.ManagedInstanceVcoresCapability"]] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None @@ -12554,6 +12950,9 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): :ivar backup_storage_redundancy: The storage redundancy type of the backup. Known values are: "Geo", "Local", "Zone", and "GeoZone". :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backup. Known values + are: "Hot" and "Archive". + :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier """ _validation = { @@ -12567,6 +12966,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): "backup_time": {"readonly": True}, "backup_expiration_time": {"readonly": True}, "backup_storage_redundancy": {"readonly": True}, + "backup_storage_access_tier": {"readonly": True}, } _attribute_map = { @@ -12580,6 +12980,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): "backup_time": {"key": "properties.backupTime", "type": "iso-8601"}, "backup_expiration_time": {"key": "properties.backupExpirationTime", "type": "iso-8601"}, "backup_storage_redundancy": {"key": "properties.backupStorageRedundancy", "type": "str"}, + "backup_storage_access_tier": {"key": "properties.backupStorageAccessTier", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: @@ -12592,6 +12993,7 @@ def __init__(self, **kwargs: Any) -> None: self.backup_time: Optional[datetime.datetime] = None self.backup_expiration_time: Optional[datetime.datetime] = None self.backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None + self.backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None class ManagedInstanceLongTermRetentionBackupListResult(_serialization.Model): # pylint: disable=name-too-long @@ -12633,6 +13035,9 @@ class ManagedInstanceLongTermRetentionPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backups. Known values + are: "Hot" and "Archive". + :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier :ivar weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. :vartype weekly_retention: str :ivar monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 format. @@ -12653,6 +13058,7 @@ class ManagedInstanceLongTermRetentionPolicy(ProxyResource): "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, + "backup_storage_access_tier": {"key": "properties.backupStorageAccessTier", "type": "str"}, "weekly_retention": {"key": "properties.weeklyRetention", "type": "str"}, "monthly_retention": {"key": "properties.monthlyRetention", "type": "str"}, "yearly_retention": {"key": "properties.yearlyRetention", "type": "str"}, @@ -12662,6 +13068,7 @@ class ManagedInstanceLongTermRetentionPolicy(ProxyResource): def __init__( self, *, + backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None, weekly_retention: Optional[str] = None, monthly_retention: Optional[str] = None, yearly_retention: Optional[str] = None, @@ -12669,6 +13076,9 @@ def __init__( **kwargs: Any ) -> None: """ + :keyword backup_storage_access_tier: The BackupStorageAccessTier for the LTR backups. Known + values are: "Hot" and "Archive". + :paramtype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier :keyword weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. :paramtype weekly_retention: str :keyword monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 @@ -12680,6 +13090,7 @@ def __init__( :paramtype week_of_year: int """ super().__init__(**kwargs) + self.backup_storage_access_tier = backup_storage_access_tier self.weekly_retention = weekly_retention self.monthly_retention = monthly_retention self.yearly_retention = yearly_retention @@ -12926,7 +13337,8 @@ class ManagedInstanceOperationSteps(_serialization.Model): :ivar current_step: The number of current operation steps. :vartype current_step: int :ivar steps_list: The operation steps list. - :vartype steps_list: list[~azure.mgmt.sql.models.UpsertManagedServerOperationStep] + :vartype steps_list: + list[~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration] """ _validation = { @@ -12938,7 +13350,7 @@ class ManagedInstanceOperationSteps(_serialization.Model): _attribute_map = { "total_steps": {"key": "totalSteps", "type": "str"}, "current_step": {"key": "currentStep", "type": "int"}, - "steps_list": {"key": "stepsList", "type": "[UpsertManagedServerOperationStep]"}, + "steps_list": {"key": "stepsList", "type": "[UpsertManagedServerOperationStepWithEstimatesAndDuration]"}, } def __init__(self, **kwargs: Any) -> None: @@ -12946,7 +13358,7 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) self.total_steps: Optional[str] = None self.current_step: Optional[int] = None - self.steps_list: Optional[list["_models.UpsertManagedServerOperationStep"]] = None + self.steps_list: Optional[list["_models.UpsertManagedServerOperationStepWithEstimatesAndDuration"]] = None class ManagedInstancePairInfo(_serialization.Model): @@ -13243,16 +13655,20 @@ class ManagedInstancePrivateLinkProperties(_serialization.Model): :vartype group_id: str :ivar required_members: The private link resource required member names. :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] """ _validation = { "group_id": {"readonly": True}, "required_members": {"readonly": True}, + "required_zone_names": {"readonly": True}, } _attribute_map = { "group_id": {"key": "groupId", "type": "str"}, "required_members": {"key": "requiredMembers", "type": "[str]"}, + "required_zone_names": {"key": "requiredZoneNames", "type": "[str]"}, } def __init__(self, **kwargs: Any) -> None: @@ -13260,6 +13676,7 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) self.group_id: Optional[str] = None self.required_members: Optional[list[str]] = None + self.required_zone_names: Optional[list[str]] = None class ManagedInstancePrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long @@ -13417,9 +13834,10 @@ class ManagedInstanceUpdate(_serialization.Model): 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. + :ivar v_cores: The number of vCores. Allowed values: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, + 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service tier. :vartype v_cores: int - :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. + :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :vartype storage_size_in_gb: int @@ -13429,6 +13847,10 @@ class ManagedInstanceUpdate(_serialization.Model): :ivar storage_throughput_mbps: Storage throughput MBps parameter is not supported in the instance create/update operation. :vartype storage_throughput_mbps: int + :ivar memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and + maximum value depend on the number of vCores and service tier. Read more about resource limits: + https://aka.ms/mi-resource-limits-api. + :vartype memory_size_in_gb: int :ivar collation: Collation of the managed instance. :vartype collation: str :ivar dns_zone: The Dns Zone that the managed instance is in. @@ -13449,12 +13871,11 @@ class ManagedInstanceUpdate(_serialization.Model): :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. - 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 - PowerShell. - An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + 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 PowerShell. An example of valid timezone id is + "Pacific Standard Time" or "W. Europe Standard Time". :vartype timezone_id: str :ivar instance_pool_id: The Id of the instance pool this managed server belongs to. :vartype instance_pool_id: str @@ -13477,16 +13898,16 @@ class ManagedInstanceUpdate(_serialization.Model): values are: "Geo", "Local", "Zone", and "GeoZone". :vartype requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar zone_redundant: Whether or not the multi-az is enabled. + :ivar zone_redundant: Whether or not the zone-redundancy is enabled. :vartype zone_redundant: bool :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :vartype primary_user_assigned_identity_id: str :ivar key_id: A CMK URI of the key to use for encryption. :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator of the instance. This can only - be used at instance create time. If used for instance update, it will be ignored or it will - result in an error. For updates individual APIs will need to be used. + :ivar administrators: The Azure Active Directory administrator can be utilized during instance + creation and for instance updates, except for the azureADOnlyAuthentication property. To update + the azureADOnlyAuthentication property, individual API must be used. :vartype administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :ivar service_principal: The managed instance's service principal. :vartype service_principal: ~azure.mgmt.sql.models.ServicePrincipal @@ -13495,9 +13916,9 @@ class ManagedInstanceUpdate(_serialization.Model): :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 pricing_model: Pricing model of Managed Instance. Known values are: "Regular" and + "Freemium". + :vartype pricing_model: str or ~azure.mgmt.sql.models.PricingModel :ivar create_time: Specifies the point in time (ISO8601 format) of the Managed Instance creation. :vartype create_time: ~datetime.datetime @@ -13505,8 +13926,12 @@ class ManagedInstanceUpdate(_serialization.Model): 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". + engine version. Known values are: "AlwaysUpToDate", "SQLServer2022", and "SQLServer2025". :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat + :ivar requested_logical_availability_zone: Specifies the logical availability zone Managed + Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". + :vartype requested_logical_availability_zone: str or + ~azure.mgmt.sql.models.AvailabilityZoneType """ _validation = { @@ -13541,6 +13966,7 @@ class ManagedInstanceUpdate(_serialization.Model): "storage_size_in_gb": {"key": "properties.storageSizeInGB", "type": "int"}, "storage_iops": {"key": "properties.storageIOps", "type": "int"}, "storage_throughput_mbps": {"key": "properties.storageThroughputMBps", "type": "int"}, + "memory_size_in_gb": {"key": "properties.memorySizeInGB", "type": "int"}, "collation": {"key": "properties.collation", "type": "str"}, "dns_zone": {"key": "properties.dnsZone", "type": "str"}, "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, @@ -13569,6 +13995,7 @@ class ManagedInstanceUpdate(_serialization.Model): "create_time": {"key": "properties.createTime", "type": "iso-8601"}, "authentication_metadata": {"key": "properties.authenticationMetadata", "type": "str"}, "database_format": {"key": "properties.databaseFormat", "type": "str"}, + "requested_logical_availability_zone": {"key": "properties.requestedLogicalAvailabilityZone", "type": "str"}, } def __init__( # pylint: disable=too-many-locals @@ -13588,6 +14015,7 @@ def __init__( # pylint: disable=too-many-locals storage_size_in_gb: Optional[int] = None, storage_iops: Optional[int] = None, storage_throughput_mbps: Optional[int] = None, + memory_size_in_gb: Optional[int] = None, collation: Optional[str] = None, dns_zone_partner: Optional[str] = None, public_data_endpoint_enabled: Optional[bool] = None, @@ -13604,9 +14032,10 @@ 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, + pricing_model: Optional[Union[str, "_models.PricingModel"]] = None, authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, + requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, **kwargs: Any ) -> None: """ @@ -13643,9 +14072,11 @@ def __init__( # pylint: disable=too-many-locals 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. + :keyword v_cores: The number of vCores. Allowed values: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, + 48, 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service + tier. :paramtype v_cores: int - :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 16384. + :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. Increments of 32 GB allowed only. Maximum value depends on the selected hardware family and number of vCores. :paramtype storage_size_in_gb: int @@ -13655,6 +14086,10 @@ def __init__( # pylint: disable=too-many-locals :keyword storage_throughput_mbps: Storage throughput MBps parameter is not supported in the instance create/update operation. :paramtype storage_throughput_mbps: int + :keyword memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum + and maximum value depend on the number of vCores and service tier. Read more about resource + limits: https://aka.ms/mi-resource-limits-api. + :paramtype memory_size_in_gb: 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 @@ -13673,12 +14108,11 @@ 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. - 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 - PowerShell. - An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". + 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 PowerShell. An example of valid timezone id is + "Pacific Standard Time" or "W. Europe Standard Time". :paramtype timezone_id: str :keyword instance_pool_id: The Id of the instance pool this managed server belongs to. :paramtype instance_pool_id: str @@ -13693,28 +14127,32 @@ def __init__( # pylint: disable=too-many-locals values are: "Geo", "Local", "Zone", and "GeoZone". :paramtype requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword zone_redundant: Whether or not the multi-az is enabled. + :keyword zone_redundant: Whether or not the zone-redundancy is enabled. :paramtype zone_redundant: bool :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be used by default. :paramtype primary_user_assigned_identity_id: str :keyword key_id: A CMK URI of the key to use for encryption. :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator of the instance. This can - only be used at instance create time. If used for instance update, it will be ignored or it - will result in an error. For updates individual APIs will need to be used. + :keyword administrators: The Azure Active Directory administrator can be utilized during + instance creation and for instance updates, except for the azureADOnlyAuthentication property. + To update the azureADOnlyAuthentication property, individual API must be used. :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 pricing_model: Pricing model of Managed Instance. Known values are: "Regular" and + "Freemium". + :paramtype pricing_model: str or ~azure.mgmt.sql.models.PricingModel :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". + SQL engine version. Known values are: "AlwaysUpToDate", "SQLServer2022", and "SQLServer2025". :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat + :keyword requested_logical_availability_zone: Specifies the logical availability zone Managed + Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". + :paramtype requested_logical_availability_zone: str or + ~azure.mgmt.sql.models.AvailabilityZoneType """ super().__init__(**kwargs) self.sku = sku @@ -13735,6 +14173,7 @@ def __init__( # pylint: disable=too-many-locals self.storage_size_in_gb = storage_size_in_gb self.storage_iops = storage_iops self.storage_throughput_mbps = storage_throughput_mbps + self.memory_size_in_gb = memory_size_in_gb self.collation = collation self.dns_zone: Optional[str] = None self.dns_zone_partner = dns_zone_partner @@ -13760,6 +14199,33 @@ def __init__( # pylint: disable=too-many-locals self.create_time: Optional[datetime.datetime] = None self.authentication_metadata = authentication_metadata self.database_format = database_format + self.requested_logical_availability_zone = requested_logical_availability_zone + + +class ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest(_serialization.Model): # pylint: disable=name-too-long + """Validate azure key vault encryption key. + + All required parameters must be populated in order to send to server. + + :ivar tde_key_uri: The URI of the key. Required. + :vartype tde_key_uri: str + """ + + _validation = { + "tde_key_uri": {"required": True}, + } + + _attribute_map = { + "tde_key_uri": {"key": "tdeKeyUri", "type": "str"}, + } + + def __init__(self, *, tde_key_uri: str, **kwargs: Any) -> None: + """ + :keyword tde_key_uri: The URI of the key. Required. + :paramtype tde_key_uri: str + """ + super().__init__(**kwargs) + self.tde_key_uri = tde_key_uri class ManagedInstanceVcoresCapability(_serialization.Model): @@ -13771,10 +14237,34 @@ class ManagedInstanceVcoresCapability(_serialization.Model): :vartype name: str :ivar value: The virtual cores value. :vartype value: int + :ivar supported_memory_limits_mb: Memory limit MB ranges. + :vartype supported_memory_limits_mb: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar supported_memory_sizes_in_gb: Supported memory sizes in GB. + :vartype supported_memory_sizes_in_gb: ~azure.mgmt.sql.models.MaxLimitRangeCapability :ivar included_max_size: Included size. :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability :ivar supported_storage_sizes: Storage size ranges. :vartype supported_storage_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] + :ivar included_storage_i_ops: Included storage IOps. + :vartype included_storage_i_ops: int + :ivar supported_storage_i_ops: Storage IOps ranges. + :vartype supported_storage_i_ops: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar iops_min_value_override_factor_per_selected_storage_gb: Min IOps override factor per + selected storage GB. + :vartype iops_min_value_override_factor_per_selected_storage_gb: float + :ivar iops_included_value_override_factor_per_selected_storage_gb: Included IOps override + factor per selected storage GB. + :vartype iops_included_value_override_factor_per_selected_storage_gb: float + :ivar included_storage_throughput_m_bps: Included storage throughput MBps. + :vartype included_storage_throughput_m_bps: int + :ivar supported_storage_throughput_m_bps: Storage throughput MBps ranges. + :vartype supported_storage_throughput_m_bps: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Min throughput MBps + override factor per selected storage GB. + :vartype throughput_m_bps_min_value_override_factor_per_selected_storage_gb: float + :ivar throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Included + throughput MBps override factor per selected storage GB. + :vartype throughput_m_bps_included_value_override_factor_per_selected_storage_gb: float :ivar instance_pool_supported: True if this service objective is supported for managed instances in an instance pool. :vartype instance_pool_supported: bool @@ -13794,8 +14284,18 @@ class ManagedInstanceVcoresCapability(_serialization.Model): _validation = { "name": {"readonly": True}, "value": {"readonly": True}, + "supported_memory_limits_mb": {"readonly": True}, + "supported_memory_sizes_in_gb": {"readonly": True}, "included_max_size": {"readonly": True}, "supported_storage_sizes": {"readonly": True}, + "included_storage_i_ops": {"readonly": True}, + "supported_storage_i_ops": {"readonly": True}, + "iops_min_value_override_factor_per_selected_storage_gb": {"readonly": True}, + "iops_included_value_override_factor_per_selected_storage_gb": {"readonly": True}, + "included_storage_throughput_m_bps": {"readonly": True}, + "supported_storage_throughput_m_bps": {"readonly": True}, + "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": {"readonly": True}, + "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": {"readonly": True}, "instance_pool_supported": {"readonly": True}, "standalone_supported": {"readonly": True}, "supported_maintenance_configurations": {"readonly": True}, @@ -13805,8 +14305,33 @@ class ManagedInstanceVcoresCapability(_serialization.Model): _attribute_map = { "name": {"key": "name", "type": "str"}, "value": {"key": "value", "type": "int"}, + "supported_memory_limits_mb": {"key": "supportedMemoryLimitsMB", "type": "MaxLimitRangeCapability"}, + "supported_memory_sizes_in_gb": {"key": "supportedMemorySizesInGB", "type": "MaxLimitRangeCapability"}, "included_max_size": {"key": "includedMaxSize", "type": "MaxSizeCapability"}, "supported_storage_sizes": {"key": "supportedStorageSizes", "type": "[MaxSizeRangeCapability]"}, + "included_storage_i_ops": {"key": "includedStorageIOps", "type": "int"}, + "supported_storage_i_ops": {"key": "supportedStorageIOps", "type": "MaxLimitRangeCapability"}, + "iops_min_value_override_factor_per_selected_storage_gb": { + "key": "iopsMinValueOverrideFactorPerSelectedStorageGB", + "type": "float", + }, + "iops_included_value_override_factor_per_selected_storage_gb": { + "key": "iopsIncludedValueOverrideFactorPerSelectedStorageGB", + "type": "float", + }, + "included_storage_throughput_m_bps": {"key": "includedStorageThroughputMBps", "type": "int"}, + "supported_storage_throughput_m_bps": { + "key": "supportedStorageThroughputMBps", + "type": "MaxLimitRangeCapability", + }, + "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": { + "key": "throughputMBpsMinValueOverrideFactorPerSelectedStorageGB", + "type": "float", + }, + "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": { + "key": "throughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB", + "type": "float", + }, "instance_pool_supported": {"key": "instancePoolSupported", "type": "bool"}, "standalone_supported": {"key": "standaloneSupported", "type": "bool"}, "supported_maintenance_configurations": { @@ -13825,8 +14350,18 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: super().__init__(**kwargs) self.name: Optional[str] = None self.value: Optional[int] = None + self.supported_memory_limits_mb: Optional["_models.MaxLimitRangeCapability"] = None + self.supported_memory_sizes_in_gb: Optional["_models.MaxLimitRangeCapability"] = None self.included_max_size: Optional["_models.MaxSizeCapability"] = None self.supported_storage_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = None + self.included_storage_i_ops: Optional[int] = None + self.supported_storage_i_ops: Optional["_models.MaxLimitRangeCapability"] = None + self.iops_min_value_override_factor_per_selected_storage_gb: Optional[float] = None + self.iops_included_value_override_factor_per_selected_storage_gb: Optional[float] = None + self.included_storage_throughput_m_bps: Optional[int] = None + self.supported_storage_throughput_m_bps: Optional["_models.MaxLimitRangeCapability"] = None + self.throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Optional[float] = None + self.throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Optional[float] = None self.instance_pool_supported: Optional[bool] = None self.standalone_supported: Optional[bool] = None self.supported_maintenance_configurations: Optional[ @@ -14390,12 +14925,59 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None -class MaxSizeCapability(_serialization.Model): - """The maximum size capability. +class MaxLimitRangeCapability(_serialization.Model): + """The maximum limit range capability. Variables are only populated by the server, and will be ignored when sending a request. - :ivar limit: The maximum size limit (see 'unit' for the units). + :ivar min_value: Minimum value. + :vartype min_value: int + :ivar max_value: Maximum value. + :vartype max_value: int + :ivar scale_size: Scale/step size for discrete values between the minimum value and the maximum + value. + :vartype scale_size: int + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + _validation = { + "min_value": {"readonly": True}, + "max_value": {"readonly": True}, + "scale_size": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "min_value": {"key": "minValue", "type": "int"}, + "max_value": {"key": "maxValue", "type": "int"}, + "scale_size": {"key": "scaleSize", "type": "int"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.min_value: Optional[int] = None + self.max_value: Optional[int] = None + self.scale_size: Optional[int] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason + + +class MaxSizeCapability(_serialization.Model): + """The maximum size capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar limit: The maximum size limit (see 'unit' for the units). :vartype limit: int :ivar unit: The units that the limit is expressed in. Known values are: "Megabytes", "Gigabytes", "Terabytes", and "Petabytes". @@ -14471,356 +15053,567 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: self.reason = reason -class Metric(_serialization.Model): - """Database metrics. +class MinCapacityCapability(_serialization.Model): + """The min capacity capability. Variables are only populated by the server, and will be ignored when sending a request. - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: ~datetime.datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: ~datetime.datetime - :ivar time_grain: The time step to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Known values are: "count", "bytes", "seconds", "percent", - "countPerSecond", and "bytesPerSecond". - :vartype unit: str or ~azure.mgmt.sql.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar metric_values: The metric values for the specified time window and timestep. - :vartype metric_values: list[~azure.mgmt.sql.models.MetricValue] + :ivar value: Min capacity value. + :vartype value: float + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str """ _validation = { - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "time_grain": {"readonly": True}, - "unit": {"readonly": True}, - "name": {"readonly": True}, - "metric_values": {"readonly": True}, + "value": {"readonly": True}, + "status": {"readonly": True}, } _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "time_grain": {"key": "timeGrain", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "name": {"key": "name", "type": "MetricName"}, - "metric_values": {"key": "metricValues", "type": "[MetricValue]"}, + "value": {"key": "value", "type": "float"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ super().__init__(**kwargs) - self.start_time: Optional[datetime.datetime] = None - self.end_time: Optional[datetime.datetime] = None - self.time_grain: Optional[str] = None - self.unit: Optional[Union[str, "_models.UnitType"]] = None - self.name: Optional["_models.MetricName"] = None - self.metric_values: Optional[list["_models.MetricValue"]] = None - + self.value: Optional[float] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason -class MetricAvailability(_serialization.Model): - """A metric availability value. - Variables are only populated by the server, and will be ignored when sending a request. +class Name(_serialization.Model): + """ARM Usage Name. - :ivar retention: The length of retention for the database metric. - :vartype retention: str - :ivar time_grain: The granularity of the database metric. - :vartype time_grain: str + :ivar value: Usage name value. + :vartype value: str + :ivar localized_value: Usage name localized value. + :vartype localized_value: str """ - _validation = { - "retention": {"readonly": True}, - "time_grain": {"readonly": True}, - } - _attribute_map = { - "retention": {"key": "retention", "type": "str"}, - "time_grain": {"key": "timeGrain", "type": "str"}, + "value": {"key": "value", "type": "str"}, + "localized_value": {"key": "localizedValue", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword value: Usage name value. + :paramtype value: str + :keyword localized_value: Usage name localized value. + :paramtype localized_value: str + """ super().__init__(**kwargs) - self.retention: Optional[str] = None - self.time_grain: Optional[str] = None - + self.value = value + self.localized_value = localized_value -class MetricDefinition(_serialization.Model): - """A database metric definition. - Variables are only populated by the server, and will be ignored when sending a request. +class NetworkIsolationSettings(_serialization.Model): + """Contains the ARM resources for which to create private endpoint connection. - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar primary_aggregation_type: The primary aggregation type defining how metric values are - displayed. Known values are: "None", "Average", "Count", "Minimum", "Maximum", and "Total". - :vartype primary_aggregation_type: str or ~azure.mgmt.sql.models.PrimaryAggregationType - :ivar resource_uri: The resource uri of the database. - :vartype resource_uri: str - :ivar unit: The unit of the metric. Known values are: "Count", "Bytes", "Seconds", "Percent", - "CountPerSecond", and "BytesPerSecond". - :vartype unit: str or ~azure.mgmt.sql.models.UnitDefinitionType - :ivar metric_availabilities: The list of database metric availabilities for the metric. - :vartype metric_availabilities: list[~azure.mgmt.sql.models.MetricAvailability] + :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC + file. If set, private endpoint connection will be created for the storage account. Must match + storage account used for StorageUri parameter. + :vartype storage_account_resource_id: str + :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this + request. If set, private endpoint connection will be created for the SQL server. Must match + server which is target of the operation. + :vartype sql_server_resource_id: str """ - _validation = { - "name": {"readonly": True}, - "primary_aggregation_type": {"readonly": True}, - "resource_uri": {"readonly": True}, - "unit": {"readonly": True}, - "metric_availabilities": {"readonly": True}, - } - _attribute_map = { - "name": {"key": "name", "type": "MetricName"}, - "primary_aggregation_type": {"key": "primaryAggregationType", "type": "str"}, - "resource_uri": {"key": "resourceUri", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "metric_availabilities": {"key": "metricAvailabilities", "type": "[MetricAvailability]"}, + "storage_account_resource_id": {"key": "storageAccountResourceId", "type": "str"}, + "sql_server_resource_id": {"key": "sqlServerResourceId", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + sql_server_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword storage_account_resource_id: The resource id for the storage account used to store + BACPAC file. If set, private endpoint connection will be created for the storage account. Must + match storage account used for StorageUri parameter. + :paramtype storage_account_resource_id: str + :keyword sql_server_resource_id: The resource id for the SQL server which is the target of this + request. If set, private endpoint connection will be created for the SQL server. Must match + server which is target of the operation. + :paramtype sql_server_resource_id: str + """ super().__init__(**kwargs) - self.name: Optional["_models.MetricName"] = None - self.primary_aggregation_type: Optional[Union[str, "_models.PrimaryAggregationType"]] = None - self.resource_uri: Optional[str] = None - self.unit: Optional[Union[str, "_models.UnitDefinitionType"]] = None - self.metric_availabilities: Optional[list["_models.MetricAvailability"]] = None - + self.storage_account_resource_id = storage_account_resource_id + self.sql_server_resource_id = sql_server_resource_id -class MetricDefinitionListResult(_serialization.Model): - """The response to a list database metric definitions request. - All required parameters must be populated in order to send to server. +class NetworkIsolationSettingsAutoGenerated(_serialization.Model): + """Contains the ARM resources for which to create private endpoint connection. - :ivar value: The list of metric definitions for the database. Required. - :vartype value: list[~azure.mgmt.sql.models.MetricDefinition] + :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC + file. If set, private endpoint connection will be created for the storage account. Must match + storage account used for StorageUri parameter. + :vartype storage_account_resource_id: str + :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this + request. If set, private endpoint connection will be created for the SQL server. Must match + server which is target of the operation. + :vartype sql_server_resource_id: str """ - _validation = { - "value": {"required": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[MetricDefinition]"}, + "storage_account_resource_id": {"key": "storageAccountResourceId", "type": "str"}, + "sql_server_resource_id": {"key": "sqlServerResourceId", "type": "str"}, } - def __init__(self, *, value: list["_models.MetricDefinition"], **kwargs: Any) -> None: + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + sql_server_resource_id: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword value: The list of metric definitions for the database. Required. - :paramtype value: list[~azure.mgmt.sql.models.MetricDefinition] + :keyword storage_account_resource_id: The resource id for the storage account used to store + BACPAC file. If set, private endpoint connection will be created for the storage account. Must + match storage account used for StorageUri parameter. + :paramtype storage_account_resource_id: str + :keyword sql_server_resource_id: The resource id for the SQL server which is the target of this + request. If set, private endpoint connection will be created for the SQL server. Must match + server which is target of the operation. + :paramtype sql_server_resource_id: str """ super().__init__(**kwargs) - self.value = value + self.storage_account_resource_id = storage_account_resource_id + self.sql_server_resource_id = sql_server_resource_id -class MetricListResult(_serialization.Model): - """The response to a list database metrics request. +class NetworkSecurityPerimeterConfiguration(ProxyResource): + """NSP Configuration for a server. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of metrics for the database. Required. - :vartype value: list[~azure.mgmt.sql.models.Metric] + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar provisioning_state: + :vartype provisioning_state: str + :ivar network_security_perimeter: + :vartype network_security_perimeter: ~azure.mgmt.sql.models.NSPConfigPerimeter + :ivar resource_association: + :vartype resource_association: ~azure.mgmt.sql.models.NSPConfigAssociation + :ivar profile: + :vartype profile: ~azure.mgmt.sql.models.NSPConfigProfile + :ivar provisioning_issues: + :vartype provisioning_issues: list[~azure.mgmt.sql.models.NSPProvisioningIssue] """ _validation = { - "value": {"required": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "provisioning_state": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[Metric]"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "network_security_perimeter": {"key": "properties.networkSecurityPerimeter", "type": "NSPConfigPerimeter"}, + "resource_association": {"key": "properties.resourceAssociation", "type": "NSPConfigAssociation"}, + "profile": {"key": "properties.profile", "type": "NSPConfigProfile"}, + "provisioning_issues": {"key": "properties.provisioningIssues", "type": "[NSPProvisioningIssue]"}, } - def __init__(self, *, value: list["_models.Metric"], **kwargs: Any) -> None: + def __init__( + self, + *, + network_security_perimeter: Optional["_models.NSPConfigPerimeter"] = None, + resource_association: Optional["_models.NSPConfigAssociation"] = None, + profile: Optional["_models.NSPConfigProfile"] = None, + provisioning_issues: Optional[list["_models.NSPProvisioningIssue"]] = None, + **kwargs: Any + ) -> None: """ - :keyword value: The list of metrics for the database. Required. - :paramtype value: list[~azure.mgmt.sql.models.Metric] + :keyword network_security_perimeter: + :paramtype network_security_perimeter: ~azure.mgmt.sql.models.NSPConfigPerimeter + :keyword resource_association: + :paramtype resource_association: ~azure.mgmt.sql.models.NSPConfigAssociation + :keyword profile: + :paramtype profile: ~azure.mgmt.sql.models.NSPConfigProfile + :keyword provisioning_issues: + :paramtype provisioning_issues: list[~azure.mgmt.sql.models.NSPProvisioningIssue] """ super().__init__(**kwargs) - self.value = value + self.provisioning_state: Optional[str] = None + self.network_security_perimeter = network_security_perimeter + self.resource_association = resource_association + self.profile = profile + self.provisioning_issues = provisioning_issues -class MetricName(_serialization.Model): - """A database metric name. +class NetworkSecurityPerimeterConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long + """A list of NSP configurations for a server. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The name of the database metric. - :vartype value: str - :ivar localized_value: The friendly name of the database metric. - :vartype localized_value: str + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { "value": {"readonly": True}, - "localized_value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "str"}, - "localized_value": {"key": "localizedValue", "type": "str"}, + "value": {"key": "value", "type": "[NetworkSecurityPerimeterConfiguration]"}, + "next_link": {"key": "nextLink", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.value: Optional[str] = None - self.localized_value: Optional[str] = None - + self.value: Optional[list["_models.NetworkSecurityPerimeterConfiguration"]] = None + self.next_link: Optional[str] = None -class MetricValue(_serialization.Model): - """Represents database metrics. - Variables are only populated by the server, and will be ignored when sending a request. +class NSPConfigAccessRule(_serialization.Model): + """NSPConfigAccessRule. - :ivar count: The number of values for the metric. - :vartype count: int - :ivar average: The average value of the metric. - :vartype average: float - :ivar maximum: The max value of the metric. - :vartype maximum: float - :ivar minimum: The min value of the metric. - :vartype minimum: float - :ivar timestamp: The metric timestamp (ISO-8601 format). - :vartype timestamp: ~datetime.datetime - :ivar total: The total value of the metric. - :vartype total: float + :ivar name: + :vartype name: str + :ivar properties: + :vartype properties: ~azure.mgmt.sql.models.NSPConfigAccessRuleProperties """ - _validation = { - "count": {"readonly": True}, - "average": {"readonly": True}, - "maximum": {"readonly": True}, - "minimum": {"readonly": True}, - "timestamp": {"readonly": True}, - "total": {"readonly": True}, + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "NSPConfigAccessRuleProperties"}, } - _attribute_map = { - "count": {"key": "count", "type": "int"}, - "average": {"key": "average", "type": "float"}, - "maximum": {"key": "maximum", "type": "float"}, - "minimum": {"key": "minimum", "type": "float"}, - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "total": {"key": "total", "type": "float"}, + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.NSPConfigAccessRuleProperties"] = None, + **kwargs: Any + ) -> None: + """ + :keyword name: + :paramtype name: str + :keyword properties: + :paramtype properties: ~azure.mgmt.sql.models.NSPConfigAccessRuleProperties + """ + super().__init__(**kwargs) + self.name = name + self.properties = properties + + +class NSPConfigAccessRuleProperties(_serialization.Model): + """NSPConfigAccessRuleProperties. + + :ivar direction: + :vartype direction: str + :ivar address_prefixes: + :vartype address_prefixes: list[str] + :ivar fully_qualified_domain_names: + :vartype fully_qualified_domain_names: list[str] + :ivar subscriptions: + :vartype subscriptions: list[str] + :ivar network_security_perimeters: + :vartype network_security_perimeters: + list[~azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule] + :ivar service_tags: + :vartype service_tags: list[str] + """ + + _attribute_map = { + "direction": {"key": "direction", "type": "str"}, + "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, + "fully_qualified_domain_names": {"key": "fullyQualifiedDomainNames", "type": "[str]"}, + "subscriptions": {"key": "subscriptions", "type": "[str]"}, + "network_security_perimeters": { + "key": "networkSecurityPerimeters", + "type": "[NSPConfigNetworkSecurityPerimeterRule]", + }, + "service_tags": {"key": "serviceTags", "type": "[str]"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + direction: Optional[str] = None, + address_prefixes: Optional[list[str]] = None, + fully_qualified_domain_names: Optional[list[str]] = None, + subscriptions: Optional[list[str]] = None, + network_security_perimeters: Optional[list["_models.NSPConfigNetworkSecurityPerimeterRule"]] = None, + service_tags: Optional[list[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword direction: + :paramtype direction: str + :keyword address_prefixes: + :paramtype address_prefixes: list[str] + :keyword fully_qualified_domain_names: + :paramtype fully_qualified_domain_names: list[str] + :keyword subscriptions: + :paramtype subscriptions: list[str] + :keyword network_security_perimeters: + :paramtype network_security_perimeters: + list[~azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule] + :keyword service_tags: + :paramtype service_tags: list[str] + """ super().__init__(**kwargs) - self.count: Optional[int] = None - self.average: Optional[float] = None - self.maximum: Optional[float] = None - self.minimum: Optional[float] = None - self.timestamp: Optional[datetime.datetime] = None - self.total: Optional[float] = None + self.direction = direction + self.address_prefixes = address_prefixes + self.fully_qualified_domain_names = fully_qualified_domain_names + self.subscriptions = subscriptions + self.network_security_perimeters = network_security_perimeters + self.service_tags = service_tags -class MinCapacityCapability(_serialization.Model): - """The min capacity capability. +class NSPConfigAssociation(_serialization.Model): + """NSPConfigAssociation. - Variables are only populated by the server, and will be ignored when sending a request. + :ivar name: + :vartype name: str + :ivar access_mode: + :vartype access_mode: str + """ - :ivar value: Min capacity value. - :vartype value: float - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str + _attribute_map = { + "name": {"key": "name", "type": "str"}, + "access_mode": {"key": "accessMode", "type": "str"}, + } + + def __init__(self, *, name: Optional[str] = None, access_mode: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: + :paramtype name: str + :keyword access_mode: + :paramtype access_mode: str + """ + super().__init__(**kwargs) + self.name = name + self.access_mode = access_mode + + +class NSPConfigNetworkSecurityPerimeterRule(_serialization.Model): + """NSPConfigNetworkSecurityPerimeterRule. + + :ivar id: + :vartype id: str + :ivar perimeter_guid: + :vartype perimeter_guid: str + :ivar location: + :vartype location: str """ - _validation = { - "value": {"readonly": True}, - "status": {"readonly": True}, + _attribute_map = { + "id": {"key": "id", "type": "str"}, + "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, + "location": {"key": "location", "type": "str"}, } + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + perimeter_guid: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword id: + :paramtype id: str + :keyword perimeter_guid: + :paramtype perimeter_guid: str + :keyword location: + :paramtype location: str + """ + super().__init__(**kwargs) + self.id = id + self.perimeter_guid = perimeter_guid + self.location = location + + +class NSPConfigPerimeter(_serialization.Model): + """NSPConfigPerimeter. + + :ivar id: + :vartype id: str + :ivar perimeter_guid: + :vartype perimeter_guid: str + :ivar location: + :vartype location: str + """ + _attribute_map = { - "value": {"key": "value", "type": "float"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, + "location": {"key": "location", "type": "str"}, } - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + perimeter_guid: Optional[str] = None, + location: Optional[str] = None, + **kwargs: Any + ) -> None: """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str + :keyword id: + :paramtype id: str + :keyword perimeter_guid: + :paramtype perimeter_guid: str + :keyword location: + :paramtype location: str """ super().__init__(**kwargs) - self.value: Optional[float] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason + self.id = id + self.perimeter_guid = perimeter_guid + self.location = location -class Name(_serialization.Model): - """ARM Usage Name. +class NSPConfigProfile(_serialization.Model): + """NSPConfigProfile. - :ivar value: Usage name value. - :vartype value: str - :ivar localized_value: Usage name localized value. - :vartype localized_value: str + :ivar name: + :vartype name: str + :ivar access_rules_version: + :vartype access_rules_version: str + :ivar access_rules: + :vartype access_rules: list[~azure.mgmt.sql.models.NSPConfigAccessRule] """ _attribute_map = { - "value": {"key": "value", "type": "str"}, - "localized_value": {"key": "localizedValue", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "access_rules_version": {"key": "accessRulesVersion", "type": "str"}, + "access_rules": {"key": "accessRules", "type": "[NSPConfigAccessRule]"}, } - def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + name: Optional[str] = None, + access_rules_version: Optional[str] = None, + access_rules: Optional[list["_models.NSPConfigAccessRule"]] = None, + **kwargs: Any + ) -> None: """ - :keyword value: Usage name value. - :paramtype value: str - :keyword localized_value: Usage name localized value. - :paramtype localized_value: str + :keyword name: + :paramtype name: str + :keyword access_rules_version: + :paramtype access_rules_version: str + :keyword access_rules: + :paramtype access_rules: list[~azure.mgmt.sql.models.NSPConfigAccessRule] """ super().__init__(**kwargs) - self.value = value - self.localized_value = localized_value + self.name = name + self.access_rules_version = access_rules_version + self.access_rules = access_rules -class NetworkIsolationSettings(_serialization.Model): - """Contains the ARM resources for which to create private endpoint connection. +class NSPProvisioningIssue(_serialization.Model): + """NSPProvisioningIssue. - :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC - file. If set, private endpoint connection will be created for the storage account. Must match - storage account used for StorageUri parameter. - :vartype storage_account_resource_id: str - :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :vartype sql_server_resource_id: str + :ivar name: + :vartype name: str + :ivar properties: + :vartype properties: ~azure.mgmt.sql.models.NSPProvisioningIssueProperties """ _attribute_map = { - "storage_account_resource_id": {"key": "storageAccountResourceId", "type": "str"}, - "sql_server_resource_id": {"key": "sqlServerResourceId", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "properties": {"key": "properties", "type": "NSPProvisioningIssueProperties"}, } def __init__( self, *, - storage_account_resource_id: Optional[str] = None, - sql_server_resource_id: Optional[str] = None, + name: Optional[str] = None, + properties: Optional["_models.NSPProvisioningIssueProperties"] = None, **kwargs: Any ) -> None: """ - :keyword storage_account_resource_id: The resource id for the storage account used to store - BACPAC file. If set, private endpoint connection will be created for the storage account. Must - match storage account used for StorageUri parameter. - :paramtype storage_account_resource_id: str - :keyword sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :paramtype sql_server_resource_id: str + :keyword name: + :paramtype name: str + :keyword properties: + :paramtype properties: ~azure.mgmt.sql.models.NSPProvisioningIssueProperties + """ + super().__init__(**kwargs) + self.name = name + self.properties = properties + + +class NSPProvisioningIssueProperties(_serialization.Model): + """NSPProvisioningIssueProperties. + + :ivar issue_type: + :vartype issue_type: str + :ivar severity: + :vartype severity: str + :ivar description: + :vartype description: str + :ivar suggested_resource_ids: + :vartype suggested_resource_ids: list[str] + :ivar suggested_access_rules: + :vartype suggested_access_rules: list[str] + """ + + _attribute_map = { + "issue_type": {"key": "issueType", "type": "str"}, + "severity": {"key": "severity", "type": "str"}, + "description": {"key": "description", "type": "str"}, + "suggested_resource_ids": {"key": "suggestedResourceIds", "type": "[str]"}, + "suggested_access_rules": {"key": "suggestedAccessRules", "type": "[str]"}, + } + + def __init__( + self, + *, + issue_type: Optional[str] = None, + severity: Optional[str] = None, + description: Optional[str] = None, + suggested_resource_ids: Optional[list[str]] = None, + suggested_access_rules: Optional[list[str]] = None, + **kwargs: Any + ) -> None: + """ + :keyword issue_type: + :paramtype issue_type: str + :keyword severity: + :paramtype severity: str + :keyword description: + :paramtype description: str + :keyword suggested_resource_ids: + :paramtype suggested_resource_ids: list[str] + :keyword suggested_access_rules: + :paramtype suggested_access_rules: list[str] """ super().__init__(**kwargs) - self.storage_account_resource_id = storage_account_resource_id - self.sql_server_resource_id = sql_server_resource_id + self.issue_type = issue_type + self.severity = severity + self.description = description + self.suggested_resource_ids = suggested_resource_ids + self.suggested_access_rules = suggested_access_rules class Operation(_serialization.Model): @@ -14900,44 +15693,6 @@ def __init__(self, **kwargs: Any) -> None: self.description: Optional[str] = None -class OperationImpact(_serialization.Model): - """The impact of an operation, both in absolute and relative terms. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the impact dimension. - :vartype name: str - :ivar unit: The unit in which estimated impact to dimension is measured. - :vartype unit: str - :ivar change_value_absolute: The absolute impact to dimension. - :vartype change_value_absolute: float - :ivar change_value_relative: The relative impact to dimension (null if not applicable). - :vartype change_value_relative: float - """ - - _validation = { - "name": {"readonly": True}, - "unit": {"readonly": True}, - "change_value_absolute": {"readonly": True}, - "change_value_relative": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "change_value_absolute": {"key": "changeValueAbsolute", "type": "float"}, - "change_value_relative": {"key": "changeValueRelative", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.unit: Optional[str] = None - self.change_value_absolute: Optional[float] = None - self.change_value_relative: Optional[float] = None - - class OperationListResult(_serialization.Model): """Result of the request to list SQL operations. @@ -15158,6 +15913,55 @@ def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: self.replication_role: Optional[Union[str, "_models.InstanceFailoverGroupReplicationRole"]] = None +class PerDatabaseAutoPauseDelayTimeRange(_serialization.Model): + """Supported auto pause delay time range. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar min_value: Minimum value. + :vartype min_value: int + :ivar max_value: Maximum value. + :vartype max_value: int + :ivar step_size: Step value for discrete values between the minimum value and the maximum + value. + :vartype step_size: int + :ivar default: Default value if no value is provided. + :vartype default: int + :ivar unit: Unit of time that delay is expressed in. "Minutes" + :vartype unit: str or ~azure.mgmt.sql.models.PauseDelayTimeUnit + :ivar do_not_pause_value: Value that is used to not pause (infinite delay before pause). + :vartype do_not_pause_value: int + """ + + _validation = { + "min_value": {"readonly": True}, + "max_value": {"readonly": True}, + "step_size": {"readonly": True}, + "default": {"readonly": True}, + "unit": {"readonly": True}, + "do_not_pause_value": {"readonly": True}, + } + + _attribute_map = { + "min_value": {"key": "minValue", "type": "int"}, + "max_value": {"key": "maxValue", "type": "int"}, + "step_size": {"key": "stepSize", "type": "int"}, + "default": {"key": "default", "type": "int"}, + "unit": {"key": "unit", "type": "str"}, + "do_not_pause_value": {"key": "doNotPauseValue", "type": "int"}, + } + + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.min_value: Optional[int] = None + self.max_value: Optional[int] = None + self.step_size: Optional[int] = None + self.default: Optional[int] = None + self.unit: Optional[Union[str, "_models.PauseDelayTimeUnit"]] = None + self.do_not_pause_value: Optional[int] = None + + class PerformanceLevelCapability(_serialization.Model): """The performance level capability. @@ -15632,46 +16436,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: Optional[str] = None - self.interval_type: Optional[Union[str, "_models.QueryTimeGrainType"]] = None - self.execution_count: Optional[int] = None - self.metrics = metrics - - class QueryMetricProperties(_serialization.Model): """Properties of a topquery metric in one interval. @@ -15807,7 +16571,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 = { @@ -15822,15 +16586,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: Optional[str] = None @@ -15865,18 +16627,201 @@ class ReadScaleCapability(_serialization.Model): "reason": {"key": "reason", "type": "str"}, } - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.max_number_of_replicas: Optional[int] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason + + +class RecommendedAction(_serialization.Model): + """Database, Server or Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar recommendation_reason: Gets the reason for recommending this action. e.g., + DuplicateIndex. + :vartype recommendation_reason: str + :ivar valid_since: Gets the time since when this recommended action is valid. + :vartype valid_since: ~datetime.datetime + :ivar last_refresh: Gets time when this recommended action was last refreshed. + :vartype last_refresh: ~datetime.datetime + :ivar state: Gets the info of the current state the recommended action is in. + :vartype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo + :ivar is_executable_action: Gets if this recommended action is actionable by user. + :vartype is_executable_action: bool + :ivar is_revertable_action: Gets if changes applied by this recommended action can be reverted + by user. + :vartype is_revertable_action: bool + :ivar is_archived_action: Gets if this recommended action was suggested some time ago but user + chose to ignore this and system added a new recommended action again. + :vartype is_archived_action: bool + :ivar execute_action_start_time: Gets the time when system started applying this recommended + action on the user resource. e.g., index creation start time. + :vartype execute_action_start_time: ~datetime.datetime + :ivar execute_action_duration: Gets the time taken for applying this recommended action on user + resource. e.g., time taken for index creation. + :vartype execute_action_duration: ~datetime.timedelta + :ivar revert_action_start_time: Gets the time when system started reverting changes of this + recommended action on user resource. e.g., time when index drop is executed. + :vartype revert_action_start_time: ~datetime.datetime + :ivar revert_action_duration: Gets the time taken for reverting changes of this recommended + action on user resource. e.g., time taken for dropping the created index. + :vartype revert_action_duration: ~datetime.timedelta + :ivar execute_action_initiated_by: Gets if approval for applying this recommended action was + given by user/system. Known values are: "User" and "System". + :vartype execute_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar execute_action_initiated_time: Gets the time when this recommended action was approved + for execution. + :vartype execute_action_initiated_time: ~datetime.datetime + :ivar revert_action_initiated_by: Gets if approval for reverting this recommended action was + given by user/system. Known values are: "User" and "System". + :vartype revert_action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar revert_action_initiated_time: Gets the time when this recommended action was approved for + revert. + :vartype revert_action_initiated_time: ~datetime.datetime + :ivar score: Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 + - Medium Impact and 3 - High Impact. + :vartype score: int + :ivar implementation_details: Gets the implementation details of this recommended action for + user to apply it manually. + :vartype implementation_details: ~azure.mgmt.sql.models.RecommendedActionImplementationInfo + :ivar error_details: Gets the error details if and why this recommended action is put to error + state. + :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo + :ivar estimated_impact: Gets the estimated impact info for this recommended action e.g., + Estimated CPU gain, Estimated Disk Space change. + :vartype estimated_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar observed_impact: Gets the observed/actual impact info for this recommended action e.g., + Actual CPU gain, Actual Disk Space change. + :vartype observed_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar time_series: Gets the time series info of metrics for this recommended action e.g., CPU + consumption time series. + :vartype time_series: list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] + :ivar linked_objects: Gets the linked objects, if any. + :vartype linked_objects: list[str] + :ivar details: Gets additional details specific to this recommended action. + :vartype details: dict[str, str] + """ + + _validation = { + "kind": {"readonly": True}, + "location": {"readonly": True}, + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "recommendation_reason": {"readonly": True}, + "valid_since": {"readonly": True}, + "last_refresh": {"readonly": True}, + "is_executable_action": {"readonly": True}, + "is_revertable_action": {"readonly": True}, + "is_archived_action": {"readonly": True}, + "execute_action_start_time": {"readonly": True}, + "execute_action_duration": {"readonly": True}, + "revert_action_start_time": {"readonly": True}, + "revert_action_duration": {"readonly": True}, + "execute_action_initiated_by": {"readonly": True}, + "execute_action_initiated_time": {"readonly": True}, + "revert_action_initiated_by": {"readonly": True}, + "revert_action_initiated_time": {"readonly": True}, + "score": {"readonly": True}, + "implementation_details": {"readonly": True}, + "error_details": {"readonly": True}, + "estimated_impact": {"readonly": True}, + "observed_impact": {"readonly": True}, + "time_series": {"readonly": True}, + "linked_objects": {"readonly": True}, + "details": {"readonly": True}, + } + + _attribute_map = { + "kind": {"key": "kind", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "type": {"key": "type", "type": "str"}, + "recommendation_reason": {"key": "properties.recommendationReason", "type": "str"}, + "valid_since": {"key": "properties.validSince", "type": "iso-8601"}, + "last_refresh": {"key": "properties.lastRefresh", "type": "iso-8601"}, + "state": {"key": "properties.state", "type": "RecommendedActionStateInfo"}, + "is_executable_action": {"key": "properties.isExecutableAction", "type": "bool"}, + "is_revertable_action": {"key": "properties.isRevertableAction", "type": "bool"}, + "is_archived_action": {"key": "properties.isArchivedAction", "type": "bool"}, + "execute_action_start_time": {"key": "properties.executeActionStartTime", "type": "iso-8601"}, + "execute_action_duration": {"key": "properties.executeActionDuration", "type": "duration"}, + "revert_action_start_time": {"key": "properties.revertActionStartTime", "type": "iso-8601"}, + "revert_action_duration": {"key": "properties.revertActionDuration", "type": "duration"}, + "execute_action_initiated_by": {"key": "properties.executeActionInitiatedBy", "type": "str"}, + "execute_action_initiated_time": {"key": "properties.executeActionInitiatedTime", "type": "iso-8601"}, + "revert_action_initiated_by": {"key": "properties.revertActionInitiatedBy", "type": "str"}, + "revert_action_initiated_time": {"key": "properties.revertActionInitiatedTime", "type": "iso-8601"}, + "score": {"key": "properties.score", "type": "int"}, + "implementation_details": { + "key": "properties.implementationDetails", + "type": "RecommendedActionImplementationInfo", + }, + "error_details": {"key": "properties.errorDetails", "type": "RecommendedActionErrorInfo"}, + "estimated_impact": {"key": "properties.estimatedImpact", "type": "[RecommendedActionImpactRecord]"}, + "observed_impact": {"key": "properties.observedImpact", "type": "[RecommendedActionImpactRecord]"}, + "time_series": {"key": "properties.timeSeries", "type": "[RecommendedActionMetricInfo]"}, + "linked_objects": {"key": "properties.linkedObjects", "type": "[str]"}, + "details": {"key": "properties.details", "type": "{str}"}, + } + + def __init__( # pylint: disable=too-many-locals + self, *, state: Optional["_models.RecommendedActionStateInfo"] = None, **kwargs: Any + ) -> None: """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str + :keyword state: Gets the info of the current state the recommended action is in. + :paramtype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo """ super().__init__(**kwargs) - self.max_number_of_replicas: Optional[int] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason + self.kind: Optional[str] = None + self.location: Optional[str] = None + self.id: Optional[str] = None + self.name: Optional[str] = None + self.type: Optional[str] = None + self.recommendation_reason: Optional[str] = None + self.valid_since: Optional[datetime.datetime] = None + self.last_refresh: Optional[datetime.datetime] = None + self.state = state + self.is_executable_action: Optional[bool] = None + self.is_revertable_action: Optional[bool] = None + self.is_archived_action: Optional[bool] = None + self.execute_action_start_time: Optional[datetime.datetime] = None + self.execute_action_duration: Optional[datetime.timedelta] = None + self.revert_action_start_time: Optional[datetime.datetime] = None + self.revert_action_duration: Optional[datetime.timedelta] = None + self.execute_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None + self.execute_action_initiated_time: Optional[datetime.datetime] = None + self.revert_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None + self.revert_action_initiated_time: Optional[datetime.datetime] = None + self.score: Optional[int] = None + self.implementation_details: Optional["_models.RecommendedActionImplementationInfo"] = None + self.error_details: Optional["_models.RecommendedActionErrorInfo"] = None + self.estimated_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None + self.observed_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None + self.time_series: Optional[list["_models.RecommendedActionMetricInfo"]] = None + self.linked_objects: Optional[list[str]] = None + self.details: Optional[dict[str, str]] = None -class RecommendedAction(ProxyResource): +class RecommendedActionAutoGenerated(ProxyResource): """Database, Server or Elastic Pool Recommended Action. Variables are only populated by the server, and will be ignored when sending a request. @@ -15913,13 +16858,13 @@ class RecommendedAction(ProxyResource): :vartype execute_action_start_time: ~datetime.datetime :ivar execute_action_duration: Gets the time taken for applying this recommended action on user resource. e.g., time taken for index creation. - :vartype execute_action_duration: str + :vartype execute_action_duration: ~datetime.timedelta :ivar revert_action_start_time: Gets the time when system started reverting changes of this recommended action on user resource. e.g., time when index drop is executed. :vartype revert_action_start_time: ~datetime.datetime :ivar revert_action_duration: Gets the time taken for reverting changes of this recommended action on user resource. e.g., time taken for dropping the created index. - :vartype revert_action_duration: str + :vartype revert_action_duration: ~datetime.timedelta :ivar execute_action_initiated_by: Gets if approval for applying this recommended action was given by user/system. Known values are: "User" and "System". :vartype execute_action_initiated_by: str or @@ -15954,7 +16899,7 @@ class RecommendedAction(ProxyResource): :ivar linked_objects: Gets the linked objects, if any. :vartype linked_objects: list[str] :ivar details: Gets additional details specific to this recommended action. - :vartype details: dict[str, JSON] + :vartype details: dict[str, str] """ _validation = { @@ -16001,9 +16946,9 @@ class RecommendedAction(ProxyResource): "is_revertable_action": {"key": "properties.isRevertableAction", "type": "bool"}, "is_archived_action": {"key": "properties.isArchivedAction", "type": "bool"}, "execute_action_start_time": {"key": "properties.executeActionStartTime", "type": "iso-8601"}, - "execute_action_duration": {"key": "properties.executeActionDuration", "type": "str"}, + "execute_action_duration": {"key": "properties.executeActionDuration", "type": "duration"}, "revert_action_start_time": {"key": "properties.revertActionStartTime", "type": "iso-8601"}, - "revert_action_duration": {"key": "properties.revertActionDuration", "type": "str"}, + "revert_action_duration": {"key": "properties.revertActionDuration", "type": "duration"}, "execute_action_initiated_by": {"key": "properties.executeActionInitiatedBy", "type": "str"}, "execute_action_initiated_time": {"key": "properties.executeActionInitiatedTime", "type": "iso-8601"}, "revert_action_initiated_by": {"key": "properties.revertActionInitiatedBy", "type": "str"}, @@ -16018,7 +16963,7 @@ class RecommendedAction(ProxyResource): "observed_impact": {"key": "properties.observedImpact", "type": "[RecommendedActionImpactRecord]"}, "time_series": {"key": "properties.timeSeries", "type": "[RecommendedActionMetricInfo]"}, "linked_objects": {"key": "properties.linkedObjects", "type": "[str]"}, - "details": {"key": "properties.details", "type": "{object}"}, + "details": {"key": "properties.details", "type": "{str}"}, } def __init__( # pylint: disable=too-many-locals @@ -16039,9 +16984,9 @@ def __init__( # pylint: disable=too-many-locals self.is_revertable_action: Optional[bool] = None self.is_archived_action: Optional[bool] = None self.execute_action_start_time: Optional[datetime.datetime] = None - self.execute_action_duration: Optional[str] = None + self.execute_action_duration: Optional[datetime.timedelta] = None self.revert_action_start_time: Optional[datetime.datetime] = None - self.revert_action_duration: Optional[str] = None + self.revert_action_duration: Optional[datetime.timedelta] = None self.execute_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None self.execute_action_initiated_time: Optional[datetime.datetime] = None self.revert_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None @@ -16053,7 +16998,7 @@ def __init__( # pylint: disable=too-many-locals self.observed_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None self.time_series: Optional[list["_models.RecommendedActionMetricInfo"]] = None self.linked_objects: Optional[list[str]] = None - self.details: Optional[dict[str, JSON]] = None + self.details: Optional[dict[str, str]] = None class RecommendedActionErrorInfo(_serialization.Model): @@ -17496,6 +18441,9 @@ class SensitivityLabel(ProxyResource): :vartype is_disabled: bool :ivar rank: Known values are: "None", "Low", "Medium", "High", and "Critical". :vartype rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank + :ivar client_classification_source: Known values are: "None", "Native", "Recommended", and + "MIP". + :vartype client_classification_source: str or ~azure.mgmt.sql.models.ClientClassificationSource """ _validation = { @@ -17523,6 +18471,7 @@ class SensitivityLabel(ProxyResource): "information_type_id": {"key": "properties.informationTypeId", "type": "str"}, "is_disabled": {"key": "properties.isDisabled", "type": "bool"}, "rank": {"key": "properties.rank", "type": "str"}, + "client_classification_source": {"key": "properties.clientClassificationSource", "type": "str"}, } def __init__( @@ -17533,6 +18482,7 @@ def __init__( information_type: Optional[str] = None, information_type_id: Optional[str] = None, rank: Optional[Union[str, "_models.SensitivityLabelRank"]] = None, + client_classification_source: Optional[Union[str, "_models.ClientClassificationSource"]] = None, **kwargs: Any ) -> None: """ @@ -17546,6 +18496,10 @@ def __init__( :paramtype information_type_id: str :keyword rank: Known values are: "None", "Low", "Medium", "High", and "Critical". :paramtype rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank + :keyword client_classification_source: Known values are: "None", "Native", "Recommended", and + "MIP". + :paramtype client_classification_source: str or + ~azure.mgmt.sql.models.ClientClassificationSource """ super().__init__(**kwargs) self.managed_by: Optional[str] = None @@ -17558,6 +18512,7 @@ def __init__( self.information_type_id = information_type_id self.is_disabled: Optional[bool] = None self.rank = rank + self.client_classification_source = client_classification_source class SensitivityLabelListResult(_serialization.Model): @@ -17798,7 +18753,7 @@ class Server(TrackedResource): "create_mode": {"key": "properties.createMode", "type": "str"}, } - def __init__( # pylint: disable=too-many-locals + def __init__( self, *, location: str, @@ -18229,8 +19184,8 @@ class ServerBlobAuditingPolicy(ProxyResource): or `Diagnostic Settings PowerShell `_. :vartype is_azure_monitor_target_enabled: bool :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. :vartype queue_delay_ms: int :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -18412,8 +19367,8 @@ def __init__( or `Diagnostic Settings PowerShell `_. :paramtype is_azure_monitor_target_enabled: bool :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. - The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. + audit actions are forced to be processed. The default minimum value is 1000 (1 second). The + maximum is 2,147,483,647. :paramtype queue_delay_ms: int :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob storage. @@ -18484,78 +19439,6 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None -class ServerCommunicationLink(ProxyResource): - """Server communication link. - - 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 location: Communication link location. - :vartype location: str - :ivar kind: Communication link kind. This property is used for Azure Portal metadata. - :vartype kind: str - :ivar state: The state. - :vartype state: str - :ivar partner_server: The name of the partner server. - :vartype partner_server: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "kind": {"readonly": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "partner_server": {"key": "properties.partnerServer", "type": "str"}, - } - - def __init__(self, *, partner_server: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword partner_server: The name of the partner server. - :paramtype partner_server: str - """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.kind: Optional[str] = None - self.state: Optional[str] = None - self.partner_server = partner_server - - -class ServerCommunicationLinkListResult(_serialization.Model): - """A list of server communication links. - - :ivar value: The list of server communication links. - :vartype value: list[~azure.mgmt.sql.models.ServerCommunicationLink] - """ - - _attribute_map = { - "value": {"key": "value", "type": "[ServerCommunicationLink]"}, - } - - def __init__(self, *, value: Optional[list["_models.ServerCommunicationLink"]] = None, **kwargs: Any) -> None: - """ - :keyword value: The list of server communication links. - :paramtype value: list[~azure.mgmt.sql.models.ServerCommunicationLink] - """ - super().__init__(**kwargs) - self.value = value - - class ServerConfigurationOption(ProxyResource): """A server configuration option. @@ -19076,7 +19959,9 @@ class ServerKey(ProxyResource): are: "ServiceManaged" and "AzureKeyVault". :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType :ivar uri: The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is - required. + required. The AKV URI is required to be in this format: + 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' or can be + 'https://YourVaultName.vault.azure.net/keys/YourKeyName'. :vartype uri: str :ivar thumbprint: Thumbprint of the server key. :vartype thumbprint: str @@ -19084,6 +19969,8 @@ class ServerKey(ProxyResource): :vartype creation_date: ~datetime.datetime :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. :vartype auto_rotation_enabled: bool + :ivar key_version: The version of the server key. + :vartype key_version: str """ _validation = { @@ -19096,6 +19983,7 @@ class ServerKey(ProxyResource): "thumbprint": {"readonly": True}, "creation_date": {"readonly": True}, "auto_rotation_enabled": {"readonly": True}, + "key_version": {"readonly": True}, } _attribute_map = { @@ -19110,6 +19998,7 @@ class ServerKey(ProxyResource): "thumbprint": {"key": "properties.thumbprint", "type": "str"}, "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, + "key_version": {"key": "properties.keyVersion", "type": "str"}, } def __init__( @@ -19124,7 +20013,9 @@ def __init__( values are: "ServiceManaged" and "AzureKeyVault". :paramtype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType :keyword uri: The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is - required. + required. The AKV URI is required to be in this format: + 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' or can be + 'https://YourVaultName.vault.azure.net/keys/YourKeyName'. :paramtype uri: str """ super().__init__(**kwargs) @@ -19136,6 +20027,7 @@ def __init__( self.thumbprint: Optional[str] = None self.creation_date: Optional[datetime.datetime] = None self.auto_rotation_enabled: Optional[bool] = None + self.key_version: Optional[str] = None class ServerKeyListResult(_serialization.Model): @@ -19796,83 +20688,82 @@ def __init__( self.create_mode = create_mode -class ServerUsage(_serialization.Model): - """Represents server metrics. +class ServerUsage(ProxyResource): + """Usage metric of a server. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Name of the server usage metric. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar resource_name: The name of the resource. - :vartype resource_name: str - :ivar display_name: The metric display name. + :ivar type: Resource type. + :vartype type: str + :ivar display_name: User-readable name of the metric. :vartype display_name: str - :ivar current_value: The current value of the metric. + :ivar current_value: Current value of the metric. :vartype current_value: float - :ivar limit: The current limit of the metric. + :ivar limit: Boundary value of the metric. :vartype limit: float - :ivar unit: The units of the metric. + :ivar unit: Unit of the metric. :vartype unit: str - :ivar next_reset_time: The next reset time for the metric (ISO8601 format). - :vartype next_reset_time: ~datetime.datetime """ _validation = { + "id": {"readonly": True}, "name": {"readonly": True}, - "resource_name": {"readonly": True}, + "type": {"readonly": True}, "display_name": {"readonly": True}, "current_value": {"readonly": True}, "limit": {"readonly": True}, "unit": {"readonly": True}, - "next_reset_time": {"readonly": True}, } _attribute_map = { + "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "resource_name": {"key": "resourceName", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "current_value": {"key": "currentValue", "type": "float"}, - "limit": {"key": "limit", "type": "float"}, - "unit": {"key": "unit", "type": "str"}, - "next_reset_time": {"key": "nextResetTime", "type": "iso-8601"}, + "type": {"key": "type", "type": "str"}, + "display_name": {"key": "properties.displayName", "type": "str"}, + "current_value": {"key": "properties.currentValue", "type": "float"}, + "limit": {"key": "properties.limit", "type": "float"}, + "unit": {"key": "properties.unit", "type": "str"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) - self.name: Optional[str] = None - self.resource_name: Optional[str] = None self.display_name: Optional[str] = None self.current_value: Optional[float] = None self.limit: Optional[float] = None self.unit: Optional[str] = None - self.next_reset_time: Optional[datetime.datetime] = None class ServerUsageListResult(_serialization.Model): - """Represents the response to a list server metrics request. + """A list of server usage metrics. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: The list of server metrics for the server. Required. + :ivar value: Array of results. :vartype value: list[~azure.mgmt.sql.models.ServerUsage] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str """ _validation = { - "value": {"required": True}, + "value": {"readonly": True}, + "next_link": {"readonly": True}, } _attribute_map = { "value": {"key": "value", "type": "[ServerUsage]"}, + "next_link": {"key": "nextLink", "type": "str"}, } - def __init__(self, *, value: list["_models.ServerUsage"], **kwargs: Any) -> None: - """ - :keyword value: The list of server metrics for the server. Required. - :paramtype value: list[~azure.mgmt.sql.models.ServerUsage] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.value = value + self.value: Optional[list["_models.ServerUsage"]] = None + self.next_link: Optional[str] = None class ServerVersionCapability(_serialization.Model): @@ -20035,61 +20926,6 @@ def __init__(self, **kwargs: Any) -> None: self.next_link: Optional[str] = None -class ServiceObjective(ProxyResource): - """Represents a database service objective. - - 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 service_objective_name: The name for the service objective. - :vartype service_objective_name: str - :ivar is_default: Gets whether the service level objective is the default service objective. - :vartype is_default: bool - :ivar is_system: Gets whether the service level objective is a system service objective. - :vartype is_system: bool - :ivar description: The description for the service level objective. - :vartype description: str - :ivar enabled: Gets whether the service level objective is enabled. - :vartype enabled: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "service_objective_name": {"readonly": True}, - "is_default": {"readonly": True}, - "is_system": {"readonly": True}, - "description": {"readonly": True}, - "enabled": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "service_objective_name": {"key": "properties.serviceObjectiveName", "type": "str"}, - "is_default": {"key": "properties.isDefault", "type": "bool"}, - "is_system": {"key": "properties.isSystem", "type": "bool"}, - "description": {"key": "properties.description", "type": "str"}, - "enabled": {"key": "properties.enabled", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.service_objective_name: Optional[str] = None - self.is_default: Optional[bool] = None - self.is_system: Optional[bool] = None - self.description: Optional[str] = None - self.enabled: Optional[bool] = None - - class ServiceObjectiveCapability(_serialization.Model): """The service objectives capability. @@ -20120,6 +20956,14 @@ class ServiceObjectiveCapability(_serialization.Model): :ivar supported_maintenance_configurations: List of supported maintenance configurations. :vartype supported_maintenance_configurations: list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] + :ivar zone_pinning: Whether or not zone pinning is supported. + :vartype zone_pinning: bool + :ivar supported_zones: List of supported availability zones. + :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] + :ivar supported_free_limit_exhaustion_behaviors: List of supported free limit exhaustion + behaviors. + :vartype supported_free_limit_exhaustion_behaviors: + list[~azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability] :ivar status: The status of the capability. Known values are: "Visible", "Available", "Default", and "Disabled". :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus @@ -20140,6 +20984,9 @@ class ServiceObjectiveCapability(_serialization.Model): "supported_min_capacities": {"readonly": True}, "compute_model": {"readonly": True}, "supported_maintenance_configurations": {"readonly": True}, + "zone_pinning": {"readonly": True}, + "supported_zones": {"readonly": True}, + "supported_free_limit_exhaustion_behaviors": {"readonly": True}, "status": {"readonly": True}, } @@ -20159,6 +21006,12 @@ class ServiceObjectiveCapability(_serialization.Model): "key": "supportedMaintenanceConfigurations", "type": "[MaintenanceConfigurationCapability]", }, + "zone_pinning": {"key": "zonePinning", "type": "bool"}, + "supported_zones": {"key": "supportedZones", "type": "[ZonePinningCapability]"}, + "supported_free_limit_exhaustion_behaviors": { + "key": "supportedFreeLimitExhaustionBehaviors", + "type": "[FreeLimitExhaustionBehaviorCapability]", + }, "status": {"key": "status", "type": "str"}, "reason": {"key": "reason", "type": "str"}, } @@ -20181,36 +21034,15 @@ def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: self.supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = None self.compute_model: Optional[str] = None self.supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = None + self.zone_pinning: Optional[bool] = None + self.supported_zones: Optional[list["_models.ZonePinningCapability"]] = None + self.supported_free_limit_exhaustion_behaviors: Optional[ + list["_models.FreeLimitExhaustionBehaviorCapability"] + ] = None self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None self.reason = reason -class ServiceObjectiveListResult(_serialization.Model): - """Represents the response to a get database service objectives request. - - All required parameters must be populated in order to send to server. - - :ivar value: The list of database service objectives. Required. - :vartype value: list[~azure.mgmt.sql.models.ServiceObjective] - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServiceObjective]"}, - } - - def __init__(self, *, value: list["_models.ServiceObjective"], **kwargs: Any) -> None: - """ - :keyword value: The list of database service objectives. Required. - :paramtype value: list[~azure.mgmt.sql.models.ServiceObjective] - """ - super().__init__(**kwargs) - self.value = value - - class ServicePrincipal(_serialization.Model): """The managed instance's service principal configuration for a resource. @@ -20312,46 +21144,6 @@ def __init__( self.capacity = capacity -class SloUsageMetric(_serialization.Model): - """A Slo Usage Metric. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar service_level_objective: The serviceLevelObjective for SLO usage metric. Known values - are: "System", "System0", "System1", "System2", "System3", "System4", "System2L", "System3L", - "System4L", "Free", "Basic", "S0", "S1", "S2", "S3", "S4", "S6", "S7", "S9", "S12", "P1", "P2", - "P3", "P4", "P6", "P11", "P15", "PRS1", "PRS2", "PRS4", "PRS6", "DW100", "DW200", "DW300", - "DW400", "DW500", "DW600", "DW1000", "DW1200", "DW1000c", "DW1500", "DW1500c", "DW2000", - "DW2000c", "DW3000", "DW2500c", "DW3000c", "DW6000", "DW5000c", "DW6000c", "DW7500c", - "DW10000c", "DW15000c", "DW30000c", "DS100", "DS200", "DS300", "DS400", "DS500", "DS600", - "DS1000", "DS1200", "DS1500", "DS2000", and "ElasticPool". - :vartype service_level_objective: str or ~azure.mgmt.sql.models.ServiceObjectiveName - :ivar service_level_objective_id: The serviceLevelObjectiveId for SLO usage metric. - :vartype service_level_objective_id: str - :ivar in_range_time_ratio: Gets or sets inRangeTimeRatio for SLO usage metric. - :vartype in_range_time_ratio: float - """ - - _validation = { - "service_level_objective": {"readonly": True}, - "service_level_objective_id": {"readonly": True}, - "in_range_time_ratio": {"readonly": True}, - } - - _attribute_map = { - "service_level_objective": {"key": "serviceLevelObjective", "type": "str"}, - "service_level_objective_id": {"key": "serviceLevelObjectiveId", "type": "str"}, - "in_range_time_ratio": {"key": "inRangeTimeRatio", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.service_level_objective: Optional[Union[str, "_models.ServiceObjectiveName"]] = None - self.service_level_objective_id: Optional[str] = None - self.in_range_time_ratio: Optional[float] = None - - class SqlAgentConfiguration(ProxyResource): """A recoverable managed database resource. @@ -20855,7 +21647,7 @@ class StorageCapability(_serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar storage_account_type: The storage account type for the database's backups. Known values - are: "GRS", "LRS", and "ZRS". + are: "GRS", "LRS", "ZRS", and "GZRS". :vartype storage_account_type: str or ~azure.mgmt.sql.models.StorageCapabilityStorageAccountType :ivar status: The status of the capability. Known values are: "Visible", "Available", @@ -22071,7 +22863,7 @@ def __init__( class TimeZone(ProxyResource): - """Time Zone. + """Time Zone property. Variables are only populated by the server, and will be ignored when sending a request. @@ -22332,19 +23124,29 @@ def __init__( self.storage_size_in_gb = storage_size_in_gb -class UpsertManagedServerOperationStep(_serialization.Model): - """UpsertManagedServerOperationStep. +class UpsertManagedServerOperationStepWithEstimatesAndDuration(_serialization.Model): # pylint: disable=name-too-long + """UpsertManagedServerOperationStepWithEstimatesAndDuration. + :ivar step_start_time: + :vartype step_start_time: ~datetime.datetime + :ivar step_end_time: + :vartype step_end_time: ~datetime.datetime + :ivar time_elapsed: + :vartype time_elapsed: str :ivar order: :vartype order: int :ivar name: :vartype name: str :ivar status: Known values are: "NotStarted", "InProgress", "SlowedDown", "Completed", "Failed", and "Canceled". - :vartype status: str or ~azure.mgmt.sql.models.UpsertManagedServerOperationStepStatus + :vartype status: str or + ~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus """ _attribute_map = { + "step_start_time": {"key": "stepStartTime", "type": "iso-8601"}, + "step_end_time": {"key": "stepEndTime", "type": "iso-8601"}, + "time_elapsed": {"key": "timeElapsed", "type": "str"}, "order": {"key": "order", "type": "int"}, "name": {"key": "name", "type": "str"}, "status": {"key": "status", "type": "str"}, @@ -22353,21 +23155,34 @@ class UpsertManagedServerOperationStep(_serialization.Model): def __init__( self, *, + step_start_time: Optional[datetime.datetime] = None, + step_end_time: Optional[datetime.datetime] = None, + time_elapsed: Optional[str] = None, order: Optional[int] = None, name: Optional[str] = None, - status: Optional[Union[str, "_models.UpsertManagedServerOperationStepStatus"]] = None, + status: Optional[Union[str, "_models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus"]] = None, **kwargs: Any ) -> None: """ + :keyword step_start_time: + :paramtype step_start_time: ~datetime.datetime + :keyword step_end_time: + :paramtype step_end_time: ~datetime.datetime + :keyword time_elapsed: + :paramtype time_elapsed: str :keyword order: :paramtype order: int :keyword name: :paramtype name: str :keyword status: Known values are: "NotStarted", "InProgress", "SlowedDown", "Completed", "Failed", and "Canceled". - :paramtype status: str or ~azure.mgmt.sql.models.UpsertManagedServerOperationStepStatus + :paramtype status: str or + ~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus """ super().__init__(**kwargs) + self.step_start_time = step_start_time + self.step_end_time = step_end_time + self.time_elapsed = time_elapsed self.order = order self.name = name self.status = status @@ -23139,3 +23954,39 @@ def __init__(self, **kwargs: Any) -> None: super().__init__(**kwargs) self.value: Optional[list["_models.WorkloadGroup"]] = None self.next_link: Optional[str] = None + + +class ZonePinningCapability(_serialization.Model): + """The zone pinning capability. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar availability_zone: Name of the availability zone. + :vartype availability_zone: str + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + _validation = { + "availability_zone": {"readonly": True}, + "status": {"readonly": True}, + } + + _attribute_map = { + "availability_zone": {"key": "availabilityZone", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "reason": {"key": "reason", "type": "str"}, + } + + def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword reason: The reason for the capability not being available. + :paramtype reason: str + """ + super().__init__(**kwargs) + self.availability_zone: Optional[str] = None + self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None + self.reason = reason 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 ba8731c058ec..e9cfd2ff9fb8 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 @@ -61,7 +61,7 @@ class AggregationFunctionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class AlwaysEncryptedEnclaveType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of enclave requested on the elastic pool.""" + """Type of enclave requested on the database i.e. Default or VBS enclaves.""" DEFAULT = "Default" VBS = "VBS" @@ -158,7 +158,7 @@ class AutomaticTuningServerReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): class AvailabilityZoneType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Specifies the availability zone the pool's primary replica is pinned to.""" + """Specifies the availability zone the database is pinned to.""" NO_PREFERENCE = "NoPreference" ONE = "1" @@ -174,7 +174,7 @@ class BackupStorageAccessTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The storage redundancy type of the backup.""" + """The storage account type used to store backups for this database.""" GEO = "Geo" LOCAL = "Local" @@ -205,6 +205,7 @@ class CapabilityGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): SUPPORTED_MANAGED_INSTANCE_VERSIONS = "supportedManagedInstanceVersions" SUPPORTED_INSTANCE_POOL_EDITIONS = "supportedInstancePoolEditions" SUPPORTED_MANAGED_INSTANCE_EDITIONS = "supportedManagedInstanceEditions" + SUPPORTED_JOB_AGENT_VERSIONS = "supportedJobAgentVersions" class CapabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -232,6 +233,15 @@ class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): ALREADY_EXISTS = "AlreadyExists" +class ClientClassificationSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """ClientClassificationSource.""" + + NONE = "None" + NATIVE = "Native" + RECOMMENDED = "Recommended" + MIP = "MIP" + + class ColumnDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The column data type.""" @@ -269,7 +279,6 @@ class ColumnDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): NCHAR = "nchar" XML = "xml" SYSNAME = "sysname" - INT_ENUM = "int" class ConnectionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -411,6 +420,12 @@ class DataMaskingFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): TEXT = "Text" +class DataMaskingPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """DataMaskingPolicyName.""" + + DEFAULT = "Default" + + class DataMaskingRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule @@ -418,15 +433,15 @@ class DataMaskingRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): the provided value of ruleState. """ - DISABLED = "Disabled" ENABLED = "Enabled" + DISABLED = "Disabled" class DataMaskingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the data masking policy.""" - DISABLED = "Disabled" ENABLED = "Enabled" + DISABLED = "Disabled" class DataWarehouseUserActivityName(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -498,6 +513,13 @@ class EncryptionProtectorName(str, Enum, metaclass=CaseInsensitiveEnumMeta): CURRENT = "current" +class ErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Error type (e.g. None, User).""" + + NONE = "None" + USER = "User" + + class ExternalGovernanceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of external governance.""" @@ -549,13 +571,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.""" @@ -565,8 +580,8 @@ class GeoBackupPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): class GeoBackupPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the geo backup policy.""" - DISABLED = "Disabled" ENABLED = "Enabled" + DISABLED = "Disabled" class HybridSecondaryUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -608,6 +623,16 @@ class ImplementationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_POWER_SHELL = "AzurePowerShell" +class InaccessibilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Root cause kind. Allowed values are “TransparentDataEncryption”, “DatabaseReplication”, and + “Unknown”. + """ + + UNKNOWN = "Unknown" + TRANSPARENT_DATA_ENCRYPTION = "TransparentDataEncryption" + DATABASE_REPLICATION = "DatabaseReplication" + + class InstanceFailoverGroupReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Local replication role of the failover group instance.""" @@ -640,6 +665,15 @@ class IsRetryable(str, Enum, metaclass=CaseInsensitiveEnumMeta): NO = "No" +class JobAgentIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The job agent identity type.""" + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + USER_ASSIGNED = "UserAssigned" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssignedUserAssigned" + + class JobAgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the job agent.""" @@ -789,6 +823,7 @@ class ManagedInstanceDatabaseFormat(str, Enum, metaclass=CaseInsensitiveEnumMeta ALWAYS_UP_TO_DATE = "AlwaysUpToDate" SQL_SERVER2022 = "SQLServer2022" + SQL_SERVER2025 = "SQLServer2025" class ManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -800,7 +835,9 @@ class ManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): BASE_PRICE = "BasePrice" -class ManagedInstanceLongTermRetentionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ManagedInstanceLongTermRetentionPolicyName( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """ManagedInstanceLongTermRetentionPolicyName.""" DEFAULT = "default" @@ -894,9 +931,11 @@ class MoveOperationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): class OperationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Operation Mode.""" + """Operation mode of the operation: Import, Export, or PolybaseImport.""" POLYBASE_IMPORT = "PolybaseImport" + IMPORT = "Import" + EXPORT = "Export" class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -930,15 +969,11 @@ class Phase(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUTOVER_IN_PROGRESS = "CutoverInProgress" -class PrimaryAggregationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The primary aggregation type defining how metric values are displayed.""" +class PricingModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Pricing model of Managed Instance.""" - NONE = "None" - AVERAGE = "Average" - COUNT = "Count" - MINIMUM = "Minimum" - MAXIMUM = "Maximum" - TOTAL = "Total" + REGULAR = "Regular" + FREEMIUM = "Freemium" class PrincipalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -959,7 +994,9 @@ class PrivateEndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumM REJECTING = "Rejecting" -class PrivateLinkServiceConnectionStateActionsRequire(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class PrivateLinkServiceConnectionStateActionsRequire( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """The actions required for private link service connection.""" NONE = "None" @@ -1087,7 +1124,6 @@ class ReplicationModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): ASYNC = "Async" SYNC = "Sync" - ASYNC_ENUM = "Async" class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1191,6 +1227,12 @@ class SecondaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): class SecurityAlertPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SecurityAlertPolicyName.""" + DEFAULT = "default" + + +class SecurityAlertPolicyNameAutoGenerated(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """SecurityAlertPolicyNameAutoGenerated.""" + DEFAULT = "Default" @@ -1299,7 +1341,9 @@ class ServerPublicNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta SECURED_BY_PERIMETER = "SecuredByPerimeter" -class ServerTrustGroupPropertiesTrustScopesItem(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class ServerTrustGroupPropertiesTrustScopesItem( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """ServerTrustGroupPropertiesTrustScopesItem.""" GLOBAL_TRANSACTIONS = "GlobalTransactions" @@ -1315,76 +1359,6 @@ class ServerWorkspaceFeature(str, Enum, metaclass=CaseInsensitiveEnumMeta): DISCONNECTED = "Disconnected" -class ServiceObjectiveName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The serviceLevelObjective for SLO usage metric.""" - - SYSTEM = "System" - SYSTEM0 = "System0" - SYSTEM1 = "System1" - SYSTEM2 = "System2" - SYSTEM3 = "System3" - SYSTEM4 = "System4" - SYSTEM2_L = "System2L" - SYSTEM3_L = "System3L" - SYSTEM4_L = "System4L" - FREE = "Free" - BASIC = "Basic" - S0 = "S0" - S1 = "S1" - S2 = "S2" - S3 = "S3" - S4 = "S4" - S6 = "S6" - S7 = "S7" - S9 = "S9" - S12 = "S12" - P1 = "P1" - P2 = "P2" - P3 = "P3" - P4 = "P4" - P6 = "P6" - P11 = "P11" - P15 = "P15" - PRS1 = "PRS1" - PRS2 = "PRS2" - PRS4 = "PRS4" - PRS6 = "PRS6" - DW100 = "DW100" - DW200 = "DW200" - DW300 = "DW300" - DW400 = "DW400" - DW500 = "DW500" - DW600 = "DW600" - DW1000 = "DW1000" - DW1200 = "DW1200" - DW1000_C = "DW1000c" - DW1500 = "DW1500" - DW1500_C = "DW1500c" - DW2000 = "DW2000" - DW2000_C = "DW2000c" - DW3000 = "DW3000" - DW2500_C = "DW2500c" - DW3000_C = "DW3000c" - DW6000 = "DW6000" - DW5000_C = "DW5000c" - DW6000_C = "DW6000c" - DW7500_C = "DW7500c" - DW10000_C = "DW10000c" - DW15000_C = "DW15000c" - DW30000_C = "DW30000c" - DS100 = "DS100" - DS200 = "DS200" - DS300 = "DS300" - DS400 = "DS400" - DS500 = "DS500" - DS600 = "DS600" - DS1000 = "DS1000" - DS1200 = "DS1200" - DS1500 = "DS1500" - DS2000 = "DS2000" - ELASTIC_POOL = "ElasticPool" - - class ServicePrincipalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Service principal type.""" @@ -1441,10 +1415,11 @@ class StorageCapabilityStorageAccountType(str, Enum, metaclass=CaseInsensitiveEn GRS = "GRS" LRS = "LRS" ZRS = "ZRS" + GZRS = "GZRS" class StorageKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Storage key type.""" + """Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity.""" SHARED_ACCESS_KEY = "SharedAccessKey" STORAGE_ACCESS_KEY = "StorageAccessKey" @@ -1563,6 +1538,17 @@ class TransparentDataEncryptionName(str, Enum, metaclass=CaseInsensitiveEnumMeta CURRENT = "current" +class TransparentDataEncryptionScanState(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Specifies the encryption scan state of the transparent data encryption.""" + + NONE = "None" + RESUME = "Resume" + RUNNING = "Running" + SUSPEND = "Suspend" + ABORTED = "Aborted" + COMPLETED = "Completed" + + class TransparentDataEncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the state of the transparent data encryption.""" @@ -1570,30 +1556,10 @@ class TransparentDataEncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMet DISABLED = "Disabled" -class UnitDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of the metric.""" - - COUNT = "Count" - BYTES = "Bytes" - SECONDS = "Seconds" - PERCENT = "Percent" - COUNT_PER_SECOND = "CountPerSecond" - BYTES_PER_SECOND = "BytesPerSecond" - - -class UnitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The unit of the metric.""" - - COUNT = "count" - BYTES = "bytes" - SECONDS = "seconds" - PERCENT = "percent" - COUNT_PER_SECOND = "countPerSecond" - BYTES_PER_SECOND = "bytesPerSecond" - - -class UpsertManagedServerOperationStepStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """UpsertManagedServerOperationStepStatus.""" +class UpsertManagedServerOperationStepWithEstimatesAndDurationStatus( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """UpsertManagedServerOperationStepWithEstimatesAndDurationStatus.""" NOT_STARTED = "NotStarted" IN_PROGRESS = "InProgress" @@ -1620,7 +1586,9 @@ class VulnerabilityAssessmentName(str, Enum, metaclass=CaseInsensitiveEnumMeta): DEFAULT = "default" -class VulnerabilityAssessmentPolicyBaselineName(str, Enum, metaclass=CaseInsensitiveEnumMeta): +class VulnerabilityAssessmentPolicyBaselineName( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): """VulnerabilityAssessmentPolicyBaselineName.""" MASTER = "master" 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 88a49faa4a42..8add9d7322c9 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 @@ -13,31 +13,49 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore -from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore -from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore -from ._databases_operations import DatabasesOperations # type: ignore -from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore -from ._server_communication_links_operations import ServerCommunicationLinksOperations # type: ignore -from ._service_objectives_operations import ServiceObjectivesOperations # type: ignore -from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations # type: ignore -from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations # type: ignore -from ._server_usages_operations import ServerUsagesOperations # type: ignore +from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore +from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore +from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore +from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore +from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore +from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore from ._database_advisors_operations import DatabaseAdvisorsOperations # type: ignore from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations # type: ignore from ._database_columns_operations import DatabaseColumnsOperations # type: ignore +from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore +from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore +from ._database_operations_operations import DatabaseOperationsOperations # type: ignore from ._database_recommended_actions_operations import DatabaseRecommendedActionsOperations # type: ignore +from ._databases_operations import DatabasesOperations # type: ignore from ._database_schemas_operations import DatabaseSchemasOperations # type: ignore from ._database_security_alert_policies_operations import DatabaseSecurityAlertPoliciesOperations # type: ignore +from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore +from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore from ._database_tables_operations import DatabaseTablesOperations # type: ignore +from ._database_usages_operations import DatabaseUsagesOperations # type: ignore from ._database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore from ._database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore +from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore from ._data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations # type: ignore from ._deleted_servers_operations import DeletedServersOperations # type: ignore +from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations # type: ignore +from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore from ._encryption_protectors_operations import EncryptionProtectorsOperations # type: ignore +from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore +from ._failover_groups_operations import FailoverGroupsOperations # type: ignore from ._firewall_rules_operations import FirewallRulesOperations # type: ignore +from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore +from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore +from ._instance_pool_operations_operations import InstancePoolOperationsOperations # type: ignore +from ._instance_pools_operations import InstancePoolsOperations # type: ignore +from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore from ._job_agents_operations import JobAgentsOperations # type: ignore from ._job_credentials_operations import JobCredentialsOperations # type: ignore from ._job_executions_operations import JobExecutionsOperations # type: ignore @@ -48,97 +66,78 @@ from ._job_target_executions_operations import JobTargetExecutionsOperations # type: ignore from ._job_target_groups_operations import JobTargetGroupsOperations # type: ignore from ._job_versions_operations import JobVersionsOperations # type: ignore +from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore from ._capabilities_operations import CapabilitiesOperations # type: ignore +from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore +from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore +from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations # type: ignore from ._maintenance_windows_operations import MaintenanceWindowsOperations # type: ignore from ._managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore +from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore from ._managed_database_columns_operations import ManagedDatabaseColumnsOperations # type: ignore +from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore from ._managed_database_queries_operations import ManagedDatabaseQueriesOperations # type: ignore +from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore +from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore from ._managed_database_schemas_operations import ManagedDatabaseSchemasOperations # type: ignore from ._managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore from ._managed_database_security_events_operations import ManagedDatabaseSecurityEventsOperations # type: ignore +from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore +from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore from ._managed_database_tables_operations import ManagedDatabaseTablesOperations # type: ignore from ._managed_database_transparent_data_encryption_operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore from ._managed_database_vulnerability_assessment_rule_baselines_operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations # type: ignore +from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore +from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore from ._managed_instance_keys_operations import ManagedInstanceKeysOperations # type: ignore from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations # type: ignore from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore +from ._managed_instances_operations import ManagedInstancesOperations # type: ignore from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations # type: ignore from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore +from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore +from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore +from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._operations import Operations # type: ignore +from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore +from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations # type: ignore +from ._replication_links_operations import ReplicationLinksOperations # type: ignore +from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore +from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore from ._restore_points_operations import RestorePointsOperations # type: ignore +from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore +from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore +from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore from ._server_advisors_operations import ServerAdvisorsOperations # type: ignore from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations # type: ignore from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations # type: ignore from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore +from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore +from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore from ._server_dev_ops_audit_settings_operations import ServerDevOpsAuditSettingsOperations # type: ignore from ._server_dns_aliases_operations import ServerDnsAliasesOperations # type: ignore from ._server_keys_operations import ServerKeysOperations # type: ignore from ._server_operations_operations import ServerOperationsOperations # type: ignore +from ._servers_operations import ServersOperations # type: ignore from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations # type: ignore +from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore from ._server_trust_groups_operations import ServerTrustGroupsOperations # type: ignore +from ._server_usages_operations import ServerUsagesOperations # type: ignore from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations # type: ignore from ._sql_agent_operations import SqlAgentOperations # type: ignore -from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore -from ._sync_agents_operations import SyncAgentsOperations # type: ignore -from ._sync_groups_operations import SyncGroupsOperations # type: ignore -from ._sync_members_operations import SyncMembersOperations # type: ignore -from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore -from ._time_zones_operations import TimeZonesOperations # type: ignore -from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore -from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore -from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore -from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore -from ._database_usages_operations import DatabaseUsagesOperations # type: ignore -from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore -from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore -from ._usages_operations import UsagesOperations # type: ignore -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore -from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore -from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore -from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore -from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore -from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore -from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore -from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore -from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore -from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore -from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore -from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore -from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore -from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore -from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore -from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore -from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore -from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore -from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore -from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore -from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore -from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore @@ -148,52 +147,69 @@ from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations # type: ignore from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations # type: ignore -from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore -from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._failover_groups_operations import FailoverGroupsOperations # type: ignore -from ._instance_pools_operations import InstancePoolsOperations # type: ignore -from ._managed_instances_operations import ManagedInstancesOperations # type: ignore -from ._replication_links_operations import ReplicationLinksOperations # type: ignore -from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore -from ._servers_operations import ServersOperations # type: ignore -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore -from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore -from ._database_operations_operations import DatabaseOperationsOperations # type: ignore +from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore +from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore +from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore +from ._sync_agents_operations import SyncAgentsOperations # type: ignore +from ._sync_groups_operations import SyncGroupsOperations # type: ignore +from ._sync_members_operations import SyncMembersOperations # type: ignore +from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore +from ._time_zones_operations import TimeZonesOperations # type: ignore +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore +from ._usages_operations import UsagesOperations # type: ignore +from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore +from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore +from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore +from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "DataMaskingPoliciesOperations", - "DataMaskingRulesOperations", - "GeoBackupPoliciesOperations", - "DatabasesOperations", - "ElasticPoolsOperations", - "ServerCommunicationLinksOperations", - "ServiceObjectivesOperations", - "ElasticPoolActivitiesOperations", - "ElasticPoolDatabaseActivitiesOperations", - "ServerUsagesOperations", + "BackupShortTermRetentionPoliciesOperations", + "ServerBlobAuditingPoliciesOperations", + "DatabaseBlobAuditingPoliciesOperations", + "ExtendedDatabaseBlobAuditingPoliciesOperations", + "ExtendedServerBlobAuditingPoliciesOperations", + "DatabaseAdvancedThreatProtectionSettingsOperations", "DatabaseAdvisorsOperations", "DatabaseAutomaticTuningOperations", "DatabaseColumnsOperations", + "DatabaseEncryptionProtectorsOperations", + "DatabaseExtensionsOperations", + "DatabaseOperationsOperations", "DatabaseRecommendedActionsOperations", + "DatabasesOperations", "DatabaseSchemasOperations", "DatabaseSecurityAlertPoliciesOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScanResultOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", "DatabaseTablesOperations", + "DatabaseUsagesOperations", "DatabaseVulnerabilityAssessmentRuleBaselinesOperations", "DatabaseVulnerabilityAssessmentsOperations", "DatabaseVulnerabilityAssessmentScansOperations", + "DataMaskingPoliciesOperations", + "DataMaskingRulesOperations", "DataWarehouseUserActivitiesOperations", "DeletedServersOperations", + "DistributedAvailabilityGroupsOperations", "ElasticPoolOperationsOperations", + "ElasticPoolsOperations", "EncryptionProtectorsOperations", + "EndpointCertificatesOperations", + "FailoverGroupsOperations", "FirewallRulesOperations", + "GeoBackupPoliciesOperations", + "InstanceFailoverGroupsOperations", + "InstancePoolOperationsOperations", + "InstancePoolsOperations", + "IPv6FirewallRulesOperations", "JobAgentsOperations", "JobCredentialsOperations", "JobExecutionsOperations", @@ -204,97 +220,78 @@ "JobTargetExecutionsOperations", "JobTargetGroupsOperations", "JobVersionsOperations", + "LedgerDigestUploadsOperations", "CapabilitiesOperations", + "LongTermRetentionBackupsOperations", + "LongTermRetentionManagedInstanceBackupsOperations", + "LongTermRetentionPoliciesOperations", "MaintenanceWindowOptionsOperations", "MaintenanceWindowsOperations", "ManagedBackupShortTermRetentionPoliciesOperations", + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", "ManagedDatabaseColumnsOperations", + "ManagedDatabaseMoveOperationsOperations", "ManagedDatabaseQueriesOperations", + "ManagedDatabaseRestoreDetailsOperations", + "ManagedDatabasesOperations", "ManagedDatabaseSchemasOperations", "ManagedDatabaseSecurityAlertPoliciesOperations", "ManagedDatabaseSecurityEventsOperations", + "ManagedDatabaseSensitivityLabelsOperations", + "ManagedDatabaseRecommendedSensitivityLabelsOperations", "ManagedDatabaseTablesOperations", "ManagedDatabaseTransparentDataEncryptionOperations", "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", "ManagedDatabaseVulnerabilityAssessmentsOperations", "ManagedDatabaseVulnerabilityAssessmentScansOperations", "ManagedInstanceAdministratorsOperations", + "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAzureADOnlyAuthenticationsOperations", + "ManagedInstanceDtcsOperations", "ManagedInstanceEncryptionProtectorsOperations", "ManagedInstanceKeysOperations", "ManagedInstanceLongTermRetentionPoliciesOperations", "ManagedInstanceOperationsOperations", "ManagedInstancePrivateEndpointConnectionsOperations", "ManagedInstancePrivateLinkResourcesOperations", + "ManagedInstancesOperations", "ManagedInstanceTdeCertificatesOperations", "ManagedInstanceVulnerabilityAssessmentsOperations", + "ManagedLedgerDigestUploadsOperations", "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", + "ManagedServerDnsAliasesOperations", "ManagedServerSecurityAlertPoliciesOperations", + "NetworkSecurityPerimeterConfigurationsOperations", "Operations", + "OutboundFirewallRulesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", + "RecoverableDatabasesOperations", "RecoverableManagedDatabasesOperations", + "ReplicationLinksOperations", + "RestorableDroppedDatabasesOperations", + "RestorableDroppedManagedDatabasesOperations", "RestorePointsOperations", + "SensitivityLabelsOperations", + "RecommendedSensitivityLabelsOperations", + "ServerAdvancedThreatProtectionSettingsOperations", "ServerAdvisorsOperations", "ServerAutomaticTuningOperations", "ServerAzureADAdministratorsOperations", "ServerAzureADOnlyAuthenticationsOperations", + "ServerConfigurationOptionsOperations", + "ServerConnectionPoliciesOperations", "ServerDevOpsAuditSettingsOperations", "ServerDnsAliasesOperations", "ServerKeysOperations", "ServerOperationsOperations", + "ServersOperations", "ServerSecurityAlertPoliciesOperations", + "ServerTrustCertificatesOperations", "ServerTrustGroupsOperations", + "ServerUsagesOperations", "ServerVulnerabilityAssessmentsOperations", "SqlAgentOperations", - "SubscriptionUsagesOperations", - "SyncAgentsOperations", - "SyncGroupsOperations", - "SyncMembersOperations", - "TdeCertificatesOperations", - "TimeZonesOperations", - "VirtualNetworkRulesOperations", - "WorkloadClassifiersOperations", - "WorkloadGroupsOperations", - "BackupShortTermRetentionPoliciesOperations", - "DatabaseExtensionsOperations", - "DatabaseUsagesOperations", - "LedgerDigestUploadsOperations", - "OutboundFirewallRulesOperations", - "UsagesOperations", - "LongTermRetentionManagedInstanceBackupsOperations", - "RestorableDroppedManagedDatabasesOperations", - "ServerConnectionPoliciesOperations", - "ServerTrustCertificatesOperations", - "EndpointCertificatesOperations", - "ManagedDatabaseSensitivityLabelsOperations", - "ManagedDatabaseRecommendedSensitivityLabelsOperations", - "SensitivityLabelsOperations", - "RecommendedSensitivityLabelsOperations", - "ServerBlobAuditingPoliciesOperations", - "DatabaseBlobAuditingPoliciesOperations", - "ExtendedDatabaseBlobAuditingPoliciesOperations", - "ExtendedServerBlobAuditingPoliciesOperations", - "DatabaseAdvancedThreatProtectionSettingsOperations", - "ServerAdvancedThreatProtectionSettingsOperations", - "ManagedServerDnsAliasesOperations", - "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", - "ManagedInstanceAdvancedThreatProtectionSettingsOperations", - "ManagedDatabaseMoveOperationsOperations", - "ManagedInstanceDtcsOperations", - "SynapseLinkWorkspacesOperations", - "VirtualClustersOperations", - "InstanceFailoverGroupsOperations", - "ManagedDatabaseRestoreDetailsOperations", - "DatabaseEncryptionProtectorsOperations", - "ManagedDatabasesOperations", - "ManagedLedgerDigestUploadsOperations", - "RecoverableDatabasesOperations", - "RestorableDroppedDatabasesOperations", - "ServerConfigurationOptionsOperations", - "StartStopManagedInstanceSchedulesOperations", - "TransparentDataEncryptionsOperations", - "IPv6FirewallRulesOperations", "SqlVulnerabilityAssessmentBaselineOperations", "SqlVulnerabilityAssessmentBaselinesOperations", "SqlVulnerabilityAssessmentExecuteScanOperations", @@ -304,21 +301,20 @@ "SqlVulnerabilityAssessmentScansOperations", "SqlVulnerabilityAssessmentsSettingsOperations", "SqlVulnerabilityAssessmentsOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", - "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", - "FailoverGroupsOperations", - "InstancePoolsOperations", - "ManagedInstancesOperations", - "ReplicationLinksOperations", - "DistributedAvailabilityGroupsOperations", - "ServersOperations", - "LongTermRetentionBackupsOperations", - "LongTermRetentionPoliciesOperations", - "DatabaseOperationsOperations", + "StartStopManagedInstanceSchedulesOperations", + "SubscriptionUsagesOperations", + "SynapseLinkWorkspacesOperations", + "SyncAgentsOperations", + "SyncGroupsOperations", + "SyncMembersOperations", + "TdeCertificatesOperations", + "TimeZonesOperations", + "TransparentDataEncryptionsOperations", + "UsagesOperations", + "VirtualClustersOperations", + "VirtualNetworkRulesOperations", + "WorkloadClassifiersOperations", + "WorkloadGroupsOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 d38ec0910181..307940720a39 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,30 +43,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies", ) 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"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +75,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -91,8 +86,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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,14 +108,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -132,7 +124,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,27 +151,34 @@ def build_update_request( _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) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/backupShortTermRetentionPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", ) 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"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -189,9 +188,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) class BackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long @@ -213,6 +214,97 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.BackupShortTermRetentionPolicy"]: + """Gets a database's short term retention policy. + + :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 + :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -248,7 +340,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -272,7 +364,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -301,7 +397,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -342,12 +438,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -451,7 +555,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -517,7 +621,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -558,12 +662,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -667,7 +779,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -712,79 +824,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.BackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.BackupShortTermRetentionPolicy"]: - """Gets a database's short term retention policy. - - :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 - :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", "2021-02-01-preview")) - cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 cfaf947055c2..f3a2b9ea28bc 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 @@ -45,7 +45,7 @@ def build_list_by_location_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,8 +99,8 @@ def list_by_location( :type location_name: str :param include: If specified, restricts the response to only include the selected item. Known values are: "supportedEditions", "supportedElasticPoolEditions", - "supportedManagedInstanceVersions", "supportedInstancePoolEditions", and - "supportedManagedInstanceEditions". Default value is None. + "supportedManagedInstanceVersions", "supportedInstancePoolEditions", + "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. :type include: str or ~azure.mgmt.sql.models.CapabilityGroup :return: LocationCapabilities or the result of cls(response) :rtype: ~azure.mgmt.sql.models.LocationCapabilities @@ -117,7 +117,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) _request = build_list_by_location_request( @@ -139,7 +139,11 @@ def list_by_location( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LocationCapabilities", pipeline_response.http_response) 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 610c19ff8886..fb0383aa82be 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 @@ -8,7 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload from azure.core import PipelineClient from azure.core.exceptions import ( @@ -37,15 +37,18 @@ _SERIALIZER.client_side_validation = False -def build_create_or_update_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -54,11 +57,11 @@ def build_create_or_update_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -67,21 +70,24 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,11 +96,11 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -103,9 +109,11 @@ def build_get_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class DataMaskingPoliciesOperations: @@ -127,12 +135,86 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Gets the database data masking policy. + + :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 data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: DataMaskingPolicy or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: _models.DataMaskingPolicy, *, content_type: str = "application/json", @@ -147,6 +229,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Required. :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -163,6 +248,7 @@ def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: IO[bytes], *, content_type: str = "application/json", @@ -177,6 +263,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -193,6 +282,7 @@ def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], parameters: Union[_models.DataMaskingPolicy, IO[bytes]], **kwargs: Any ) -> _models.DataMaskingPolicy: @@ -205,6 +295,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param parameters: Parameters for creating or updating a data masking policy. Is either a DataMaskingPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or IO[bytes] @@ -223,8 +316,7 @@ def 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) @@ -240,9 +332,9 @@ def create_or_update( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + data_masking_policy_name=data_masking_policy_name, subscription_id=self._config.subscription_id, api_version=api_version, - data_masking_policy_name=data_masking_policy_name, content_type=content_type, json=_json, content=_content, @@ -258,71 +350,13 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Gets a database data masking policy. - - :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 - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - data_masking_policy_name=data_masking_policy_name, - headers=_headers, - params=_params, - ) - _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]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) 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 eaae868c4112..44130d5cc493 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 @@ -8,7 +8,8 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,34 +39,31 @@ _SERIALIZER.client_side_validation = False -def build_create_or_update_request( +def build_list_by_database_request( resource_group_name: str, server_name: str, database_name: str, - data_masking_rule_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), - "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -74,34 +72,39 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -110,9 +113,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class DataMaskingRulesOperations: @@ -134,12 +139,112 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> ItemPaged["_models.DataMaskingRule"]: + """Gets a list of database data masking rules. + + :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 data_masking_policy_name: The name of the database for which the data masking rule + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: An iterator like instance of either DataMaskingRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataMaskingRule] + :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", self._config.api_version)) + cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @overload def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: _models.DataMaskingRule, *, @@ -155,6 +260,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. @@ -174,6 +282,7 @@ def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: IO[bytes], *, @@ -189,6 +298,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. @@ -208,6 +320,7 @@ def create_or_update( resource_group_name: str, server_name: str, database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], data_masking_rule_name: str, parameters: Union[_models.DataMaskingRule, IO[bytes]], **kwargs: Any @@ -221,6 +334,9 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName :param data_masking_rule_name: The name of the data masking rule. Required. :type data_masking_rule_name: str :param parameters: The required parameters for creating or updating a data masking rule. Is @@ -241,8 +357,7 @@ def 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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) @@ -258,10 +373,10 @@ def create_or_update( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + data_masking_policy_name=data_masking_policy_name, data_masking_rule_name=data_masking_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, - data_masking_policy_name=data_masking_policy_name, content_type=content_type, json=_json, content=_content, @@ -279,7 +394,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DataMaskingRule", pipeline_response.http_response) @@ -287,80 +406,3 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DataMaskingRule"]: - """Gets a list of database data masking rules. - - :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 - :return: An iterator like instance of either DataMaskingRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataMaskingRule] - :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", "2014-04-01")) - data_masking_policy_name: Literal["Default"] = kwargs.pop("data_masking_policy_name", "Default") - cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - data_masking_policy_name=data_masking_policy_name, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 8f9302294e79..af9ab17d0db7 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -37,32 +38,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities", ) 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"), - "dataWarehouseUserActivityName": _SERIALIZER.url( - "data_warehouse_user_activity_name", data_warehouse_user_activity_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -77,24 +70,32 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}", ) 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"), + "dataWarehouseUserActivityName": _SERIALIZER.url( + "data_warehouse_user_activity_name", data_warehouse_user_activity_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -128,76 +129,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - **kwargs: Any - ) -> _models.DataWarehouseUserActivities: - """Gets the user activities of a data warehouse which includes running and suspended queries. - - :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" - Required. - :type data_warehouse_user_activity_name: str or - ~azure.mgmt.sql.models.DataWarehouseUserActivityName - :return: DataWarehouseUserActivities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_warehouse_user_activity_name=data_warehouse_user_activity_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_database( self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any @@ -219,7 +150,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -245,7 +176,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -268,8 +210,86 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + **kwargs: Any + ) -> _models.DataWarehouseUserActivities: + """Gets the user activities of a data warehouse which includes running and suspended queries. + + :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" + Required. + :type data_warehouse_user_activity_name: str or + ~azure.mgmt.sql.models.DataWarehouseUserActivityName + :return: DataWarehouseUserActivities or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_warehouse_user_activity_name=data_warehouse_user_activity_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 010ddf395886..46eb0133c6c3 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -193,7 +194,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -219,7 +220,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -242,7 +254,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -285,7 +301,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -309,7 +325,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) @@ -429,7 +449,7 @@ def 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) @@ -465,7 +485,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) 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 43e20585d205..4b4ccd6d0495 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 @@ -49,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -210,7 +210,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) _request = build_list_by_database_request( @@ -234,7 +234,11 @@ def list_by_database( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("[Advisor]", pipeline_response.http_response) @@ -273,7 +277,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) _request = build_get_request( @@ -297,7 +301,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) @@ -411,7 +419,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) @@ -447,7 +455,11 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) 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 f60aa2a29394..c9056fa23076 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 @@ -43,7 +43,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +75,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,7 +151,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) _request = build_get_request( @@ -174,7 +174,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) @@ -279,7 +283,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) @@ -314,7 +318,11 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) 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 7531a57b2ebb..99b125f9ab17 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +78,7 @@ def build_get_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,7 +182,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -207,7 +208,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -230,7 +242,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -265,7 +281,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -289,7 +305,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) @@ -395,7 +415,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) @@ -431,7 +451,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) 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 d2d05168f791..c3984831d1c5 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -53,7 +54,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +104,7 @@ def build_list_by_table_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +147,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +235,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -265,7 +266,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -288,7 +300,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -328,7 +344,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -357,7 +373,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -380,7 +407,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -427,7 +458,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) _request = build_get_request( @@ -453,7 +484,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseColumn", pipeline_response.http_response) 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 33bbd341ff99..0dc20fd42d4a 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 @@ -48,9 +48,12 @@ def build_revalidate_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -69,7 +72,10 @@ def build_revalidate_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_revert_request( @@ -80,9 +86,12 @@ def build_revert_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -101,7 +110,10 @@ def build_revert_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseEncryptionProtectorsOperations: @@ -142,7 +154,7 @@ def _revalidate_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_revalidate_request( @@ -171,12 +183,20 @@ def _revalidate_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -208,7 +228,7 @@ def begin_revalidate( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -268,7 +288,7 @@ def _revert_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_revert_request( @@ -297,12 +317,20 @@ def _revert_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -334,7 +362,7 @@ def begin_revert( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 9e81528c6b12..876f004728e5 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,27 +43,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions", ) 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"), - "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -71,10 +69,13 @@ def build_get_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( + +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -85,8 +86,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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,31 +108,36 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + extension_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/extensions", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", ) 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"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -142,9 +147,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseExtensionsOperations: @@ -166,6 +173,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ImportExportExtensionsOperationResult"]: + """List database extension. This will return an empty list as it is not supported. + + :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 + :return: An iterator like instance of either ImportExportExtensionsOperationResult or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + :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", self._config.api_version)) + cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any @@ -196,7 +295,7 @@ def get( # 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_get_request( @@ -220,7 +319,11 @@ def get( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -245,7 +348,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -286,12 +389,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -307,7 +418,8 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -342,7 +454,8 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -375,7 +488,8 @@ def begin_create_or_update( parameters: Union[_models.DatabaseExtensions, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like polybase import. + """Perform a database extension operation, like database import, database export, or polybase + import. :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. @@ -398,7 +512,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportExtensionsOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -443,80 +557,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ImportExportExtensionsOperationResult]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ImportExportExtensionsOperationResult"]: - """List database extension. This will return an empty list as it is not supported. - - :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 - :return: An iterator like instance of either ImportExportExtensionsOperationResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", "2021-02-01-preview")) - cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 20fe1184bb2f..7d5331014294 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -53,12 +54,7 @@ def build_list_by_database_request( ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url( - "resource_group_name", - resource_group_name, - "str", - max_length=90, - min_length=1, - pattern=r"^[\p{L}\p{N}_().-]*[\p{L}\p{N}_()-]$", + "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 ), "serverName": _SERIALIZER.url( "server_name", server_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$" @@ -96,7 +92,7 @@ def build_cancel_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +158,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -188,7 +184,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -211,7 +218,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -248,7 +258,7 @@ def cancel( # 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( @@ -272,7 +282,10 @@ def cancel( # pylint: disable=inconsistent-return-statements 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: 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 83009a615904..183c13705fac 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 @@ -48,7 +48,7 @@ def build_list_by_database_advisor_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -87,7 +87,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -127,7 +127,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -180,7 +180,7 @@ def __init__(self, *args, **kwargs) -> None: @distributed_trace def list_by_database_advisor( self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> List[_models.RecommendedAction]: + ) -> List[_models.RecommendedActionAutoGenerated]: """Gets list of Database Recommended Actions. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -192,8 +192,8 @@ def list_by_database_advisor( :type database_name: str :param advisor_name: The name of the Database Advisor. Required. :type advisor_name: str - :return: list of RecommendedAction or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.RecommendedAction] + :return: list of RecommendedActionAutoGenerated or the result of cls(response) + :rtype: list[~azure.mgmt.sql.models.RecommendedActionAutoGenerated] :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -207,8 +207,8 @@ def list_by_database_advisor( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[List[_models.RecommendedActionAutoGenerated]] = kwargs.pop("cls", None) _request = build_list_by_database_advisor_request( resource_group_name=resource_group_name, @@ -231,9 +231,13 @@ def list_by_database_advisor( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("[RecommendedAction]", pipeline_response.http_response) + deserialized = self._deserialize("[RecommendedActionAutoGenerated]", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -249,7 +253,7 @@ def get( advisor_name: str, recommended_action_name: str, **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Gets a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -263,8 +267,8 @@ def get( :type advisor_name: str :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -278,8 +282,8 @@ 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", "2020-11-01-preview")) - cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, @@ -303,9 +307,13 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RecommendedAction", pipeline_response.http_response) + deserialized = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -320,11 +328,11 @@ def update( database_name: str, advisor_name: str, recommended_action_name: str, - parameters: _models.RecommendedAction, + parameters: _models.RecommendedActionAutoGenerated, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -339,12 +347,12 @@ def update( :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str :param parameters: The requested recommended action resource state. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedAction + :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ @@ -360,7 +368,7 @@ def update( *, content_type: str = "application/json", **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -379,8 +387,8 @@ def update( :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ @@ -392,9 +400,9 @@ def update( database_name: str, advisor_name: str, recommended_action_name: str, - parameters: Union[_models.RecommendedAction, IO[bytes]], + parameters: Union[_models.RecommendedActionAutoGenerated, IO[bytes]], **kwargs: Any - ) -> _models.RecommendedAction: + ) -> _models.RecommendedActionAutoGenerated: """Updates a database recommended action. :param resource_group_name: The name of the resource group that contains the resource. You can @@ -409,10 +417,10 @@ def update( :param recommended_action_name: The name of Database Recommended Action. Required. :type recommended_action_name: str :param parameters: The requested recommended action resource state. Is either a - RecommendedAction type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedAction or IO[bytes] - :return: RecommendedAction or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedAction + RecommendedActionAutoGenerated type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated or IO[bytes] + :return: RecommendedActionAutoGenerated or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -426,9 +434,9 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -436,7 +444,7 @@ def update( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "RecommendedAction") + _json = self._serialize.body(parameters, "RecommendedActionAutoGenerated") _request = build_update_request( resource_group_name=resource_group_name, @@ -463,9 +471,13 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("RecommendedAction", pipeline_response.http_response) + deserialized = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore 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 497d11025dcf..330132f63400 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -49,7 +50,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +89,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +163,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -189,7 +190,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -212,7 +224,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -248,7 +264,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) _request = build_get_request( @@ -272,7 +288,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSchema", pipeline_response.http_response) 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 c9a36a9e9666..e2a5fc9d5d14 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,30 +39,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies", ) 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"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -76,7 +71,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -87,8 +82,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,31 +104,36 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/securityAlertPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", ) 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"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -144,9 +143,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseSecurityAlertPoliciesOperations: @@ -168,6 +169,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseSecurityAlertPolicy"]: + """Gets a list of database's security alert policies. + + :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 for which the security alert policy is defined. + Required. + :type database_name: str + :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -187,7 +280,7 @@ def get( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :return: DatabaseSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy @@ -204,7 +297,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -228,7 +321,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -259,7 +356,7 @@ def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy @@ -293,7 +390,7 @@ def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: IO[bytes] @@ -325,7 +422,7 @@ def create_or_update( :param database_name: The name of the database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Is either a DatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. @@ -345,7 +442,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) @@ -381,7 +478,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -389,80 +490,3 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseSecurityAlertPolicy"]: - """Gets a list of database's security alert policies. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 200cdf84b4fb..4016f0a4a1c4 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -49,7 +50,7 @@ def build_list_by_sql_vulnerability_assessment_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +91,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +133,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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -214,7 +215,7 @@ def list_by_sql_vulnerability_assessment( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -241,7 +242,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -266,7 +278,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -311,7 +327,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) _request = build_get_request( @@ -336,7 +352,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response @@ -466,7 +486,7 @@ def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) @@ -503,7 +523,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 5894e23e42e8..a0c090a670a7 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 @@ -48,9 +48,12 @@ def build_execute_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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -71,7 +74,10 @@ def build_execute_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseSqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long @@ -112,7 +118,7 @@ def _execute_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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_execute_request( @@ -141,12 +147,20 @@ def _execute_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -178,7 +192,7 @@ def begin_execute( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 175d52df83ae..f5771ef5dfb7 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -50,7 +51,7 @@ def build_list_by_baseline_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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +94,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +138,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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,9 +182,12 @@ 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -206,7 +210,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long @@ -261,7 +268,7 @@ def list_by_baseline( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -289,7 +296,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -314,7 +332,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -362,7 +384,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -388,7 +410,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -526,7 +552,7 @@ def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -564,7 +590,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -617,7 +647,7 @@ def delete( # 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -643,7 +673,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 1a6110430890..6bddc4542b24 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -49,7 +50,7 @@ def build_list_by_scan_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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -92,7 +93,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -177,7 +178,7 @@ def list_by_scan( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -205,7 +206,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -228,7 +240,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -278,7 +294,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) _request = build_get_request( @@ -304,7 +320,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) 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 51c6803527c7..0d18ae6735fc 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,7 @@ def build_list_by_sql_vulnerability_assessments_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +90,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -168,7 +169,7 @@ def list_by_sql_vulnerability_assessments( _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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -195,7 +196,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -218,7 +230,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -263,7 +279,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -288,7 +304,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) 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 7af6c4134b3d..85353f0f9cbf 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,7 +150,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -175,7 +176,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -198,7 +210,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -241,7 +257,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -265,7 +281,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) 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 02acfc33892f..1c2cb3433e27 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -50,7 +51,7 @@ def build_list_by_schema_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +92,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +170,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -197,7 +198,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -220,7 +232,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -264,7 +280,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) _request = build_get_request( @@ -289,7 +305,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseTable", pipeline_response.http_response) 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 cd1568971bd4..945df863b0e3 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +109,7 @@ 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -134,7 +135,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -157,7 +169,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 fbd8b77a8c5f..afe3c47b90e7 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 @@ -50,7 +50,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -138,9 +138,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +166,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long @@ -230,7 +236,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -256,7 +262,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -401,7 +411,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -439,7 +449,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -493,7 +507,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -519,7 +533,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 985727a50b2c..9b7ce15099e1 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -41,22 +42,24 @@ _SERIALIZER.client_side_validation = False -def build_initiate_scan_request( +def build_list_by_database_request( resource_group_name: str, server_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -65,7 +68,6 @@ def build_initiate_scan_request( "vulnerabilityAssessmentName": _SERIALIZER.url( "vulnerability_assessment_name", vulnerability_assessment_name, "str" ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,27 +76,31 @@ def build_initiate_scan_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( + +def build_get_request( resource_group_name: str, server_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -103,6 +109,7 @@ def build_list_by_database_request( "vulnerabilityAssessmentName": _SERIALIZER.url( "vulnerability_assessment_name", vulnerability_assessment_name, "str" ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -117,7 +124,7 @@ def build_list_by_database_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_export_request( resource_group_name: str, server_name: str, database_name: str, @@ -129,13 +136,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -156,10 +163,10 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_export_request( +def build_initiate_scan_request( resource_group_name: str, server_name: str, database_name: str, @@ -171,13 +178,13 @@ def build_export_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -220,136 +227,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _initiate_scan_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_initiate_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._initiate_scan_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace def list_by_database( self, @@ -379,7 +256,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -406,7 +283,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -429,7 +317,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -474,7 +366,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -499,7 +391,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) @@ -547,7 +443,7 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) _request = build_export_request( @@ -572,7 +468,11 @@ def export( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) @@ -580,3 +480,141 @@ def export( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + def _initiate_scan_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_initiate_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_initiate_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> LROPoller[None]: + """Executes a Vulnerability Assessment database scan. + + :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :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", self._config.api_version)) + 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._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 b84fe2341e80..afca531f957d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,32 +39,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments", ) 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +71,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -89,8 +82,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,14 +106,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -129,9 +119,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -152,27 +146,40 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", ) 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"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -184,7 +191,7 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class DatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long @@ -206,6 +213,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a database. + + :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 for which the vulnerability assessment policies + are defined. Required. + :type database_name: str + :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -243,7 +342,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -267,7 +366,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -387,7 +490,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -423,7 +526,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -469,7 +576,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -493,84 +600,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a database. - - :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 for which the vulnerability assessment policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 9a5d7b342a3d..06f2a564e335 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,78 +43,13 @@ _SERIALIZER.client_side_validation = False -def build_list_metrics_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, *, filter: 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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_metric_definitions_request( - resource_group_name: str, server_name: str, database_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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_list_by_server_request( resource_group_name: str, server_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -153,7 +89,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -189,7 +125,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -221,9 +157,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, database_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-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -241,7 +180,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -250,7 +192,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -285,7 +227,7 @@ def build_export_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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -323,9 +265,12 @@ def build_failover_request( replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -345,7 +290,10 @@ def build_failover_request( _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_import_method_request( @@ -354,7 +302,7 @@ def build_import_method_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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -389,8 +337,10 @@ def build_rename_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", "2025-01-01")) 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", @@ -411,6 +361,7 @@ def build_rename_request( # 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) @@ -421,7 +372,7 @@ def build_pause_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -453,7 +404,7 @@ def build_resume_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -482,9 +433,12 @@ def build_resume_request( def build_upgrade_data_warehouse_request( resource_group_name: str, server_name: str, database_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-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -502,7 +456,10 @@ def build_upgrade_data_warehouse_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_elastic_pool_request( @@ -511,7 +468,7 @@ def build_list_by_elastic_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-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -543,7 +500,7 @@ def build_list_inaccessible_by_server_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -587,160 +544,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_metrics( - self, resource_group_name: str, server_name: str, database_name: str, filter: str, **kwargs: Any - ) -> ItemPaged["_models.Metric"]: - """Returns database metrics. - - :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 filter: An OData filter expression that describes a subset of metrics to return. - Required. - :type filter: str - :return: An iterator like instance of either Metric or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Metric] - :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", "2014-04-01")) - cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metrics_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MetricListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_metric_definitions( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.MetricDefinition"]: - """Returns database metric definitions. - - :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 - :return: An iterator like instance of either MetricDefinition or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.MetricDefinition] - :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", "2014-04-01")) - cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metric_definitions_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MetricDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def list_by_server( self, resource_group_name: str, server_name: str, skip_token: Optional[str] = None, **kwargs: Any @@ -761,7 +564,7 @@ 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", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -787,7 +590,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -810,7 +624,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -855,7 +673,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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) _request = build_get_request( @@ -880,7 +698,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Database", pipeline_response.http_response) @@ -908,7 +730,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -948,12 +770,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1045,7 +875,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1106,7 +936,7 @@ def _delete_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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1134,12 +964,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1163,7 +1001,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", self._config.api_version)) 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) @@ -1222,7 +1060,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1262,12 +1100,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1359,7 +1205,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1425,7 +1271,7 @@ def _export_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1465,12 +1311,20 @@ def _export_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1565,7 +1419,7 @@ def begin_export( _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1629,7 +1483,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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1658,12 +1512,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1695,7 +1557,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", self._config.api_version)) 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) @@ -1753,7 +1615,7 @@ def _import_method_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1793,12 +1655,20 @@ def _import_method_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1893,7 +1763,7 @@ def begin_import_method( _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2034,7 +1904,7 @@ def rename( # pylint: disable=inconsistent-return-statements _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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -2069,7 +1939,11 @@ def rename( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -2088,7 +1962,7 @@ def _pause_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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_pause_request( @@ -2116,12 +1990,20 @@ def _pause_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -2145,7 +2027,7 @@ def begin_pause( _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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2201,7 +2083,7 @@ def _resume_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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_resume_request( @@ -2229,12 +2111,20 @@ def _resume_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -2258,7 +2148,7 @@ def begin_resume( _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", self._config.api_version)) cls: ClsType[_models.Database] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2314,7 +2204,7 @@ def _upgrade_data_warehouse_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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_upgrade_data_warehouse_request( @@ -2342,12 +2232,20 @@ def _upgrade_data_warehouse_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -2371,7 +2269,7 @@ def begin_upgrade_data_warehouse( _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", self._config.api_version)) 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) @@ -2429,7 +2327,7 @@ def list_by_elastic_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-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2455,7 +2353,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -2478,7 +2387,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2502,7 +2415,7 @@ def list_inaccessible_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", self._config.api_version)) cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2527,7 +2440,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -2550,7 +2474,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 47af268e7cbe..bb1fc874d938 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -45,7 +46,7 @@ def build_list_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -65,21 +66,20 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request(location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_list_by_location_request(location_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -94,20 +94,21 @@ def build_get_request(location_name: str, deleted_server_name: str, subscription return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_location_request(location_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: +def build_get_request(location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -128,7 +129,7 @@ def build_recover_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -183,7 +184,7 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -206,7 +207,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -229,66 +241,16 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - @distributed_trace - def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: - """Gets a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: DeletedServer or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DeletedServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DeletedServer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: """Gets a list of deleted servers for a location. @@ -302,7 +264,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -326,7 +288,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -349,12 +322,74 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + @distributed_trace + def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: + """Gets a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: DeletedServer or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.DeletedServer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) + + _request = build_get_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("DeletedServer", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + def _recover_initial(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -367,7 +402,7 @@ def _recover_initial(self, location_name: str, deleted_server_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_recover_request( @@ -394,12 +429,20 @@ def _recover_initial(self, location_name: str, deleted_server_name: str, **kwarg except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -421,7 +464,7 @@ def begin_recover( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DeletedServer] = 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/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py index 05819d9c081e..a68f3525bbf5 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,7 +163,7 @@ def build_delete_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -200,7 +201,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -241,7 +242,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -294,7 +295,7 @@ def build_set_role_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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -363,7 +364,7 @@ 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", self._config.api_version)) cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -388,7 +389,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -411,7 +423,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -450,7 +465,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", self._config.api_version)) cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -473,7 +488,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_response) @@ -502,7 +520,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -542,13 +560,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -643,7 +668,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", self._config.api_version)) 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) @@ -706,7 +731,7 @@ def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -734,13 +759,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -768,7 +800,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", self._config.api_version)) 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) @@ -825,7 +857,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -865,13 +897,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -966,7 +1005,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", self._config.api_version)) 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) @@ -1030,7 +1069,7 @@ def _failover_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1070,7 +1109,10 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1176,7 +1218,7 @@ def begin_failover( _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", self._config.api_version)) 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) @@ -1242,7 +1284,7 @@ def _set_role_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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1282,13 +1324,20 @@ def _set_role_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1383,7 +1432,7 @@ def begin_set_role( _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", self._config.api_version)) 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) 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 deleted file mode 100644 index 10482df69e01..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ /dev/null @@ -1,165 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_elastic_pool_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ElasticPoolActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`elastic_pool_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticPoolActivity"]: - """Returns elastic pool activities. - - :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 elastic_pool_name: The name of the elastic pool for which to get the current activity. - Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolActivity or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPoolActivity] - :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", "2014-04-01")) - cls: ClsType[_models.ElasticPoolActivityListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolActivityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index c3fd515dd7c8..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ /dev/null @@ -1,165 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_elastic_pool_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ElasticPoolDatabaseActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`elastic_pool_database_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticPoolDatabaseActivity"]: - """Returns activity on databases inside of an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolDatabaseActivity or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPoolDatabaseActivity] - :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", "2014-04-01")) - cls: ClsType[_models.ElasticPoolDatabaseActivityListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolDatabaseActivityListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 831ab267b82d..ebcc923de869 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -37,27 +38,24 @@ _SERIALIZER.client_side_validation = False -def build_cancel_request( - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - operation_id: str, - subscription_id: str, - **kwargs: Any +def build_list_by_elastic_pool_request( + resource_group_name: str, server_name: str, elastic_pool_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -66,27 +64,36 @@ def build_cancel_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_elastic_pool_request( - resource_group_name: str, server_name: str, elastic_pool_name: str, subscription_id: str, **kwargs: Any + +def build_cancel_request( + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + operation_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -98,7 +105,7 @@ def build_list_by_elastic_pool_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class ElasticPoolOperationsOperations: @@ -120,65 +127,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :param operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace def list_by_elastic_pool( self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any @@ -200,7 +148,7 @@ def list_by_elastic_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -226,7 +174,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -249,8 +208,75 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the elastic pool. + + :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 elastic_pool_name: Required. + :type elastic_pool_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 6b267763e388..7bc2eaee8bbc 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,84 +43,13 @@ _SERIALIZER.client_side_validation = False -def build_list_metrics_request( - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - subscription_id: str, - *, - filter: 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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_metric_definitions_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2014-04-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_list_by_server_request( resource_group_name: str, server_name: str, subscription_id: str, *, skip: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -152,7 +82,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -184,7 +114,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,9 +146,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, elastic_pool_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -236,7 +169,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -245,7 +181,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -277,9 +213,12 @@ def build_update_request( def build_failover_request( resource_group_name: str, server_name: str, elastic_pool_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -297,7 +236,10 @@ def build_failover_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class ElasticPoolsOperations: @@ -319,160 +261,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_metrics( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, filter: str, **kwargs: Any - ) -> ItemPaged["_models.Metric"]: - """Returns elastic pool metrics. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param filter: An OData filter expression that describes a subset of metrics to return. - Required. - :type filter: str - :return: An iterator like instance of either Metric or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Metric] - :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", "2014-04-01")) - cls: ClsType[_models.MetricListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metrics_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MetricListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_metric_definitions( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.MetricDefinition"]: - """Returns elastic pool metric definitions. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either MetricDefinition or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.MetricDefinition] - :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", "2014-04-01")) - cls: ClsType[_models.MetricDefinitionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_metric_definitions_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MetricDefinitionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def list_by_server( self, resource_group_name: str, server_name: str, skip: Optional[int] = None, **kwargs: Any @@ -493,7 +281,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -519,7 +307,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -542,7 +341,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -576,7 +379,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) _request = build_get_request( @@ -599,7 +402,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ElasticPool", pipeline_response.http_response) @@ -627,7 +434,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -667,12 +474,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -767,7 +582,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -828,7 +643,7 @@ def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -856,12 +671,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -885,7 +708,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -944,7 +767,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -984,12 +807,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1084,7 +915,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1145,7 +976,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1173,12 +1004,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1202,7 +1041,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 745b4310f4ee..c456ba39aad2 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +120,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -155,9 +156,12 @@ def build_revalidate_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -175,7 +179,10 @@ def build_revalidate_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class EncryptionProtectorsOperations: @@ -215,7 +222,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -240,7 +247,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -263,7 +281,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -302,7 +324,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) _request = build_get_request( @@ -325,7 +347,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("EncryptionProtector", pipeline_response.http_response) @@ -353,7 +379,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -393,12 +419,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -496,7 +530,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -559,7 +593,7 @@ def _revalidate_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_revalidate_request( @@ -587,12 +621,20 @@ def _revalidate_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -621,7 +663,7 @@ def begin_revalidate( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 92c7d2426427..f23963a383bb 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +75,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +138,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -162,7 +163,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -185,7 +197,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -220,7 +236,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) _request = build_get_request( @@ -243,7 +259,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("EndpointCertificate", pipeline_response.http_response) 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 56bbc5662092..2788a059673a 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -77,7 +78,7 @@ def build_get_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -181,7 +182,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -207,7 +208,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -230,7 +242,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -265,7 +281,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -289,7 +305,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) @@ -395,7 +415,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) @@ -431,7 +451,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) 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 712ef69f69c9..f5d118f733a0 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +79,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,7 +179,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -203,7 +204,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -226,7 +238,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -259,7 +275,7 @@ def get( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -282,7 +298,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_response) @@ -310,7 +330,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -350,12 +370,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -442,7 +470,7 @@ def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 4ec017bf3b72..3cc96eec78d9 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, failover_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -172,7 +179,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -207,7 +214,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -239,7 +246,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -271,7 +278,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -334,7 +341,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -359,7 +366,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -382,7 +400,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -416,7 +438,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", self._config.api_version)) cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -439,7 +461,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("FailoverGroup", pipeline_response.http_response) @@ -467,7 +493,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -507,12 +533,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -607,7 +641,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", self._config.api_version)) 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) @@ -666,7 +700,7 @@ def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -694,12 +728,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -723,7 +765,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -780,7 +822,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -820,12 +862,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -920,7 +970,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", self._config.api_version)) 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) @@ -979,7 +1029,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1007,12 +1057,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1037,7 +1095,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", self._config.api_version)) 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) @@ -1093,7 +1151,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -1121,12 +1179,20 @@ def _force_failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1152,7 +1218,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1208,7 +1274,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_try_planned_before_forced_failover_request( @@ -1236,7 +1302,11 @@ def _try_planned_before_forced_failover_initial( # pylint: disable=name-too-lon except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} if response.status_code == 202: @@ -1271,7 +1341,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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 2930458cf9ab..11b4ac5add4b 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,24 +39,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, firewall_rule_name: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -70,25 +70,24 @@ 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, firewall_rule_name: str, subscription_id: str, **kwargs: Any +def build_replace_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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}/firewallRules/{firewallRuleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -105,12 +104,15 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_get_request( resource_group_name: str, server_name: str, firewall_rule_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -128,26 +130,31 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_create_or_update_request( + resource_group_name: str, server_name: str, firewall_rule_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/firewallRules", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -157,29 +164,31 @@ def build_list_by_server_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_replace_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_delete_request( + resource_group_name: str, server_name: str, firewall_rule_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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -189,11 +198,9 @@ def build_replace_request( _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) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class FirewallRulesOperations: @@ -216,22 +223,26 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.FirewallRule: - """Gets a firewall rule. + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.FirewallRule"]: + """Gets a list of firewall rules. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: An iterator like instance of either FirewallRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FirewallRule] :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", self._config.api_version)) + cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -240,124 +251,137 @@ def get( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @overload - def create_or_update( + def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, - parameters: _models.FirewallRule, + parameters: _models.FirewallRuleList, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def create_or_update( + def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. + :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: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def create_or_update( + def replace( self, resource_group_name: str, server_name: str, - firewall_rule_name: str, - parameters: Union[_models.FirewallRule, IO[bytes]], + parameters: Union[_models.FirewallRuleList, IO[bytes]], **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Is either - a FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule + :param parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] + :return: FirewallRule or None or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule or None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -371,9 +395,9 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -381,12 +405,11 @@ def create_or_update( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "FirewallRule") + _json = self._serialize.body(parameters, "FirewallRuleList") - _request = build_create_or_update_request( + _request = build_replace_request( resource_group_name=resource_group_name, server_name=server_name, - firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -404,11 +427,17 @@ def create_or_update( response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore @@ -416,10 +445,10 @@ def create_or_update( return deserialized # type: ignore @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements + def get( self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> None: - """Deletes a firewall rule. + ) -> _models.FirewallRule: + """Gets a firewall rule. :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. @@ -428,8 +457,8 @@ def delete( # pylint: disable=inconsistent-return-statements :type server_name: str :param firewall_rule_name: The name of the firewall rule. Required. :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -443,10 +472,10 @@ def delete( # 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", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) - _request = build_delete_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, firewall_rule_name=firewall_rule_name, @@ -464,158 +493,104 @@ def delete( # pylint: disable=inconsistent-return-statements response = pipeline_response.http_response - if response.status_code not in [200, 204]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.FirewallRule"]: - """Gets a list of firewall rules. - - :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 - :return: An iterator like instance of either FirewallRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FirewallRule] - :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", "2020-11-01-preview")) - cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) - return pipeline_response + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore - return ItemPaged(get_next, extract_data) + return deserialized # type: ignore @overload - def replace( + def create_or_update( self, resource_group_name: str, server_name: str, - parameters: _models.FirewallRuleList, + firewall_rule_name: str, + parameters: _models.FirewallRule, *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def replace( + def create_or_update( self, resource_group_name: str, server_name: str, + firewall_rule_name: str, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Required. + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def replace( + def create_or_update( self, resource_group_name: str, server_name: str, - parameters: Union[_models.FirewallRuleList, IO[bytes]], + firewall_rule_name: str, + parameters: Union[_models.FirewallRule, IO[bytes]], **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. :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 parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Is either + a FirewallRule type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] + :return: FirewallRule or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.FirewallRule :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -629,9 +604,9 @@ def replace( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) content_type = content_type or "application/json" _json = None @@ -639,11 +614,12 @@ def replace( if isinstance(parameters, (IOBase, bytes)): _content = parameters else: - _json = self._serialize.body(parameters, "FirewallRuleList") + _json = self._serialize.body(parameters, "FirewallRule") - _request = build_replace_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, + firewall_rule_name=firewall_rule_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -661,15 +637,77 @@ def replace( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + 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("FirewallRule", pipeline_response.http_response) + deserialized = self._deserialize("FirewallRule", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> None: + """Deletes a firewall rule. + + :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 firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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, 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 1266e9de2202..d370400621f4 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,32 +39,25 @@ _SERIALIZER.client_side_validation = False -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_request( + resource_group_name: str, server_name: str, database_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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -72,11 +66,9 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) def build_get_request( @@ -90,7 +82,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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -99,11 +91,11 @@ def build_get_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -117,25 +109,32 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + 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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/geoBackupPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -144,9 +143,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class GeoBackupPoliciesOperations: @@ -168,6 +169,169 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.GeoBackupPolicy"]: + """Gets a list of Geo backup policies for the given database resource. + + :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 + :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Gets a Geo backup policy for the given database resource. + + :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :return: GeoBackupPolicy or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + @overload def create_or_update( self, @@ -180,7 +344,7 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -189,7 +353,8 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Required. @@ -214,7 +379,7 @@ def create_or_update( content_type: str = "application/json", **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -223,7 +388,8 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Required. @@ -246,7 +412,7 @@ def create_or_update( parameters: Union[_models.GeoBackupPolicy, IO[bytes]], **kwargs: Any ) -> _models.GeoBackupPolicy: - """Updates a database geo backup policy. + """Create or update a database default Geo backup policy. :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. @@ -255,7 +421,8 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. Required. :type database_name: str - :param geo_backup_policy_name: The name of the geo backup policy. "Default" Required. + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName :param parameters: The required parameters for creating or updating the geo backup policy. Is either a GeoBackupPolicy type or a IO[bytes] type. Required. @@ -275,7 +442,7 @@ def 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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) @@ -311,75 +478,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Gets a geo backup policy. - - :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 geo_backup_policy_name: The name of the geo backup policy. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) @@ -387,78 +490,3 @@ def get( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.GeoBackupPolicy"]: - """Returns a list of geo backup policies. - - :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 - :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] - :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", "2014-04-01")) - cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 03286fc1992a..febf8006584e 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,7 @@ def build_list_by_location_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, location_name: str, failover_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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_failover_request( @@ -172,7 +179,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +211,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -268,7 +275,7 @@ def list_by_location( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -293,7 +300,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -316,7 +334,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -350,7 +372,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -373,7 +395,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_response) @@ -401,7 +427,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -441,12 +467,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -541,7 +575,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -600,7 +634,7 @@ def _delete_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -628,12 +662,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -657,7 +699,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -709,7 +751,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -737,12 +779,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -767,7 +817,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -823,7 +873,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_force_failover_allow_data_loss_request( @@ -851,12 +901,20 @@ def _force_failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -882,7 +940,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.InstanceFailoverGroup] = 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/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py index 29a14f8842ba..7994e3f2311e 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/_instance_pool_operations_operations.py @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -37,25 +38,31 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, service_objective_name: str, subscription_id: str, **kwargs: Any +def build_list_by_instance_pool_request( + resource_group_name: str, instance_pool_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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "serviceObjectiveName": _SERIALIZER.url("service_objective_name", service_objective_name, "str"), + "instancePoolName": _SERIALIZER.url( + "instance_pool_name", + instance_pool_name, + "str", + max_length=127, + min_length=1, + pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$", + ), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -69,24 +76,32 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_get_request( + resource_group_name: str, instance_pool_name: str, operation_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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations/{operationId}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "instancePoolName": _SERIALIZER.url( + "instance_pool_name", + instance_pool_name, + "str", + max_length=127, + min_length=1, + pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$", + ), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -100,14 +115,14 @@ def build_list_by_server_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class ServiceObjectivesOperations: +class InstancePoolOperationsOperations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`service_objectives` attribute. + :attr:`instance_pool_operations` attribute. """ models = _models @@ -120,85 +135,26 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def get( - self, resource_group_name: str, server_name: str, service_objective_name: str, **kwargs: Any - ) -> _models.ServiceObjective: - """Gets a database service objective. - - :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 service_objective_name: The name of the service objective to retrieve. Required. - :type service_objective_name: str - :return: ServiceObjective or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServiceObjective - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[_models.ServiceObjective] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - service_objective_name=service_objective_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ServiceObjective", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServiceObjective"]: - """Returns database service objectives. + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.InstancePoolOperation"]: + """Gets a list of operations performed on the instance pool. :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 - :return: An iterator like instance of either ServiceObjective or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServiceObjective] + :param instance_pool_name: The name of the managed instance pool. Required. + :type instance_pool_name: str + :return: An iterator like instance of either InstancePoolOperation or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] :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", "2014-04-01")) - cls: ClsType[_models.ServiceObjectiveListResult] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.InstancePoolOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -211,9 +167,9 @@ def list_by_server( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_server_request( + _request = build_list_by_instance_pool_request( resource_group_name=resource_group_name, - server_name=server_name, + instance_pool_name=instance_pool_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -222,17 +178,28 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request def extract_data(pipeline_response): - deserialized = self._deserialize("ServiceObjectiveListResult", pipeline_response) + deserialized = self._deserialize("InstancePoolOperationListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -245,8 +212,76 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.InstancePoolOperation: + """Gets a management operation on a instance pool. + + :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 instance_pool_name: The name of the managed instance pool. Required. + :type instance_pool_name: str + :param operation_id: Required. + :type operation_id: str + :return: InstancePoolOperation or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.InstancePoolOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("InstancePoolOperation", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 6b54928c3872..a7d9e10d12f0 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -46,7 +47,7 @@ def build_list_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +101,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +132,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -162,9 +163,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, instance_pool_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -181,7 +185,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -190,7 +197,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -248,7 +255,7 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.InstancePool"]: _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", self._config.api_version)) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -271,7 +278,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -294,7 +312,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -314,7 +336,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _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", self._config.api_version)) cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -338,7 +360,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -361,7 +394,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -391,7 +428,7 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) _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", self._config.api_version)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) _request = build_get_request( @@ -413,7 +450,11 @@ def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("InstancePool", pipeline_response.http_response) @@ -440,7 +481,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -479,12 +520,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -570,7 +619,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -626,7 +675,7 @@ def _delete_initial(self, resource_group_name: str, instance_pool_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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -653,12 +702,20 @@ def _delete_initial(self, resource_group_name: str, instance_pool_name: str, **k except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -678,7 +735,7 @@ def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwar _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", self._config.api_version)) 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) @@ -733,7 +790,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -772,12 +829,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -863,7 +928,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 7113d38aaf03..c4bc37bfa1d5 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -75,7 +76,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -107,7 +108,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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -139,9 +140,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, firewall_rule_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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -159,7 +163,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class IPv6FirewallRulesOperations: @@ -199,7 +206,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -224,7 +231,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -247,7 +265,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -281,7 +303,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -304,7 +326,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) @@ -411,7 +437,7 @@ def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) @@ -446,7 +472,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) @@ -483,7 +513,7 @@ def delete( # 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -506,7 +536,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 3246560a9642..3136ae5e7bac 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, job_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -172,7 +179,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -238,7 +245,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -263,7 +270,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -286,7 +304,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -318,7 +340,7 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) _request = build_get_request( @@ -341,7 +363,11 @@ def get(self, resource_group_name: str, server_name: str, job_agent_name: str, * if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobAgent", pipeline_response.http_response) @@ -369,7 +395,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -409,12 +435,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -506,7 +540,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -565,7 +599,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -593,12 +627,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -622,7 +664,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -679,7 +721,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -719,12 +761,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -816,7 +866,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 2b0d394038a2..700e8075af07 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,7 @@ def build_list_by_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +120,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -157,9 +158,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +182,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class JobCredentialsOperations: @@ -220,7 +227,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -246,7 +253,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -269,7 +287,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -305,7 +327,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) _request = build_get_request( @@ -329,7 +351,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobCredential", pipeline_response.http_response) @@ -443,7 +469,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) @@ -479,7 +505,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobCredential", pipeline_response.http_response) @@ -518,7 +548,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -542,7 +572,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 b34deef62ab4..f6a8ce9750bd 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 @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,6 +9,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -60,7 +61,7 @@ def build_list_by_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,59 +101,92 @@ def build_list_by_agent_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_cancel_request( +def build_list_by_job_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, - job_execution_id: str, subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, subscription_id: str, **kwargs: Any + +def build_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -164,70 +198,50 @@ def build_create_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_job_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, + job_execution_id: str, subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_cancel_request( resource_group_name: str, server_name: str, job_agent_name: str, @@ -239,13 +253,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -264,35 +278,28 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - subscription_id: str, - **kwargs: Any +def build_create_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -304,7 +311,7 @@ def build_create_or_update_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class JobExecutionsOperations: @@ -376,7 +383,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -409,7 +416,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -432,14 +450,149 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements + def list_by_job( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists a job's executions. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :type create_time_min: ~datetime.datetime + :param create_time_max: If specified, only job executions created before the specified time are + included. Default value is None. + :type create_time_max: ~datetime.datetime + :param end_time_min: If specified, only job executions completed at or after the specified time + are included. Default value is None. + :type end_time_min: ~datetime.datetime + :param end_time_max: If specified, only job executions completed before the specified time are + included. Default value is None. + :type end_time_max: ~datetime.datetime + :param is_active: If specified, only active or only completed job executions are included. + Default value is None. + :type is_active: bool + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :return: An iterator like instance of either JobExecution or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :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", self._config.api_version)) + cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("JobExecutionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( self, resource_group_name: str, server_name: str, @@ -447,8 +600,8 @@ def cancel( # pylint: disable=inconsistent-return-statements job_name: str, job_execution_id: str, **kwargs: Any - ) -> None: - """Requests cancellation of a job execution. + ) -> _models.JobExecution: + """Gets a job execution. :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. @@ -459,10 +612,10 @@ def cancel( # pylint: disable=inconsistent-return-statements :type job_agent_name: str :param job_name: The name of the job. Required. :type job_name: str - :param job_execution_id: The id of the job execution to cancel. Required. + :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str - :return: None or the result of cls(response) - :rtype: None + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobExecution :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -476,10 +629,10 @@ def cancel( # 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", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - _request = build_cancel_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -501,13 +654,27 @@ def cancel( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("JobExecution", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore - def _create_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -520,14 +687,15 @@ def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_request( + _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, + job_execution_id=job_execution_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -543,26 +711,40 @@ def _create_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [200, 201, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def begin_create( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any ) -> LROPoller[_models.JobExecution]: - """Starts an elastic job execution. + """Creates or updates a job execution. :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. @@ -573,6 +755,8 @@ def begin_create( :type job_agent_name: str :param job_name: The name of the job to get. Required. :type job_name: str + :param job_execution_id: The job execution id to create the job execution under. Required. + :type job_execution_id: str :return: An instance of LROPoller that returns either JobExecution or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] @@ -581,17 +765,18 @@ def begin_create( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = 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_initial( + raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, + job_execution_id=job_execution_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -625,123 +810,7 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_by_job( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists a job's executions. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", "2020-11-01-preview")) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( + def cancel( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, @@ -749,8 +818,8 @@ def get( job_name: str, job_execution_id: str, **kwargs: Any - ) -> _models.JobExecution: - """Gets a job execution. + ) -> None: + """Requests cancellation of a job execution. :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. @@ -761,10 +830,10 @@ def get( :type job_agent_name: str :param job_name: The name of the job. Required. :type job_name: str - :param job_execution_id: The id of the job execution. Required. + :param job_execution_id: The id of the job execution to cancel. Required. :type job_execution_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution + :return: None or the result of cls(response) + :rtype: None :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -778,10 +847,10 @@ 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", "2020-11-01-preview")) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_get_request( + _request = build_cancel_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, @@ -803,23 +872,17 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobExecution", pipeline_response.http_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any + def _create_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -832,15 +895,14 @@ def _create_or_update_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_create_or_update_request( + _request = build_create_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, - job_execution_id=job_execution_id, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -856,32 +918,34 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any + def begin_create( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any ) -> LROPoller[_models.JobExecution]: - """Creates or updates a job execution. + """Starts an elastic job execution. :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. @@ -892,8 +956,6 @@ def begin_create_or_update( :type job_agent_name: str :param job_name: The name of the job to get. Required. :type job_name: str - :param job_execution_id: The job execution id to create the job execution under. Required. - :type job_execution_id: str :return: An instance of LROPoller that returns either JobExecution or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] @@ -902,18 +964,17 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = 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( + raw_result = self._create_initial( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, - job_execution_id=job_execution_id, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, 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 3ea3d44f52a7..549bb1b58ea1 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,7 @@ def build_list_by_agent_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +124,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -161,9 +162,12 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -182,7 +186,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class JobPrivateEndpointsOperations: @@ -224,7 +231,7 @@ def list_by_agent( _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", self._config.api_version)) cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -250,7 +257,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -273,7 +291,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -309,7 +331,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", self._config.api_version)) cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) _request = build_get_request( @@ -333,7 +355,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobPrivateEndpoint", pipeline_response.http_response) @@ -362,7 +388,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -403,12 +429,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -512,7 +546,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -574,7 +608,7 @@ def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -603,12 +637,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -634,7 +676,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 9c3d129eec85..1312e4564dc0 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -58,7 +59,7 @@ def build_list_by_job_execution_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +114,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +163,7 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_by_job_execution( + def list_by_job_execution( # pylint: disable=too-many-locals self, resource_group_name: str, server_name: str, @@ -217,7 +218,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -252,7 +253,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -275,7 +287,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -322,7 +338,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) _request = build_get_request( @@ -348,7 +364,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobExecution", pipeline_response.http_response) 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 d69d853c481b..61a0c1c5aad9 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,32 +39,25 @@ _SERIALIZER.client_side_validation = False -def build_list_by_version_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - subscription_id: str, - **kwargs: Any +def build_list_by_job_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,12 +72,11 @@ def build_list_by_version_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_by_version_request( +def build_get_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, - job_version: int, step_name: str, subscription_id: str, **kwargs: Any @@ -91,20 +84,19 @@ def build_get_by_version_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), "stepName": _SERIALIZER.url("step_name", step_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -120,25 +112,33 @@ def build_get_by_version_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_job_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/jobAgents/{jobAgentName}/jobs/{jobName}/steps", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -148,12 +148,14 @@ def build_list_by_job_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_delete_request( resource_group_name: str, server_name: str, job_agent_name: str, @@ -165,7 +167,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -190,36 +192,35 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_list_by_version_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, - step_name: str, + job_version: int, 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "stepName": _SERIALIZER.url("step_name", step_name, "str"), + "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -229,35 +230,38 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_get_by_version_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, + job_version: int, step_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), "stepName": _SERIALIZER.url("step_name", step_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -267,7 +271,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) class JobStepsOperations: @@ -289,169 +296,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - @distributed_trace - def list_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> ItemPaged["_models.JobStep"]: - """Gets all job steps in the specified job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] - :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", "2020-11-01-preview")) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets the specified version of a job step. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - @distributed_trace def list_by_job( self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any @@ -474,7 +318,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -501,7 +345,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -524,7 +379,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -568,7 +427,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) _request = build_get_request( @@ -593,7 +452,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobStep", pipeline_response.http_response) @@ -716,7 +579,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) @@ -753,7 +616,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobStep", pipeline_response.http_response) @@ -800,7 +667,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -825,7 +692,193 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> ItemPaged["_models.JobStep"]: + """Gets all job steps in the specified job version. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: An iterator like instance of either JobStep or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] + :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", self._config.api_version)) + cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("JobStepListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets the specified version of a job step. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_get_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("JobStep", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 a6d2074419d0..d9550cb588e2 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping import datetime from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,12 +39,13 @@ _SERIALIZER.client_side_validation = False -def build_list_by_job_execution_request( +def build_list_by_step_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, job_execution_id: str, + step_name: str, subscription_id: str, *, create_time_min: Optional[datetime.datetime] = None, @@ -58,13 +60,13 @@ def build_list_by_job_execution_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -72,6 +74,7 @@ def build_list_by_job_execution_request( "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -100,34 +103,27 @@ def build_list_by_job_execution_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_step_request( +def build_get_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, job_execution_id: str, step_name: str, + target_id: str, subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -136,26 +132,13 @@ def build_list_by_step_request( "jobName": _SERIALIZER.url("job_name", job_name, "str"), "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), "stepName": _SERIALIZER.url("step_name", step_name, "str"), + "targetId": _SERIALIZER.url("target_id", target_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -164,27 +147,33 @@ def build_list_by_step_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_list_by_job_execution_request( resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, job_execution_id: str, - step_name: str, - target_id: str, subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -192,14 +181,26 @@ def build_get_request( "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), "jobName": _SERIALIZER.url("job_name", job_name, "str"), "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "stepName": _SERIALIZER.url("step_name", step_name, "str"), - "targetId": _SERIALIZER.url("target_id", target_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -228,13 +229,14 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_by_job_execution( + def list_by_step( # pylint: disable=too-many-locals self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, job_execution_id: str, + step_name: str, create_time_min: Optional[datetime.datetime] = None, create_time_max: Optional[datetime.datetime] = None, end_time_min: Optional[datetime.datetime] = None, @@ -244,7 +246,7 @@ def list_by_job_execution( top: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.JobExecution"]: - """Lists target executions for all steps of a job execution. + """Lists the target executions of a job step execution. :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. @@ -257,6 +259,8 @@ def list_by_job_execution( :type job_name: str :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str :param create_time_min: If specified, only job executions created at or after the specified time are included. Default value is None. :type create_time_min: ~datetime.datetime @@ -283,7 +287,7 @@ def list_by_job_execution( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -297,12 +301,13 @@ def list_by_job_execution( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_job_execution_request( + _request = build_list_by_step_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, job_execution_id=job_execution_id, + step_name=step_name, subscription_id=self._config.subscription_id, create_time_min=create_time_min, create_time_max=create_time_max, @@ -318,7 +323,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -341,14 +357,18 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_step( + def get( self, resource_group_name: str, server_name: str, @@ -356,6 +376,89 @@ def list_by_step( job_name: str, job_execution_id: str, step_name: str, + target_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a target execution. + + :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 job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :param target_id: The target id. Required. + :type target_id: str + :return: JobExecution or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + target_id=target_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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 = self._deserialize("JobExecution", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, create_time_min: Optional[datetime.datetime] = None, create_time_max: Optional[datetime.datetime] = None, end_time_min: Optional[datetime.datetime] = None, @@ -365,7 +468,7 @@ def list_by_step( top: Optional[int] = None, **kwargs: Any ) -> ItemPaged["_models.JobExecution"]: - """Lists the target executions of a job step execution. + """Lists target executions for all steps of a job execution. :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. @@ -378,8 +481,6 @@ def list_by_step( :type job_name: str :param job_execution_id: The id of the job execution. Required. :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str :param create_time_min: If specified, only job executions created at or after the specified time are included. Default value is None. :type create_time_min: ~datetime.datetime @@ -406,7 +507,7 @@ def list_by_step( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -420,13 +521,12 @@ def list_by_step( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_step_request( + _request = build_list_by_job_execution_request( resource_group_name=resource_group_name, server_name=server_name, job_agent_name=job_agent_name, job_name=job_name, job_execution_id=job_execution_id, - step_name=step_name, subscription_id=self._config.subscription_id, create_time_min=create_time_min, create_time_max=create_time_max, @@ -442,7 +542,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -465,88 +576,12 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - target_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a target execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param target_id: The target id. Required. - :type target_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - target_id=target_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 81c2e159f675..840ac68fbc11 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,7 @@ def build_list_by_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +120,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -157,9 +158,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -178,7 +182,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class JobTargetGroupsOperations: @@ -220,7 +227,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -246,7 +253,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -269,7 +287,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -305,7 +327,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -329,7 +351,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobTargetGroup", pipeline_response.http_response) @@ -443,7 +469,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) @@ -479,7 +505,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobTargetGroup", pipeline_response.http_response) @@ -518,7 +548,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -542,7 +572,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 b45ca5559402..d5fa4bc0951d 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,7 @@ def build_list_by_job_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -82,7 +83,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +152,7 @@ def list_by_job( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -178,7 +179,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -201,7 +213,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -245,7 +261,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) _request = build_get_request( @@ -270,7 +286,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("JobVersion", pipeline_response.http_response) 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 4f972246bce3..9efd8cf6642e 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,7 @@ def build_list_by_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +77,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +110,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -142,9 +143,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class JobsOperations: @@ -205,7 +212,7 @@ def list_by_agent( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -231,7 +238,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -254,7 +272,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -290,7 +312,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) _request = build_get_request( @@ -314,7 +336,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Job", pipeline_response.http_response) @@ -427,7 +453,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Job] = kwargs.pop("cls", None) @@ -463,7 +489,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Job", pipeline_response.http_response) @@ -502,7 +532,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -526,7 +556,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 d47c1a76a850..4acfa65f236d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,30 +43,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads", ) 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"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +75,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -91,8 +86,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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,31 +108,36 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/ledgerDigestUploads", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}", ) 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"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -148,9 +147,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) def build_disable_request( @@ -164,7 +165,7 @@ def build_disable_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -210,6 +211,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.LedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :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 + :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] + :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", self._config.api_version)) + cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -245,7 +336,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) _request = build_get_request( @@ -269,7 +360,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_response) @@ -298,7 +393,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -339,12 +434,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -450,7 +553,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -496,81 +599,6 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.LedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 - :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", "2021-02-01-preview")) - cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - def _disable_initial( self, resource_group_name: str, @@ -590,7 +618,7 @@ def _disable_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_disable_request( @@ -619,12 +647,20 @@ def _disable_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -657,7 +693,7 @@ def begin_disable( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LedgerDigestUploads] = 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/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py index d5c0e8dd90f6..1a841ba430c1 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -53,7 +54,7 @@ def build_list_by_location_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -95,7 +96,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +142,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -188,7 +189,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -230,7 +231,7 @@ def build_delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -272,7 +273,7 @@ def build_change_access_tier_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -317,7 +318,7 @@ def build_copy_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -362,7 +363,7 @@ def build_lock_time_based_immutability_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -404,7 +405,7 @@ def build_remove_legal_hold_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -446,7 +447,7 @@ def build_remove_time_based_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -488,7 +489,7 @@ def build_set_legal_hold_immutability_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -530,7 +531,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -576,7 +577,7 @@ def build_list_by_resource_group_location_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -620,7 +621,7 @@ def build_list_by_resource_group_server_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -668,7 +669,7 @@ def build_list_by_resource_group_database_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -717,7 +718,7 @@ def build_get_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -761,7 +762,7 @@ def build_delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -805,7 +806,7 @@ def build_change_access_tier_by_resource_group_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -852,7 +853,7 @@ def build_copy_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -899,7 +900,7 @@ def build_lock_time_based_immutability_by_resource_group_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -943,7 +944,7 @@ def build_remove_legal_hold_immutability_by_resource_group_request( # pylint: d _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -987,7 +988,7 @@ def build_remove_time_based_immutability_by_resource_group_request( # pylint: d _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1031,7 +1032,7 @@ def build_set_legal_hold_immutability_by_resource_group_request( # pylint: disa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1075,7 +1076,7 @@ def build_update_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1155,7 +1156,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1181,7 +1182,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1204,7 +1216,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1240,7 +1255,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1267,7 +1282,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1290,7 +1316,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1329,7 +1358,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1357,7 +1386,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1380,7 +1420,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -1421,7 +1464,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_request( @@ -1445,7 +1488,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) @@ -1474,7 +1520,7 @@ def _delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1503,7 +1549,10 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1543,7 +1592,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1602,7 +1651,7 @@ def _change_access_tier_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1643,7 +1692,10 @@ def _change_access_tier_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1755,7 +1807,7 @@ def begin_change_access_tier( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1821,7 +1873,7 @@ def _copy_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1862,7 +1914,10 @@ def _copy_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1976,7 +2031,7 @@ def begin_copy( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2041,7 +2096,7 @@ def _lock_time_based_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_lock_time_based_immutability_request( @@ -2070,7 +2125,10 @@ def _lock_time_based_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2111,7 +2169,7 @@ def begin_lock_time_based_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2173,7 +2231,7 @@ def _remove_legal_hold_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_legal_hold_immutability_request( @@ -2202,7 +2260,10 @@ def _remove_legal_hold_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2243,7 +2304,7 @@ def begin_remove_legal_hold_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2305,7 +2366,7 @@ def _remove_time_based_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_time_based_immutability_request( @@ -2334,7 +2395,10 @@ def _remove_time_based_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2375,7 +2439,7 @@ def begin_remove_time_based_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2437,7 +2501,7 @@ def _set_legal_hold_immutability_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_set_legal_hold_immutability_request( @@ -2466,7 +2530,10 @@ def _set_legal_hold_immutability_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2507,7 +2574,7 @@ def begin_set_legal_hold_immutability( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -2570,7 +2637,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -2611,7 +2678,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -2725,7 +2795,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -2801,7 +2871,7 @@ def list_by_resource_group_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2828,7 +2898,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -2851,7 +2932,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2891,7 +2975,7 @@ def list_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -2919,7 +3003,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -2942,7 +3037,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -2985,7 +3083,7 @@ def list_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -3014,7 +3112,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -3037,7 +3146,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -3082,7 +3194,7 @@ def get_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_by_resource_group_request( @@ -3107,7 +3219,10 @@ def get_by_resource_group( 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) @@ -3137,7 +3252,7 @@ def _delete_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_by_resource_group_request( @@ -3167,7 +3282,10 @@ def _delete_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3211,7 +3329,7 @@ def begin_delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -3272,7 +3390,7 @@ def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3314,7 +3432,10 @@ def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-l except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3438,7 +3559,7 @@ def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3506,7 +3627,7 @@ def _copy_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -3548,7 +3669,10 @@ def _copy_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3674,7 +3798,7 @@ def begin_copy_by_resource_group( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -3741,7 +3865,7 @@ def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable= _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_lock_time_based_immutability_by_resource_group_request( @@ -3771,7 +3895,10 @@ def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable= except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3815,7 +3942,7 @@ def begin_lock_time_based_immutability_by_resource_group( # pylint: disable=nam _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -3879,7 +4006,7 @@ def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disabl _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_legal_hold_immutability_by_resource_group_request( @@ -3909,7 +4036,10 @@ def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disabl except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -3953,7 +4083,7 @@ def begin_remove_legal_hold_immutability_by_resource_group( # 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4017,7 +4147,7 @@ def _remove_time_based_immutability_by_resource_group_initial( # pylint: disabl _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_remove_time_based_immutability_by_resource_group_request( @@ -4047,7 +4177,10 @@ def _remove_time_based_immutability_by_resource_group_initial( # pylint: disabl except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4091,7 +4224,7 @@ def begin_remove_time_based_immutability_by_resource_group( # 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4155,7 +4288,7 @@ def _set_legal_hold_immutability_by_resource_group_initial( # 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_set_legal_hold_immutability_by_resource_group_request( @@ -4185,7 +4318,10 @@ def _set_legal_hold_immutability_by_resource_group_initial( # pylint: disable=n except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4229,7 +4365,7 @@ def begin_set_legal_hold_immutability_by_resource_group( # pylint: disable=name _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -4294,7 +4430,7 @@ def _update_by_resource_group_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -4336,7 +4472,10 @@ def _update_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -4462,7 +4601,7 @@ def begin_update_by_resource_group( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionBackupOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 52ed006107e6..b43ca4ab5192 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -41,36 +42,48 @@ _SERIALIZER.client_side_validation = False -def build_get_request( +def build_list_by_location_request( location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -79,75 +92,81 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_list_by_database_request( location_name: str, managed_instance_name: str, database_name: str, - backup_name: str, subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( + +def build_get_request( location_name: str, managed_instance_name: str, database_name: str, + backup_name: str, subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -156,51 +175,47 @@ def build_list_by_database_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_instance_request( +def build_delete_request( location_name: str, managed_instance_name: str, + database_name: str, + backup_name: str, subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_location_request( +def build_list_by_instance_request( location_name: str, + managed_instance_name: str, subscription_id: str, *, only_latest_per_database: Optional[bool] = None, @@ -210,16 +225,17 @@ def build_list_by_location_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -240,38 +256,50 @@ def build_list_by_location_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_by_resource_group_request( +def build_list_by_resource_group_location_request( # pylint: disable=name-too-long resource_group_name: str, location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -280,79 +308,85 @@ def build_get_by_resource_group_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_by_resource_group_request( +def build_list_by_resource_group_database_request( # pylint: disable=name-too-long resource_group_name: str, location_name: str, managed_instance_name: str, database_name: str, - backup_name: str, subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_database_request( # pylint: disable=name-too-long + +def build_get_by_resource_group_request( resource_group_name: str, location_name: str, managed_instance_name: str, database_name: str, + backup_name: str, subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -361,54 +395,50 @@ def build_list_by_resource_group_database_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_instance_request( # pylint: disable=name-too-long +def build_delete_by_resource_group_request( resource_group_name: str, location_name: str, managed_instance_name: str, + database_name: str, + backup_name: str, subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_resource_group_location_request( # pylint: disable=name-too-long +def build_list_by_resource_group_instance_request( # pylint: disable=name-too-long resource_group_name: str, location_name: str, + managed_instance_name: str, subscription_id: str, *, only_latest_per_database: Optional[bool] = None, @@ -418,17 +448,18 @@ def build_list_by_resource_group_location_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -454,19 +485,234 @@ class LongTermRetentionManagedInstanceBackupsOperations: # pylint: disable=name .. warning:: **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`long_term_retention_managed_instance_backups` attribute. - """ + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlManagementClient`'s + :attr:`long_term_retention_managed_instance_backups` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_location( + self, + location_name: str, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :param only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :type only_latest_per_database: bool + :param database_state: Whether to query against just live databases, just deleted databases, or + all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + location_name: str, + managed_instance_name: str, + database_name: str, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :type only_latest_per_database: bool + :param database_state: Whether to query against just live databases, just deleted databases, or + all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - models = _models + return pipeline_response - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return ItemPaged(get_next, extract_data) @distributed_trace def get( @@ -497,7 +743,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_request( @@ -521,7 +767,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) @@ -544,7 +794,7 @@ def _delete_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -573,12 +823,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -603,7 +861,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -643,23 +901,20 @@ 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 @distributed_trace - def list_by_database( + def list_by_instance( self, location_name: str, managed_instance_name: str, - database_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. + """Lists the long term retention backups for a given managed instance. :param location_name: The location of the database. Required. :type location_name: str :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool @@ -675,7 +930,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -689,10 +944,9 @@ def list_by_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_database_request( + _request = build_list_by_instance_request( location_name=location_name, managed_instance_name=managed_instance_name, - database_name=database_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, @@ -703,7 +957,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -726,33 +991,48 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_instance( + def list_by_resource_group_location( self, + resource_group_name: str, location_name: str, - managed_instance_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. + """Lists the long term retention backups for managed databases in a given location. + :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 location_name: The location of the database. Required. :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. :type database_state: str or ~azure.mgmt.sql.models.DatabaseState + :param skip: The number of elements in the collection to skip. Default value is None. + :type skip: int + :param top: The number of elements to return from the collection. Default value is None. + :type top: int + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the result of cls(response) :rtype: @@ -762,7 +1042,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -776,12 +1056,15 @@ def list_by_instance( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_instance_request( + _request = build_list_by_resource_group_location_request( + resource_group_name=resource_group_name, location_name=location_name, - managed_instance_name=managed_instance_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, + skip=skip, + top=top, + filter=filter, api_version=api_version, headers=_headers, params=_params, @@ -789,7 +1072,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -812,24 +1106,38 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) @distributed_trace - def list_by_location( + def list_by_resource_group_database( self, + resource_group_name: str, location_name: str, + managed_instance_name: str, + database_name: str, only_latest_per_database: Optional[bool] = None, database_state: Optional[Union[str, _models.DatabaseState]] = None, **kwargs: Any ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. + """Lists all long term retention backups for a managed database. + :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 location_name: The location of the database. Required. :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str :param only_latest_per_database: Whether or not to only get the latest backup for each database. Default value is None. :type only_latest_per_database: bool @@ -845,7 +1153,7 @@ def list_by_location( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -859,8 +1167,11 @@ def list_by_location( def prepare_request(next_link=None): if not next_link: - _request = build_list_by_location_request( + _request = build_list_by_resource_group_database_request( + resource_group_name=resource_group_name, location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, subscription_id=self._config.subscription_id, only_latest_per_database=only_latest_per_database, database_state=database_state, @@ -871,7 +1182,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -894,7 +1216,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -938,7 +1264,7 @@ def get_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) _request = build_get_by_resource_group_request( @@ -963,7 +1289,11 @@ def get_by_resource_group( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) @@ -992,7 +1322,7 @@ def _delete_by_resource_group_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_by_resource_group_request( @@ -1022,12 +1352,20 @@ def _delete_by_resource_group_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1061,7 +1399,7 @@ def begin_delete_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1101,101 +1439,6 @@ 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 - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def list_by_resource_group_instance( self, @@ -1230,7 +1473,7 @@ def list_by_resource_group_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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1258,94 +1501,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1368,7 +1535,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 2ae534acf82f..63a543dcca93 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +124,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -193,7 +194,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -219,7 +220,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -242,7 +254,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -284,7 +299,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -308,7 +323,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_response) @@ -338,7 +356,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -379,7 +397,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -493,7 +514,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 55dc2b957b2f..68d7b8d3dc72 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 @@ -48,7 +48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -132,7 +132,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) _request = build_get_request( @@ -156,7 +156,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("MaintenanceWindowOptions", pipeline_response.http_response) 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 5af9893d7ad4..b0f57e6b382d 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 @@ -49,7 +49,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -169,7 +169,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) _request = build_get_request( @@ -306,7 +306,7 @@ def create_or_update( # pylint: disable=inconsistent-return-statements _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) 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 dff2cdbb2679..ef80707c5410 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,30 +43,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, managed_instance_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +75,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -91,8 +86,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,14 +108,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -132,7 +124,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,27 +151,34 @@ def build_update_request( _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) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_update_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/databases/{databaseName}/backupShortTermRetentionPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -189,9 +188,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) class ManagedBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long @@ -213,6 +214,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a managed database's short term retention policy list. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -248,7 +341,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -272,7 +365,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -301,7 +398,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -342,12 +439,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -454,7 +559,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -520,7 +625,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -561,12 +666,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -673,7 +786,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -718,80 +831,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a managed database's short term retention policy list. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 03aa74f71a79..15c2e82d7238 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -194,7 +195,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -220,7 +221,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -243,7 +255,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -286,7 +302,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", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -310,7 +326,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) @@ -430,7 +450,7 @@ def 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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) @@ -466,7 +486,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) 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 e41b197f32b5..f0a7f58e1f1c 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -53,7 +54,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,7 +104,7 @@ def build_list_by_table_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -146,7 +147,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -234,7 +235,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -265,7 +266,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -288,7 +300,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -328,7 +344,7 @@ def list_by_table( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -357,7 +373,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -380,7 +407,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -427,7 +458,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) _request = build_get_request( @@ -453,7 +484,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseColumn", pipeline_response.http_response) 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 4d4965607109..c0b8b404c09d 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -49,7 +50,7 @@ def build_list_by_location_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +87,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -161,7 +162,7 @@ def list_by_location( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -188,7 +189,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -211,7 +223,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -245,7 +261,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) _request = build_get_request( @@ -268,7 +284,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseMoveOperationResult", pipeline_response.http_response) 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 10fc7f567a60..7bd610503eca 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,7 +91,7 @@ def build_list_by_query_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +173,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) _request = build_get_request( @@ -196,7 +197,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceQuery", pipeline_response.http_response) @@ -242,7 +247,7 @@ def list_by_query( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -272,7 +277,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -295,7 +311,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 3d85158c33d7..22a8b17acf1f 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 @@ -43,8 +43,10 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -65,6 +67,7 @@ def build_update_request( # 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) @@ -184,7 +187,7 @@ def update( # pylint: disable=inconsistent-return-statements _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -219,7 +222,11 @@ def update( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 0af64cb9908f..aa141b88e9e9 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 @@ -47,7 +47,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -128,7 +128,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) _request = build_get_request( @@ -152,7 +152,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseRestoreDetailsResult", pipeline_response.http_response) 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 9e7cdc4cdd68..8cbc4c92aa0c 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -49,7 +50,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +89,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -162,7 +163,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -189,7 +190,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -212,7 +224,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -248,7 +264,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) _request = build_get_request( @@ -272,7 +288,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseSchema", pipeline_response.http_response) 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 4ef5f399e8c1..bac1ae4861bb 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,30 +39,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, managed_instance_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -76,7 +71,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -87,8 +82,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,31 +104,36 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/databases/{databaseName}/securityAlertPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -144,9 +143,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class ManagedDatabaseSecurityAlertPoliciesOperations: # pylint: disable=name-too-long @@ -168,6 +169,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: + """Gets a list of managed database's security alert policies. + + :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 database_name: The name of the managed database for which the security alert policies + are defined. Required. + :type database_name: str + :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result + of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -187,7 +280,7 @@ def get( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy @@ -204,7 +297,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -228,7 +321,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -259,7 +356,7 @@ def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy @@ -293,7 +390,7 @@ def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Required. :type parameters: IO[bytes] @@ -325,7 +422,7 @@ def create_or_update( :param database_name: The name of the managed database for which the security alert policy is defined. Required. :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :param security_alert_policy_name: The name of the security alert policy. "default" Required. :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The database security alert policy. Is either a ManagedDatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. @@ -345,7 +442,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) @@ -381,7 +478,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) @@ -389,80 +490,3 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: - """Gets a list of managed database's security alert policies. - - :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 database_name: The name of the managed database for which the security alert policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result - of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 4b1099bfcb17..77639063dc53 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -52,7 +53,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +145,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -174,7 +175,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -197,7 +209,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 9b7a0334506b..434d1180e487 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,42 +39,44 @@ _SERIALIZER.client_side_validation = False -def build_get_request( +def build_list_current_by_database_request( resource_group_name: str, managed_instance_name: str, database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], subscription_id: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if count is not None: + _params["$count"] = _SERIALIZER.query("count", count, "bool") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers @@ -82,67 +85,106 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_update_request( + resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) + 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}/databases/{databaseName}/currentSensitivityLabels", + ) + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_recommended_by_database_request( # pylint: disable=name-too-long resource_group_name: str, managed_instance_name: str, database_name: str, - schema_name: str, - table_name: str, - column_name: str, subscription_id: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if include_disabled_recommendations is not None: + _params["includeDisabledRecommendations"] = _SERIALIZER.query( + "include_disabled_recommendations", include_disabled_recommendations, "bool" + ) + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, schema_name: str, table_name: str, column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -164,10 +206,13 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_disable_recommendation_request( + +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -177,14 +222,18 @@ def build_disable_recommendation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -202,10 +251,15 @@ def build_disable_recommendation_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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_enable_recommendation_request( + +def build_delete_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -215,14 +269,17 @@ def build_enable_recommendation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -240,72 +297,86 @@ def build_enable_recommendation_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_current_by_database_request( + +def build_disable_recommendation_request( resource_group_name: str, managed_instance_name: str, database_name: str, + schema_name: str, + table_name: str, + column_name: str, subscription_id: str, - *, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_enable_recommendation_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -315,33 +386,30 @@ def build_update_request( _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_recommended_by_database_request( # pylint: disable=name-too-long +def build_list_by_database_request( resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, *, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, filter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -353,12 +421,6 @@ def build_list_recommended_by_database_request( # pylint: disable=name-too-long _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if include_disabled_recommendations is not None: - _params["includeDisabledRecommendations"] = _SERIALIZER.query( - "include_disabled_recommendations", include_disabled_recommendations, "bool" - ) if filter is not None: _params["$filter"] = _SERIALIZER.query("filter", filter, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -374,19 +436,373 @@ class ManagedDatabaseSensitivityLabelsOperations: # pylint: disable=name-too-lo .. warning:: **DO NOT** instantiate this class directly. - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_sensitivity_labels` attribute. - """ + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlManagementClient`'s + :attr:`managed_database_sensitivity_labels` attribute. + """ + + models = _models + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param skip_token: Default value is None. + :type skip_token: str + :param count: Default value is None. + :type count: bool + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_current_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: 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: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = 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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = 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, "SensitivityLabelUpdateList") + + _request = build_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param skip_token: Default value is None. + :type skip_token: str + :param include_disabled_recommendations: Specifies whether to include disabled recommendations + or not. Default value is None. + :type include_disabled_recommendations: bool + :param filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_recommended_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - models = _models + return pipeline_response - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + return ItemPaged(get_next, extract_data) @distributed_trace def get( @@ -433,7 +849,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) _request = build_get_request( @@ -460,7 +876,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -593,7 +1013,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) @@ -632,7 +1052,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -683,7 +1107,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -710,7 +1134,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -757,7 +1185,7 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_disable_recommendation_request( @@ -784,7 +1212,11 @@ def disable_recommendation( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -832,7 +1264,7 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_enable_recommendation_request( @@ -859,246 +1291,21 @@ def enable_recommendation( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def list_recommended_by_database( + def list_by_database( self, resource_group_name: str, managed_instance_name: str, database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, filter: Optional[str] = None, **kwargs: Any ) -> ItemPaged["_models.SensitivityLabel"]: @@ -1111,11 +1318,6 @@ def list_recommended_by_database( :type managed_instance_name: str :param database_name: The name of the database. Required. :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool :param filter: An OData filter expression that filters elements in the collection. Default value is None. :type filter: str @@ -1126,7 +1328,7 @@ def list_recommended_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1140,13 +1342,11 @@ def list_recommended_by_database( def prepare_request(next_link=None): if not next_link: - _request = build_list_recommended_by_database_request( + _request = build_list_by_database_request( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, database_name=database_name, subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, filter=filter, api_version=api_version, headers=_headers, @@ -1155,7 +1355,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1178,7 +1389,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 304a71a78967..01c162d45dd7 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -50,7 +51,7 @@ def build_list_by_schema_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +92,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +170,7 @@ def list_by_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -197,7 +198,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -220,7 +232,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -264,7 +280,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) _request = build_get_request( @@ -289,7 +305,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseTable", pipeline_response.http_response) 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 da5824c7b233..3016397782f0 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,30 +39,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, managed_instance_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -76,7 +71,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -87,8 +82,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,31 +104,36 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/databases/{databaseName}/transparentDataEncryption", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -144,9 +143,11 @@ def build_list_by_database_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class ManagedDatabaseTransparentDataEncryptionOperations: # pylint: disable=name-too-long @@ -168,6 +169,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedTransparentDataEncryption"]: + """Gets a list of managed database's transparent data encryptions. + + :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 database_name: The name of the managed database for which the transparent data + encryption is defined. Required. + :type database_name: str + :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -204,7 +297,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) _request = build_get_request( @@ -228,7 +321,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) @@ -345,7 +442,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) @@ -381,7 +478,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) @@ -389,80 +490,3 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedTransparentDataEncryption"]: - """Gets a list of managed database's transparent data encryptions. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 e6c2c3f19ace..ae518909c4d7 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 @@ -50,7 +50,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -94,7 +94,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -138,9 +138,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +166,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long @@ -230,7 +236,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -256,7 +262,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -401,7 +411,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -439,7 +449,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) @@ -493,7 +507,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -519,7 +533,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 7d95bf53f0c6..6ff512347dd9 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -41,22 +42,24 @@ _SERIALIZER.client_side_validation = False -def build_initiate_scan_request( +def build_list_by_database_request( resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -65,7 +68,6 @@ def build_initiate_scan_request( "vulnerabilityAssessmentName": _SERIALIZER.url( "vulnerability_assessment_name", vulnerability_assessment_name, "str" ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,10 +76,13 @@ def build_initiate_scan_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_export_request( + +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -89,13 +94,13 @@ def build_export_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -116,27 +121,28 @@ def build_export_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( +def build_export_request( resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -145,6 +151,7 @@ def build_list_by_database_request( "vulnerabilityAssessmentName": _SERIALIZER.url( "vulnerability_assessment_name", vulnerability_assessment_name, "str" ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -156,10 +163,10 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_initiate_scan_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -171,13 +178,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -198,7 +205,7 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class ManagedDatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long @@ -220,15 +227,38 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _initiate_scan_initial( + @distributed_trace + def list_by_database( self, resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, **kwargs: Any - ) -> Iterator[bytes]: + ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :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", self._config.api_version)) + cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -237,50 +267,68 @@ def _initiate_scan_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + 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) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return pipeline_response - return deserialized # type: ignore + return ItemPaged(get_next, extract_data) @distributed_trace - def begin_initiate_scan( + def get( self, resource_group_name: str, managed_instance_name: str, @@ -288,8 +336,8 @@ def begin_initiate_scan( vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], scan_id: str, **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. :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. @@ -303,52 +351,58 @@ def begin_initiate_scan( :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. :type scan_id: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: VulnerabilityAssessmentScanRecord or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord :raises ~azure.core.exceptions.HttpResponseError: """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._initiate_scan_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore + _request = build_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore @distributed_trace def export( @@ -389,7 +443,7 @@ def export( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) _request = build_export_request( @@ -414,7 +468,11 @@ def export( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) @@ -423,38 +481,15 @@ def export( return deserialized # type: ignore - @distributed_trace - def list_by_database( + def _initiate_scan_initial( self, resource_group_name: str, managed_instance_name: str, database_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, **kwargs: Any - ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", "2020-11-01-preview")) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -463,53 +498,58 @@ def list_by_database( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_initiate_scan_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - return pipeline_response + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def get( + def begin_initiate_scan( self, resource_group_name: str, managed_instance_name: str, @@ -517,8 +557,8 @@ def get( vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], scan_id: str, **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. + ) -> LROPoller[None]: + """Executes a Vulnerability Assessment database scan. :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. @@ -532,51 +572,49 @@ def get( :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :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: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + 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._initiate_scan_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 805285adf8c8..1e42dc014c8a 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,32 +39,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, managed_instance_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +71,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -89,8 +82,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,14 +106,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, database_name: str, @@ -129,9 +119,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -152,27 +146,40 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -184,7 +191,7 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedDatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long @@ -206,6 +213,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessments of a managed database. + + :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 database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -243,7 +342,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -267,7 +366,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -387,7 +490,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -423,7 +526,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) @@ -469,7 +576,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -493,84 +600,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessments of a managed database. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 9a63a2c76ec1..798d8e69f973 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, managed_instance_name: str, database_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -172,7 +179,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -207,8 +214,10 @@ def build_cancel_move_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -229,6 +238,7 @@ def build_cancel_move_request( # 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) @@ -239,8 +249,10 @@ def build_complete_move_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -261,6 +273,7 @@ def build_complete_move_request( # 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) @@ -271,8 +284,10 @@ def build_complete_restore_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -293,6 +308,39 @@ def build_complete_restore_request( # 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_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/reevaluateInaccessibleDatabaseState", + ) + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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) @@ -303,8 +351,10 @@ def build_start_move_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -325,6 +375,7 @@ def build_start_move_request( # 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) @@ -335,7 +386,7 @@ def build_list_inaccessible_by_instance_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -397,7 +448,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -422,7 +473,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -445,7 +507,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -479,7 +545,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -502,7 +568,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_response) @@ -530,7 +600,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -570,12 +640,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -670,7 +748,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -729,7 +807,7 @@ def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -757,12 +835,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -786,7 +872,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -843,7 +929,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -883,12 +969,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -983,7 +1077,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1047,7 +1141,7 @@ def _cancel_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1087,12 +1181,20 @@ def _cancel_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1184,7 +1286,7 @@ def begin_cancel_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1244,7 +1346,7 @@ def _complete_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1284,12 +1386,20 @@ def _complete_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1381,7 +1491,7 @@ def begin_complete_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1441,7 +1551,7 @@ def _complete_restore_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1481,12 +1591,20 @@ def _complete_restore_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1580,7 +1698,7 @@ def begin_complete_restore( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1621,6 +1739,128 @@ 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 _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Reevaluates the inaccessibility state of a managed database. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns either ManagedDatabase or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _start_move_initial( self, resource_group_name: str, @@ -1640,7 +1880,7 @@ def _start_move_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1680,12 +1920,20 @@ def _start_move_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1777,7 +2025,7 @@ def begin_start_move( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1836,7 +2084,7 @@ def list_inaccessible_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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1861,7 +2109,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1884,7 +2143,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 17d73ce51938..6102e8f5cd9e 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +120,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -155,9 +156,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -175,7 +179,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceAdministratorsOperations: @@ -216,7 +223,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -241,7 +248,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -264,7 +282,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -302,7 +324,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) _request = build_get_request( @@ -325,7 +347,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_response) @@ -353,7 +379,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -393,12 +419,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -493,7 +527,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -556,7 +590,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -584,12 +618,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -617,7 +659,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 b489c45a99f8..39ced5ea5550 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -191,7 +192,7 @@ 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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -216,7 +217,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -239,7 +251,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -279,7 +295,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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -302,7 +318,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_response) @@ -330,7 +350,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -370,12 +390,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -479,7 +507,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 a33d12d6db86..c7a40c8270fb 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - subscription_id: str, - **kwargs: Any +def build_list_by_instance_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +74,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, authentication_name: Union[str, _models.AuthenticationName], @@ -88,8 +84,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,23 +105,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, authentication_name: Union[str, _models.AuthenticationName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -144,26 +141,36 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_instance_request( - resource_group_name: str, managed_instance_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -175,7 +182,7 @@ def build_list_by_instance_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long @@ -197,6 +204,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -230,7 +326,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) _request = build_get_request( @@ -253,7 +349,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_response) @@ -281,7 +381,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -321,12 +421,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -433,7 +541,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -498,7 +606,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -526,12 +634,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -560,7 +676,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -597,77 +713,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 5a40ec37715f..6a07616ecd1c 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -119,7 +120,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -185,7 +186,7 @@ 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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -210,7 +211,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -233,7 +245,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -267,7 +283,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) _request = build_get_request( @@ -290,7 +306,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceDtc", pipeline_response.http_response) @@ -318,7 +338,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -358,7 +378,11 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -458,7 +482,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 68aa47e4da5c..dda946e2bfcb 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,25 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_revalidate_request( - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - subscription_id: str, - **kwargs: Any +def build_list_by_instance_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -69,26 +68,34 @@ def build_revalidate_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_instance_request( - resource_group_name: str, managed_instance_name: str, subscription_id: str, **kwargs: Any + +def build_get_request( + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -103,7 +110,7 @@ def build_list_by_instance_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, encryption_protector_name: Union[str, _models.EncryptionProtectorName], @@ -113,7 +120,8 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -134,12 +142,14 @@ def build_get_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_revalidate_request( resource_group_name: str, managed_instance_name: str, encryption_protector_name: Union[str, _models.EncryptionProtectorName], @@ -149,14 +159,13 @@ 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -171,11 +180,9 @@ def build_create_or_update_request( _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceEncryptionProtectorsOperations: # pylint: disable=name-too-long @@ -197,124 +204,6 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - def _revalidate_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revalidate( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> LROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._revalidate_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - @distributed_trace def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -334,7 +223,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -359,7 +248,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -382,7 +282,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -421,7 +325,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) _request = build_get_request( @@ -444,7 +348,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_response) @@ -472,7 +380,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -512,12 +420,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -618,7 +534,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -662,3 +578,129 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ManagedInstanceEncryptionProtector]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + def _revalidate_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_revalidate_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_revalidate( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> LROPoller[None]: + """Revalidates an existing encryption protector. + + :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 encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :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", self._config.api_version)) + 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._revalidate_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 202cc4891d6d..0c82332cf623 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -53,7 +54,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -86,7 +87,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,7 +119,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -150,9 +151,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, managed_instance_name: str, key_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -170,7 +174,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceKeysOperations: @@ -213,7 +220,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -239,7 +246,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -262,7 +280,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -296,7 +318,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) _request = build_get_request( @@ -319,7 +341,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceKey", pipeline_response.http_response) @@ -347,7 +373,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -387,12 +413,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -490,7 +524,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -549,7 +583,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -577,12 +611,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -606,7 +648,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 674cbe4af1f7..d703d32302dd 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,6 +43,38 @@ _SERIALIZER.client_side_validation = False +def build_list_by_database_request( + resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies", + ) + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + def build_get_request( resource_group_name: str, managed_instance_name: str, @@ -53,7 +86,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -91,7 +124,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,24 +154,30 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_delete_request( + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -150,7 +189,7 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceLongTermRetentionPoliciesOperations: # pylint: disable=name-too-long @@ -172,6 +211,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :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 database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -207,7 +338,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -231,7 +362,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) @@ -260,7 +395,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -301,12 +436,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -413,7 +556,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -459,11 +602,81 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: - """Gets a database's long term retention policy. + def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: + """Deletes a managed database's long term retention policy. :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. @@ -472,66 +685,56 @@ def list_by_database( :type managed_instance_name: str :param database_name: The name of the database. Required. :type database_name: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the - result of cls(response) + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: An instance of LROPoller that returns either ManagedInstanceLongTermRetentionPolicy or + the result of cls(response) :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + return LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) 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 fcb536c8d588..e12629cecbeb 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +75,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,9 +104,12 @@ def build_get_request( def build_cancel_request( resource_group_name: str, managed_instance_name: str, operation_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -123,7 +127,10 @@ def build_cancel_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceOperationsOperations: @@ -164,7 +171,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -189,7 +196,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -212,7 +230,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -246,7 +268,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) _request = build_get_request( @@ -269,7 +291,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceOperation", pipeline_response.http_response) @@ -306,7 +332,7 @@ def cancel( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_cancel_request( @@ -329,7 +355,11 @@ def cancel( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 ab293b5e777e..35dffa4062ac 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,30 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - subscription_id: str, - **kwargs: Any +def build_list_by_managed_instance_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +74,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, @@ -90,8 +84,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,23 +107,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, private_endpoint_connection_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -150,26 +145,38 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_managed_instance_request( - resource_group_name: str, managed_instance_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -181,7 +188,7 @@ def build_list_by_managed_instance_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstancePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long @@ -203,6 +210,95 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any @@ -231,7 +327,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -254,7 +350,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstancePrivateEndpointConnection", pipeline_response.http_response) @@ -282,7 +382,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -322,12 +422,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -425,7 +533,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -486,7 +594,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -514,12 +622,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -543,7 +659,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -580,77 +696,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 0e3e343e6dc2..a18bf124b52a 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +75,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -138,7 +139,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -163,7 +164,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -186,7 +198,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -220,7 +236,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -243,7 +259,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstancePrivateLink", pipeline_response.http_response) 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 f0463165439e..58c29252e45d 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 @@ -47,8 +47,10 @@ def build_create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -68,6 +70,7 @@ def build_create_request( # 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) @@ -109,7 +112,7 @@ def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -148,12 +151,20 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -236,7 +247,7 @@ def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 a8955c1c33c8..5783fdd34cb4 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,30 +39,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any +def build_list_by_instance_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -76,7 +70,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], @@ -86,8 +80,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,23 +103,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -146,26 +141,38 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_instance_request( - resource_group_name: str, managed_instance_name: str, subscription_id: str, **kwargs: Any +def build_delete_request( + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -177,7 +184,7 @@ def build_list_by_instance_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ManagedInstanceVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long @@ -199,6 +206,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: + """Gets the managed instance's vulnerability assessment policies. + + :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 for which the vulnerability + assessments is defined. Required. + :type managed_instance_name: str + :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -233,7 +330,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -256,7 +353,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) @@ -373,7 +474,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -408,7 +509,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) @@ -451,7 +556,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -474,82 +579,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: - """Gets the managed instance's vulnerability assessment policies. - - :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 for which the vulnerability - assessments is defined. Required. - :type managed_instance_name: str - :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 2013569b46c7..1e70148a08c3 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -46,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -112,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -149,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -182,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -213,9 +214,12 @@ def build_create_or_update_request( def build_delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -232,7 +236,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -241,7 +248,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -277,9 +284,12 @@ def build_failover_request( replica_type: Optional[Union[str, _models.ReplicaType]] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -298,7 +308,10 @@ def build_failover_request( _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) def build_list_outbound_network_dependencies_by_managed_instance_request( # pylint: disable=name-too-long @@ -307,7 +320,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -332,13 +345,44 @@ def build_list_outbound_network_dependencies_by_managed_instance_request( # pyl return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long + 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", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/reevaluateInaccessibleDatabaseState", + ) + 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_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -369,7 +413,7 @@ def build_start_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -400,7 +444,7 @@ def build_stop_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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -442,7 +486,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", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -481,7 +525,41 @@ def build_list_by_managed_instance_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class ManagedInstancesOperations: +def build_validate_azure_key_vault_encryption_key_request( # pylint: disable=name-too-long + 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", "2025-01-01")) + 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}/validateAzureKeyVaultEncryptionKey", + ) + 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 + 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 ManagedInstancesOperations: # pylint: disable=too-many-public-methods """ .. warning:: **DO NOT** instantiate this class directly. @@ -513,7 +591,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_model _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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -537,7 +615,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -560,7 +649,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -586,7 +679,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -612,7 +705,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -635,7 +739,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -659,7 +767,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -684,7 +792,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -707,7 +826,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -741,7 +864,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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) _request = build_get_request( @@ -764,7 +887,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedInstance", pipeline_response.http_response) @@ -791,7 +918,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -830,12 +957,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -921,7 +1056,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", self._config.api_version)) 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) @@ -977,7 +1112,7 @@ def _delete_initial(self, resource_group_name: str, managed_instance_name: str, _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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1004,12 +1139,20 @@ def _delete_initial(self, resource_group_name: str, managed_instance_name: str, except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1029,7 +1172,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", self._config.api_version)) 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) @@ -1084,7 +1227,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1123,12 +1266,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1214,7 +1365,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", self._config.api_version)) 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) @@ -1276,7 +1427,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1304,12 +1455,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1338,7 +1497,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", self._config.api_version)) 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) @@ -1395,7 +1554,7 @@ 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", self._config.api_version)) cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1420,7 +1579,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1443,12 +1613,129 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_reevaluate_inaccessible_database_state_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.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Reevaluates the inaccessibility state of all managed databases. + + :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 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", self._config.api_version)) + 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._reevaluate_inaccessible_database_state_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 + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + def _refresh_status_initial( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> Iterator[bytes]: @@ -1463,7 +1750,7 @@ def _refresh_status_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_status_request( @@ -1490,13 +1777,20 @@ def _refresh_status_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1520,7 +1814,7 @@ def begin_refresh_status( _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", self._config.api_version)) 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) @@ -1577,7 +1871,7 @@ def _start_initial(self, resource_group_name: str, managed_instance_name: str, * _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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_start_request( @@ -1604,12 +1898,20 @@ def _start_initial(self, resource_group_name: str, managed_instance_name: str, * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1632,7 +1934,7 @@ def begin_start( _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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1687,7 +1989,7 @@ def _stop_initial(self, resource_group_name: str, managed_instance_name: str, ** _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", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_stop_request( @@ -1714,12 +2016,20 @@ def _stop_initial(self, resource_group_name: str, managed_instance_name: str, ** except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1742,7 +2052,7 @@ def begin_stop( _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", self._config.api_version)) cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -1832,7 +2142,7 @@ 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", self._config.api_version)) cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1864,7 +2174,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1887,8 +2208,207 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest") + + _request = build_validate_azure_key_vault_encryption_key_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest + :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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key 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 None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Validates customer managed key. + + :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 parameters: The validate azure key vault encryption key parameters. Is either a + ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest type or a IO[bytes] type. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or IO[bytes] + :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 = 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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + 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._validate_azure_key_vault_encryption_key_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 8c1fcbc1f6f8..b00272c6b6ec 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +124,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -164,7 +165,7 @@ def build_disable_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +232,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -257,7 +258,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -280,7 +292,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -321,7 +337,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) _request = build_get_request( @@ -345,7 +361,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_response) @@ -374,7 +394,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -415,12 +435,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -530,7 +558,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -595,7 +623,7 @@ def _disable_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_disable_request( @@ -624,12 +652,20 @@ def _disable_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -662,7 +698,7 @@ def begin_disable( _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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedLedgerDigestUploads] = 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/_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 42f82eab53d2..71ccb1229479 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( +def build_list_by_restorable_dropped_database_request( # pylint: disable=name-too-long resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -67,7 +67,6 @@ def build_get_request( "restorableDroppedDatabaseId": _SERIALIZER.url( "restorable_dropped_database_id", restorable_dropped_database_id, "str" ), - "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -82,7 +81,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, @@ -93,8 +92,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,14 +116,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( +def build_create_or_update_request( resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, @@ -136,7 +132,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -165,26 +161,28 @@ def build_update_request( _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) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_restorable_dropped_database_request( # pylint: disable=name-too-long +def build_update_request( resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -192,6 +190,7 @@ def build_list_by_restorable_dropped_database_request( # pylint: disable=name-t "restorableDroppedDatabaseId": _SERIALIZER.url( "restorable_dropped_database_id", restorable_dropped_database_id, "str" ), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -201,9 +200,11 @@ def build_list_by_restorable_dropped_database_request( # pylint: disable=name-t _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long @@ -225,6 +226,98 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_restorable_dropped_database( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a dropped database's short term retention policy list. + + :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 restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_restorable_dropped_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -260,7 +353,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -284,7 +377,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) @@ -313,7 +410,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -354,12 +451,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -466,7 +571,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -532,7 +637,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -573,12 +678,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -685,7 +798,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -730,80 +843,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_restorable_dropped_database( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a dropped database's short term retention policy list. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_restorable_dropped_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 4906176a111b..5f8ebb455de5 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, managed_instance_name: str, dns_alias_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_acquire_request( @@ -172,7 +179,7 @@ def build_acquire_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -239,7 +246,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -264,7 +271,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -287,7 +305,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -321,7 +343,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) _request = build_get_request( @@ -344,7 +366,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_response) @@ -372,7 +398,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -412,12 +438,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -512,7 +546,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -571,7 +605,7 @@ def _delete_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -599,12 +633,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -628,7 +670,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -685,7 +727,7 @@ def _acquire_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -725,12 +767,20 @@ def _acquire_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -825,7 +875,7 @@ def begin_acquire( _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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 e89f552a036a..306d1341965b 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_instance_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,18 +74,17 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,30 +105,34 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_instance_request( - resource_group_name: str, managed_instance_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/securityAlertPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -143,9 +142,11 @@ def build_list_by_instance_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class ManagedServerSecurityAlertPoliciesOperations: # pylint: disable=name-too-long @@ -167,12 +168,100 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedServerSecurityAlertPolicy"]: + """Get the managed server's threat detection policies. + + :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_instance_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.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], **kwargs: Any ) -> _models.ManagedServerSecurityAlertPolicy: """Get a managed server's threat detection policy. @@ -183,7 +272,8 @@ def get( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :return: ManagedServerSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -199,7 +289,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -222,7 +312,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_response) @@ -235,7 +329,7 @@ def _create_or_update_initial( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: @@ -250,7 +344,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -290,12 +384,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -304,7 +406,7 @@ def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: _models.ManagedServerSecurityAlertPolicy, *, content_type: str = "application/json", @@ -318,7 +420,8 @@ def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -335,7 +438,7 @@ def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: IO[bytes], *, content_type: str = "application/json", @@ -349,7 +452,8 @@ def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -366,7 +470,7 @@ def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: @@ -378,7 +482,8 @@ def begin_create_or_update( :param managed_instance_name: The name of the managed instance. Required. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The managed server security alert policy. Is either a ManagedServerSecurityAlertPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or IO[bytes] @@ -390,7 +495,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -434,76 +539,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ManagedServerSecurityAlertPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedServerSecurityAlertPolicy"]: - """Get the managed server's threat detection policies. - - :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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/_network_security_perimeter_configurations_operations.py similarity index 51% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_network_security_perimeter_configurations_operations.py index b25c0a1efc1c..587f322a7722 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/_network_security_perimeter_configurations_operations.py @@ -7,8 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,51 +42,24 @@ _SERIALIZER.client_side_validation = False -def build_delete_request( - resource_group_name: str, server_name: str, communication_link_name: 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", "2014-04-01")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}", - ) - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, communication_link_name: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -100,26 +73,25 @@ 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, communication_link_name: str, subscription_id: str, **kwargs: Any +def build_get_request( + resource_group_name: str, server_name: str, nsp_config_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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "communicationLinkName": _SERIALIZER.url("communication_link_name", communication_link_name, "str"), + "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -128,31 +100,30 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_reconcile_request( + resource_group_name: str, server_name: str, nsp_config_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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -163,17 +134,17 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -class ServerCommunicationLinksOperations: +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_communication_links` attribute. + :attr:`network_security_perimeter_configurations` attribute. """ models = _models @@ -186,22 +157,28 @@ def __init__(self, *args, **kwargs) -> None: self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, communication_link_name: str, **kwargs: Any - ) -> None: - """Deletes a server communication link. + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for a server. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :return: None or the result of cls(response) - :rtype: None + :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the + result of cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] :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", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) + error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -210,52 +187,79 @@ def delete( # pylint: disable=inconsistent-return-statements } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2014-04-01")) - cls: ClsType[None] = kwargs.pop("cls", None) + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - communication_link_name=communication_link_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + def extract_data(pipeline_response): + deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - response = pipeline_response.http_response + def get_next(next_link=None): + _request = prepare_request(next_link) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if cls: - return cls(pipeline_response, None, {}) # type: ignore + 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) + + return pipeline_response + + return ItemPaged(get_next, extract_data) @distributed_trace def get( - self, resource_group_name: str, server_name: str, communication_link_name: str, **kwargs: Any - ) -> _models.ServerCommunicationLink: - """Returns a server communication link. + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets a network security perimeter configuration. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :return: ServerCommunicationLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerCommunicationLink + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping = { @@ -269,13 +273,13 @@ 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", "2014-04-01")) - cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, + nsp_config_name=nsp_config_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -292,22 +296,21 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = self._deserialize("ServerCommunicationLink", pipeline_response.http_response) + deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: Union[_models.ServerCommunicationLink, IO[bytes]], - **kwargs: Any + def _reconcile_initial( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -317,30 +320,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = 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, "ServerCommunicationLink") - - _request = build_create_or_update_request( + _request = build_reconcile_request( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, + nsp_config_name=nsp_config_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -354,126 +345,62 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [201, 202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: _models.ServerCommunicationLink, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. - - :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. Required. - :type parameters: ~azure.mgmt.sql.models.ServerCommunicationLink - :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 ServerCommunicationLink or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. - - :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. 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 ServerCommunicationLink or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - communication_link_name: str, - parameters: Union[_models.ServerCommunicationLink, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerCommunicationLink]: - """Creates a server communication link. + def begin_reconcile( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile network security perimeter configuration for SQL Resource Provider. :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 communication_link_name: The name of the server communication link. Required. - :type communication_link_name: str - :param parameters: The required parameters for creating a server communication link. Is either - a ServerCommunicationLink type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerCommunicationLink or IO[bytes] - :return: An instance of LROPoller that returns either ServerCommunicationLink or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerCommunicationLink] + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: An instance of LROPoller that returns either NetworkSecurityPerimeterConfiguration or + the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2014-04-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerCommunicationLink] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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( + raw_result = self._reconcile_initial( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, - parameters=parameters, + nsp_config_name=nsp_config_name, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -483,97 +410,26 @@ def begin_create_or_update( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerCommunicationLink", pipeline_response.http_response) + deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_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)) + 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.ServerCommunicationLink].from_continuation_token( + return LROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ServerCommunicationLink]( + return LROPoller[_models.NetworkSecurityPerimeterConfiguration]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerCommunicationLink"]: - """Gets a list of server communication links. - - :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 - :return: An iterator like instance of either ServerCommunicationLink or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerCommunicationLink] - :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", "2014-04-01")) - cls: ClsType[_models.ServerCommunicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerCommunicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 0f3453ef5710..245c234273d4 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -40,7 +41,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,7 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -107,7 +108,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -130,7 +142,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 4cd5d2664be7..cfc639928d42 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,8 +7,8 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +42,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, outbound_rule_fqdn: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,14 +73,13 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,19 +100,20 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -132,26 +131,30 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -163,7 +166,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class OutboundFirewallRulesOperations: @@ -185,6 +188,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.OutboundFirewallRule"]: + """Gets all outbound firewall rules on a server. + + :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 + :return: An iterator like instance of either OutboundFirewallRule or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] + :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", self._config.api_version)) + cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any @@ -213,7 +304,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -236,7 +327,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("OutboundFirewallRule", pipeline_response.http_response) @@ -246,12 +341,7 @@ def get( return deserialized # type: ignore def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: Union[_models.OutboundFirewallRule, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -261,30 +351,18 @@ def _create_or_update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = 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, "OutboundFirewallRule") - _request = build_create_or_update_request( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -304,85 +382,26 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: _models.OutboundFirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.OutboundFirewallRule - :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 OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: 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 OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - outbound_rule_fqdn: str, - parameters: Union[_models.OutboundFirewallRule, IO[bytes]], - **kwargs: Any + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any ) -> LROPoller[_models.OutboundFirewallRule]: """Create a outbound firewall rule with a given name. @@ -393,18 +412,15 @@ def begin_create_or_update( :type server_name: str :param outbound_rule_fqdn: Required. :type outbound_rule_fqdn: str - :param parameters: Is either a OutboundFirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.OutboundFirewallRule or IO[bytes] :return: An instance of LROPoller that returns either OutboundFirewallRule or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2021-02-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -414,9 +430,7 @@ def begin_create_or_update( resource_group_name=resource_group_name, server_name=server_name, outbound_rule_fqdn=outbound_rule_fqdn, - parameters=parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -462,7 +476,7 @@ def _delete_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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -490,12 +504,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -519,7 +541,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -556,76 +578,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundFirewallRule"]: - """Gets all outbound firewall rules on a server. - - :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 - :return: An iterator like instance of either OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", "2021-02-01-preview")) - cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 56667861da73..48e5ceda7f15 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,9 +160,12 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -181,7 +185,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class PrivateEndpointConnectionsOperations: @@ -222,7 +229,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -247,7 +254,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -270,7 +288,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -304,7 +326,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) _request = build_get_request( @@ -327,7 +349,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) @@ -355,7 +381,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -395,12 +421,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -494,7 +528,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -553,7 +587,7 @@ def _delete_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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -581,12 +615,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -610,7 +652,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 3485f279557d..c03c5642d37e 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +75,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -137,7 +138,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -162,7 +163,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -185,7 +197,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -219,7 +235,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) _request = build_get_request( @@ -242,7 +258,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("PrivateLinkResource", pipeline_response.http_response) 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 ff07136bc5fc..b172d516d82a 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 @@ -43,8 +43,10 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -65,6 +67,7 @@ def build_update_request( # 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) @@ -184,7 +187,7 @@ def update( # pylint: disable=inconsistent-return-statements _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -219,7 +222,11 @@ def update( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 8000fb2fa9ae..c2ef45a2e241 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -148,7 +149,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -173,7 +174,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -196,7 +208,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -241,7 +257,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -266,7 +282,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RecoverableDatabase", pipeline_response.http_response) 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 e20c6aa82edf..3cf6e67c1854 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +79,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -142,7 +143,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -167,7 +168,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -190,7 +202,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -224,7 +240,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -247,7 +263,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RecoverableManagedDatabase", pipeline_response.http_response) 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 71bb3228923b..a7f4aaccc55d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -113,7 +114,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -146,9 +147,12 @@ def build_create_or_update_request( def build_delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -167,7 +171,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -176,7 +183,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", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -212,7 +219,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +252,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -278,7 +285,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -342,7 +349,7 @@ 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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -368,7 +375,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -391,7 +409,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -427,7 +449,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", self._config.api_version)) cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) _request = build_get_request( @@ -451,7 +473,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ReplicationLink", pipeline_response.http_response) @@ -480,7 +506,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -521,13 +547,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -630,7 +663,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", self._config.api_version)) 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) @@ -690,7 +723,7 @@ def _delete_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")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -719,12 +752,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -750,7 +791,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -809,7 +850,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", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -850,13 +891,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -959,7 +1007,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", self._config.api_version)) 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) @@ -1019,7 +1067,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_request( @@ -1048,12 +1096,20 @@ def _failover_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1080,7 +1136,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", self._config.api_version)) 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) @@ -1137,7 +1193,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_failover_allow_data_loss_request( @@ -1166,12 +1222,20 @@ def _failover_allow_data_loss_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1198,7 +1262,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", "2023-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1259,7 +1323,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -1284,7 +1348,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -1307,7 +1382,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 4db32238d2ff..8c02348ec9c9 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -81,7 +82,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -151,7 +152,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -176,7 +177,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -199,7 +211,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -244,7 +260,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -269,7 +285,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorableDroppedDatabase", pipeline_response.http_response) 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 cd62590c7e27..dce86f5b5ad6 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +79,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -144,7 +145,7 @@ 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -169,7 +170,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -192,7 +204,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -226,7 +242,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) _request = build_get_request( @@ -249,7 +265,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorableDroppedManagedDatabase", pipeline_response.http_response) 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 a23e884c3fb8..d02f1fc972fd 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +81,7 @@ def build_create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -120,7 +121,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -155,9 +156,12 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -176,7 +180,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class RestorePointsOperations: @@ -218,7 +225,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -244,7 +251,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -267,7 +285,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -292,7 +314,7 @@ def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -332,12 +354,20 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -432,7 +462,7 @@ def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -507,7 +537,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) _request = build_get_request( @@ -531,7 +561,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("RestorePoint", pipeline_response.http_response) @@ -570,7 +604,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -594,7 +628,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 097d779b1047..e625d8854928 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -52,7 +53,7 @@ def build_list_current_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -90,8 +91,10 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -112,6 +115,7 @@ def build_update_request( # 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) @@ -130,7 +134,7 @@ def build_list_recommended_by_database_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -164,24 +168,27 @@ def build_list_recommended_by_database_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_enable_recommendation_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, schema_name: str, table_name: str, column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -199,10 +206,13 @@ def build_enable_recommendation_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_disable_recommendation_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -212,14 +222,18 @@ def build_disable_recommendation_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -237,24 +251,29 @@ def build_disable_recommendation_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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_get_request( +def build_delete_request( resource_group_name: str, server_name: str, database_name: str, schema_name: str, table_name: str, column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], 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", "2020-11-01-preview")) + sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -281,10 +300,10 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_disable_recommendation_request( resource_group_name: str, server_name: str, database_name: str, @@ -297,15 +316,14 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -324,14 +342,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_enable_recommendation_request( resource_group_name: str, server_name: str, database_name: str, @@ -341,14 +357,17 @@ 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 {}) - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -366,7 +385,50 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_list_by_database_request( + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels", + ) + 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"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) class SensitivityLabelsOperations: @@ -422,7 +484,7 @@ def list_current_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -451,7 +513,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -474,7 +547,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -575,7 +652,7 @@ def update( # pylint: disable=inconsistent-return-statements _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) @@ -610,7 +687,11 @@ def update( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore @@ -650,7 +731,7 @@ def list_recommended_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -679,7 +760,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -702,161 +794,16 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - @distributed_trace - def enable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def disable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - @distributed_trace def get( self, @@ -902,7 +849,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) _request = build_get_request( @@ -929,7 +876,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -1062,7 +1013,7 @@ def create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) @@ -1101,7 +1052,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SensitivityLabel", pipeline_response.http_response) @@ -1152,7 +1107,7 @@ def delete( # pylint: disable=inconsistent-return-statements _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -1179,7 +1134,267 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def disable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :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 schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_disable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + sensitivity_label_source=sensitivity_label_source, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def enable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :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 schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_enable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + sensitivity_label_source=sensitivity_label_source, + api_version=api_version, + headers=_headers, + params=_params, + ) + _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]: + 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) if cls: return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :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 filter: An OData filter expression that filters elements in the collection. Default + value is None. + :type filter: str + :return: An iterator like instance of either SensitivityLabel or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :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", self._config.api_version)) + cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) 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 1bfece501969..96c17a3a21fc 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +191,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -215,7 +216,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -238,7 +250,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -278,7 +294,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) _request = build_get_request( @@ -301,7 +317,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_response) @@ -329,7 +349,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -369,12 +389,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -475,7 +503,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 e9d064b95198..5819cc909258 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 @@ -43,7 +43,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -76,7 +76,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -108,7 +108,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -184,7 +184,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) _request = build_list_by_server_request( @@ -207,7 +207,11 @@ def list_by_server( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("[Advisor]", pipeline_response.http_response) @@ -242,7 +246,7 @@ def get(self, resource_group_name: str, server_name: str, advisor_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) _request = build_get_request( @@ -265,7 +269,11 @@ def get(self, resource_group_name: str, server_name: str, advisor_name: str, **k if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) @@ -370,7 +378,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) @@ -405,7 +413,11 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Advisor", pipeline_response.http_response) 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 a75cb75f5412..a0c62fc77dfe 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 @@ -41,7 +41,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -72,7 +72,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,7 +143,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) _request = build_get_request( @@ -165,7 +165,11 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) @@ -261,7 +265,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) @@ -295,7 +299,11 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) 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 f1b543e161fa..0da236952b6b 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - subscription_id: str, - **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +74,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, administrator_name: Union[str, _models.AdministratorName], @@ -88,8 +84,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,23 +105,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, administrator_name: Union[str, _models.AdministratorName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -144,26 +141,36 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -175,7 +182,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ServerAzureADAdministratorsOperations: @@ -197,6 +204,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerAzureADAdministrator"]: + """Gets a list of Azure Active Directory administrators in a server. + + :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 + :return: An iterator like instance of either ServerAzureADAdministrator or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :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", self._config.api_version)) + cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AdministratorListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -230,7 +325,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) _request = build_get_request( @@ -253,7 +348,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_response) @@ -281,7 +380,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -321,12 +420,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -424,7 +531,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -487,7 +594,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -515,12 +622,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -549,7 +664,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -586,76 +701,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerAzureADAdministrator"]: - """Gets a list of Azure Active Directory administrators in a server. - - :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 - :return: An iterator like instance of either ServerAzureADAdministrator or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", "2020-11-01-preview")) - cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 b9e72a7a1b00..2e5adacdce3e 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - subscription_id: str, - **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +74,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, authentication_name: Union[str, _models.AuthenticationName], @@ -88,8 +84,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,23 +105,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, authentication_name: Union[str, _models.AuthenticationName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -144,26 +141,36 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -175,7 +182,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ServerAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long @@ -197,6 +204,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :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 + :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :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", self._config.api_version)) + cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -230,7 +325,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) _request = build_get_request( @@ -253,7 +348,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_response) @@ -281,7 +380,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -321,12 +420,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -430,7 +537,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -493,7 +600,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -521,12 +628,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -555,7 +670,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -592,76 +707,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 - :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", "2020-11-01-preview")) - cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 b53d7e033f47..5d3b2db67d3f 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -78,7 +79,7 @@ def build_get_request(resource_group_name: str, server_name: str, subscription_i _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,7 +112,7 @@ def build_create_or_update_request( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -178,7 +179,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -203,7 +204,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -226,7 +238,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -257,7 +273,7 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -280,7 +296,11 @@ def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _mod if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_response) @@ -308,7 +328,7 @@ def _create_or_update_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -348,12 +368,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -440,7 +468,7 @@ def begin_create_or_update( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 3f1851940680..1237be1c1fb3 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +191,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -215,7 +216,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -238,7 +250,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -278,7 +294,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) _request = build_get_request( @@ -301,7 +317,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerConfigurationOption", pipeline_response.http_response) @@ -329,7 +349,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -369,7 +389,11 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) @@ -475,7 +499,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 7d15aeee5738..10641984b9be 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,7 +74,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, connection_policy_name: Union[str, _models.ConnectionPolicyName], @@ -88,8 +84,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", "2021-05-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,30 +105,34 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + 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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/connectionPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -143,9 +142,11 @@ def build_list_by_server_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class ServerConnectionPoliciesOperations: @@ -167,6 +168,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerConnectionPolicy"]: + """Lists connection policy. + + :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 + :return: An iterator like instance of either ServerConnectionPolicy or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -199,7 +288,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -222,7 +311,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerConnectionPolicy", pipeline_response.http_response) @@ -250,7 +343,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -290,12 +383,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -390,7 +491,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", "2021-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -434,76 +535,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ServerConnectionPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerConnectionPolicy"]: - """Lists connection policy. - - :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 - :return: An iterator like instance of either ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", "2021-05-01-preview")) - cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 69d02847ff0a..35ccc2ba94f7 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +191,7 @@ 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", self._config.api_version)) cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -215,7 +216,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -238,7 +250,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -276,7 +292,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", self._config.api_version)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) _request = build_get_request( @@ -299,7 +315,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_response) @@ -327,7 +347,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -367,12 +387,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -467,7 +495,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", "2022-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 79c6323f3b85..a7462d16e7dd 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, dns_alias_name: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,13 +74,13 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, dns_alias_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -103,15 +103,18 @@ def build_create_or_update_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, dns_alias_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -129,26 +132,30 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, server_name: str, dns_alias_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -160,7 +167,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_acquire_request( @@ -169,7 +176,7 @@ def build_acquire_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -217,6 +224,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerDnsAlias"]: + """Gets a list of server DNS aliases for a server. + + :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 that the alias is pointing to. Required. + :type server_name: str + :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] + :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", self._config.api_version)) + cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any @@ -245,7 +339,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) _request = build_get_request( @@ -268,7 +362,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_response) @@ -291,7 +389,7 @@ def _create_or_update_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_create_or_update_request( @@ -319,12 +417,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -349,7 +455,7 @@ def begin_create_or_update( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) @@ -405,7 +511,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -433,12 +539,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -462,7 +576,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -500,78 +614,6 @@ 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 - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerDnsAlias"]: - """Gets a list of server DNS aliases for a server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - def _acquire_initial( self, resource_group_name: str, @@ -591,7 +633,7 @@ def _acquire_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -631,12 +673,20 @@ def _acquire_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -730,7 +780,7 @@ def begin_acquire( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 6de718012092..1529f82558c9 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, server_name: str, key_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ServerKeysOperations: @@ -203,7 +210,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -228,7 +235,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -251,7 +269,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -283,7 +305,7 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) _request = build_get_request( @@ -306,7 +328,11 @@ def get(self, resource_group_name: str, server_name: str, key_name: str, **kwarg if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerKey", pipeline_response.http_response) @@ -334,7 +360,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -374,12 +400,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -480,7 +514,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -539,7 +573,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -567,12 +601,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -594,7 +636,7 @@ def begin_delete(self, resource_group_name: str, server_name: str, key_name: str _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 e1b8a8f5f4d7..6d75fe9e0ba9 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -105,7 +106,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -130,7 +131,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -153,7 +165,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 9b4b842579b2..687ad2c42d62 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,28 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - subscription_id: str, - **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -78,18 +74,17 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,30 +105,34 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_create_or_update_request( + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/securityAlertPolicies", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -143,9 +142,11 @@ def build_list_by_server_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) class ServerSecurityAlertPoliciesOperations: @@ -167,12 +168,100 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerSecurityAlertPolicy"]: + """Get the server's threat detection policies. + + :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 + :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], **kwargs: Any ) -> _models.ServerSecurityAlertPolicy: """Get a server's security alert policy. @@ -183,7 +272,8 @@ def get( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :return: ServerSecurityAlertPolicy or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :raises ~azure.core.exceptions.HttpResponseError: @@ -199,7 +289,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) _request = build_get_request( @@ -222,7 +312,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_response) @@ -235,7 +329,7 @@ def _create_or_update_initial( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: @@ -250,7 +344,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -290,12 +384,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -304,7 +406,7 @@ def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: _models.ServerSecurityAlertPolicy, *, content_type: str = "application/json", @@ -318,7 +420,8 @@ def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Required. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -335,7 +438,7 @@ def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: IO[bytes], *, content_type: str = "application/json", @@ -349,7 +452,8 @@ def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Required. :type parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. @@ -366,7 +470,7 @@ def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ServerSecurityAlertPolicy]: @@ -378,7 +482,8 @@ def begin_create_or_update( :param server_name: The name of the server. Required. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :type security_alert_policy_name: str or + ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type or a IO[bytes] type. Required. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or IO[bytes] @@ -390,7 +495,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -434,76 +539,3 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.ServerSecurityAlertPolicy]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerSecurityAlertPolicy"]: - """Get the server's threat detection policies. - - :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 - :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", "2020-11-01-preview")) - cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 e5ce5b9fa9a0..951728518b2a 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -111,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -143,9 +144,12 @@ def build_create_or_update_request( def build_delete_request( resource_group_name: str, managed_instance_name: str, certificate_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -163,7 +167,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ServerTrustCertificatesOperations: @@ -189,8 +196,8 @@ def __init__(self, *args, **kwargs) -> None: def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any ) -> ItemPaged["_models.ServerTrustCertificate"]: - """Gets a list of server trust certificates that were uploaded from box to the given Sql Managed - Instance. + """Gets a list of the server trust certificates used to secure communication between SQL Server + and the specified SQL Managed Instance. :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. @@ -205,7 +212,7 @@ 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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -230,7 +237,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -253,7 +271,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -263,7 +285,7 @@ def get_next(next_link=None): def get( self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> _models.ServerTrustCertificate: - """Gets a server trust certificate that was uploaded from box to Sql Managed Instance. + """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. :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. @@ -287,7 +309,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) _request = build_get_request( @@ -310,7 +332,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerTrustCertificate", pipeline_response.http_response) @@ -338,7 +364,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -378,12 +404,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -398,7 +432,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -429,7 +463,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -458,7 +492,7 @@ def begin_create_or_update( parameters: Union[_models.ServerTrustCertificate, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from box to Sql Managed Instance. + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. :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. @@ -478,7 +512,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -537,7 +571,7 @@ def _delete_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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -565,12 +599,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -578,7 +620,7 @@ def _delete_initial( def begin_delete( self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. + """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. :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. @@ -594,7 +636,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", "2021-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 4fb2beea92dc..ee2938769d5f 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, location_name: str, server_trust_group_name: str, subscription_id: str, **kwargs: Any +def build_list_by_location_request( + resource_group_name: str, location_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,14 +74,13 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, location_name: str, server_trust_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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,19 +101,21 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, location_name: str, server_trust_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -132,26 +133,32 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_location_request( - resource_group_name: str, location_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, location_name: str, server_trust_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -163,7 +170,7 @@ def build_list_by_location_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_list_by_instance_request( @@ -172,7 +179,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -216,6 +223,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerTrustGroup"]: + """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :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", self._config.api_version)) + cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any @@ -244,7 +338,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -267,7 +361,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerTrustGroup", pipeline_response.http_response) @@ -295,7 +393,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -335,12 +433,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -435,7 +541,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -494,7 +600,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -522,12 +628,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -551,7 +665,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -589,78 +703,6 @@ 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 - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerTrustGroup"]: - """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def list_by_instance( self, resource_group_name: str, managed_instance_name: str, **kwargs: Any @@ -679,7 +721,7 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -704,7 +746,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -727,7 +780,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 b71d9957fc52..0212f0715fe5 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -52,9 +53,9 @@ def build_list_by_server_request( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages", ) path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -91,7 +92,7 @@ def __init__(self, *args, **kwargs) -> None: def list_by_server( self, resource_group_name: str, server_name: str, **kwargs: Any ) -> ItemPaged["_models.ServerUsage"]: - """Returns server usages. + """Gets server usages. :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. @@ -105,7 +106,7 @@ 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", "2014-04-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -130,7 +131,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -140,7 +152,7 @@ def extract_data(pipeline_response): list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -153,7 +165,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 25c5c215d1bb..13b137ccc8f8 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -38,30 +39,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -76,7 +70,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], @@ -86,8 +80,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -110,23 +103,25 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -146,26 +141,38 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_delete_request( + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -177,7 +184,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class ServerVulnerabilityAssessmentsOperations: @@ -199,6 +206,94 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a server. + + :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 + :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] + :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", self._config.api_version)) + cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -233,7 +328,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -256,7 +351,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) @@ -373,7 +472,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -408,7 +507,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) @@ -451,7 +554,7 @@ def delete( # 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -474,80 +577,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a server. - - :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 - :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] - :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", "2020-11-01-preview")) - cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 42df44bdda70..245bb39fdb6f 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -46,7 +47,7 @@ def build_check_name_availability_request(subscription_id: str, **kwargs: Any) - _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -73,7 +74,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -101,7 +102,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -133,7 +134,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -166,7 +167,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -200,7 +201,7 @@ def build_delete_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -231,7 +232,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +266,7 @@ def build_import_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -299,7 +300,7 @@ def build_refresh_status_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -399,7 +400,7 @@ def check_name_availability( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) @@ -431,7 +432,10 @@ def check_name_availability( 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("CheckNameAvailabilityResponse", pipeline_response.http_response) @@ -454,7 +458,7 @@ def list(self, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_model _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -478,7 +482,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -501,7 +516,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -526,7 +544,7 @@ 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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -551,7 +569,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -574,7 +603,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -609,7 +641,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) _request = build_get_request( @@ -632,7 +664,10 @@ 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) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("Server", pipeline_response.http_response) @@ -656,7 +691,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -695,7 +730,10 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -784,7 +822,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -840,7 +878,7 @@ def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -867,7 +905,10 @@ def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -897,7 +938,7 @@ def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -952,7 +993,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -991,7 +1032,10 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1084,7 +1128,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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.Server] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1146,7 +1190,7 @@ def _import_database_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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1185,7 +1229,10 @@ def _import_database_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1281,7 +1328,7 @@ def begin_import_database( _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", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.ImportExportOperationResult] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -1337,7 +1384,7 @@ def _refresh_status_initial(self, resource_group_name: str, server_name: str, ** _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_status_request( @@ -1364,7 +1411,10 @@ def _refresh_status_initial(self, resource_group_name: str, server_name: str, ** except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) response_headers = {} @@ -1398,7 +1448,7 @@ def begin_refresh_status( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py index 58230c4e92bd..1f2fe85b2d65 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 @@ -43,7 +43,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -145,7 +145,7 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) _request = build_get_request( @@ -167,7 +167,11 @@ def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: An if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) @@ -262,7 +266,7 @@ def 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) @@ -296,7 +300,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) 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 56d98bf89821..e55eb4c30d19 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -50,7 +51,7 @@ def build_list_by_sql_vulnerability_assessment_request( # pylint: disable=name- system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +94,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +173,7 @@ def list_by_sql_vulnerability_assessment( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -199,7 +200,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -224,7 +236,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -269,7 +285,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) _request = build_get_request( @@ -294,7 +310,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 8bd06092c835..41461267a12f 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 @@ -51,7 +51,7 @@ def build_create_or_update_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -216,7 +216,7 @@ def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) @@ -253,7 +253,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response 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 f9058da7d3d2..681e237d2bd5 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 @@ -47,12 +47,15 @@ def build_execute_request( subscription_id: str, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -73,7 +76,10 @@ def build_execute_request( _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class SqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long @@ -116,7 +122,7 @@ def _execute_initial( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_execute_request( @@ -145,12 +151,20 @@ def _execute_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -182,7 +196,7 @@ def begin_execute( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) 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 535a7c08f040..923e5474775d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -52,7 +53,7 @@ def build_list_by_baseline_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +98,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -143,7 +144,7 @@ def build_create_or_update_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -229,7 +230,7 @@ def list_by_baseline( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -257,7 +258,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -282,7 +294,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -330,7 +346,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) _request = build_get_request( @@ -356,7 +372,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response @@ -488,7 +508,7 @@ def create_or_update( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) @@ -526,7 +546,11 @@ def create_or_update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize( "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response 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 0d4269cad3ea..54cfea41c2e3 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 @@ -45,12 +45,15 @@ 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 {}) system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -73,7 +76,10 @@ def build_delete_request( _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class SqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long @@ -137,7 +143,7 @@ def delete( # pylint: disable=inconsistent-return-statements system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -163,7 +169,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 76d0d5531bc5..24ea560da96a 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -51,7 +52,7 @@ def build_list_by_scan_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -96,7 +97,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -181,7 +182,7 @@ def list_by_scan( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -209,7 +210,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -232,7 +244,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -282,7 +298,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) _request = build_get_request( @@ -308,7 +324,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) 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 c789a9b1149d..34f8f3eb1904 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Literal, Optional, TypeVar, Union +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -50,7 +51,7 @@ def build_list_by_sql_vulnerability_assessments_request( # pylint: disable=name system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -93,7 +94,7 @@ def build_get_request( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -172,7 +173,7 @@ def list_by_sql_vulnerability_assessments( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -199,7 +200,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -222,7 +234,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -267,7 +283,7 @@ def get( system_database_name: Literal["master"] = kwargs.pop( "system_database_name", _params.pop("systemDatabaseName", "master") ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) _request = build_get_request( @@ -292,7 +308,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) 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 cfac9a835cd6..4e173fe614c5 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 @@ -43,9 +43,12 @@ 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -65,7 +68,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class SqlVulnerabilityAssessmentsOperations: @@ -120,7 +126,7 @@ def delete( # 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -143,7 +149,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 2b12a804400d..678cb10c9f99 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -117,7 +118,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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -186,7 +187,7 @@ 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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -211,7 +212,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -234,7 +246,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -274,7 +290,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-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) _request = build_get_request( @@ -297,7 +313,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) @@ -405,7 +425,7 @@ def 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", "2022-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) @@ -440,7 +460,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) 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 30af31d5364a..fdcc67f53ee2 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Optional, TypeVar, Union, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -44,7 +45,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -79,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +116,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -151,9 +152,12 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -171,7 +175,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class StartStopManagedInstanceSchedulesOperations: # pylint: disable=name-too-long @@ -212,7 +219,7 @@ 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -237,7 +244,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -260,7 +278,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -299,7 +321,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) _request = build_get_request( @@ -322,7 +344,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) @@ -430,7 +456,7 @@ def 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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) @@ -465,7 +491,11 @@ def create_or_update( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) @@ -507,7 +537,7 @@ def delete( # 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[None] = kwargs.pop("cls", None) _request = build_delete_request( @@ -530,7 +560,11 @@ def delete( # pylint: disable=inconsistent-return-statements if response.status_code not in [200, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: return cls(pipeline_response, None, {}) # type: ignore 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 35f6691501ba..afcfdc757f64 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -40,7 +41,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +68,7 @@ def build_get_request(location_name: str, usage_name: str, subscription_id: str, _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +125,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -148,7 +149,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -171,7 +183,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -200,7 +216,7 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) _request = build_get_request( @@ -222,7 +238,11 @@ def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.Sub if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SubscriptionUsage", pipeline_response.http_response) 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 d46fc66b539f..58b8fef2ffc7 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -43,7 +44,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -109,7 +110,7 @@ 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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -135,7 +136,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -158,7 +170,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 cc1a169ccf49..f82fa3ccc70d 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, sync_agent_name: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,14 +74,13 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, sync_agent_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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,19 +101,21 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, sync_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -132,26 +133,32 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, server_name: str, sync_agent_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -163,7 +170,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_generate_key_request( @@ -172,7 +179,7 @@ def build_generate_key_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -204,7 +211,7 @@ def build_list_linked_databases_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -249,6 +256,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncAgent"]: + """Lists sync agents in a server. + + :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 on which the sync agent is hosted. Required. + :type server_name: str + :return: An iterator like instance of either SyncAgent or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgent] + :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", self._config.api_version)) + cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncAgentListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any) -> _models.SyncAgent: """Gets a sync agent. @@ -275,7 +369,7 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) _request = build_get_request( @@ -298,7 +392,11 @@ def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncAgent", pipeline_response.http_response) @@ -326,7 +424,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -366,12 +464,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -463,7 +569,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -522,7 +628,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -550,12 +656,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -579,7 +693,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -617,78 +731,6 @@ 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 - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncAgent"]: - """Lists sync agents in a server. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :return: An iterator like instance of either SyncAgent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgent] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - @distributed_trace def generate_key( self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any @@ -717,7 +759,7 @@ def generate_key( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) _request = build_generate_key_request( @@ -740,7 +782,11 @@ def generate_key( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncAgentKeyProperties", pipeline_response.http_response) @@ -770,7 +816,7 @@ def list_linked_databases( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -796,7 +842,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -819,7 +876,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 097d1bdb2a97..cbe7d900f6c3 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -46,7 +47,7 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,27 +71,24 @@ def build_list_sync_database_ids_request(location_name: str, subscription_id: st return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_refresh_hub_schema_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups", ) 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -99,10 +97,13 @@ def build_refresh_hub_schema_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_hub_schemas_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -113,13 +114,13 @@ def build_list_hub_schemas_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -140,29 +141,25 @@ def build_list_hub_schemas_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_logs_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, subscription_id: str, - *, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/syncGroups/{syncGroupName}/logs", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -175,22 +172,17 @@ def build_list_logs_request( _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters - _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") - _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") - _params["type"] = _SERIALIZER.query("type", type, "str") - if continuation_token_parameter is not None: - _params["continuationToken"] = _SERIALIZER.query( - "continuation_token_parameter", continuation_token_parameter, "str" - ) _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_cancel_sync_request( +def build_delete_request( resource_group_name: str, server_name: str, database_name: str, @@ -198,13 +190,16 @@ def build_cancel_sync_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -219,10 +214,13 @@ def build_cancel_sync_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_trigger_sync_request( +def build_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -230,13 +228,17 @@ def build_trigger_sync_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/syncGroups/{syncGroupName}/triggerSync", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -251,10 +253,15 @@ def build_trigger_sync_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # 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_get_request( +def build_cancel_sync_request( resource_group_name: str, server_name: str, database_name: str, @@ -265,13 +272,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -289,10 +296,10 @@ def build_get_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_list_hub_schemas_request( resource_group_name: str, server_name: str, database_name: str, @@ -303,14 +310,13 @@ 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -326,28 +332,34 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_list_logs_request( resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, subscription_id: str, + *, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -360,12 +372,22 @@ def build_delete_request( _url: str = _url.format(**path_format_arguments) # type: ignore # Construct parameters + _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") + _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") + _params["type"] = _SERIALIZER.query("type", type, "str") + if continuation_token_parameter is not None: + _params["continuationToken"] = _SERIALIZER.query( + "continuation_token_parameter", continuation_token_parameter, "str" + ) _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_request( +def build_refresh_hub_schema_request( resource_group_name: str, server_name: str, database_name: str, @@ -376,14 +398,13 @@ 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -399,31 +420,35 @@ def build_update_request( _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) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_trigger_sync_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync", ) 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"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -435,7 +460,7 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) class SyncGroupsOperations: @@ -473,7 +498,7 @@ def list_sync_database_ids( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -497,7 +522,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -520,15 +556,125 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) - def _refresh_hub_schema_initial( + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncGroup"]: + """Lists sync groups under a hub database. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :return: An iterator like instance of either SyncGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroup] + :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", self._config.api_version)) + cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: + ) -> _models.SyncGroup: + """Gets a sync 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 server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: SyncGroup or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.SyncGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -540,10 +686,10 @@ def _refresh_hub_schema_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", "2020-11-01-preview")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - _request = build_refresh_hub_schema_request( + _request = build_get_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -555,116 +701,37 @@ def _refresh_hub_schema_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _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]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + deserialized = self._deserialize("SyncGroup", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def begin_refresh_hub_schema( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Refreshes a hub database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._refresh_hub_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_hub_schemas( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a collection of hub database schemas. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -673,65 +740,80 @@ def list_hub_schemas( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _request = build_list_hub_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "SyncGroup") - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_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.url = self._client.format_url(_request.url) - def get_next(next_link=None): - _request = prepare_request(next_link) + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - _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, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - return pipeline_response + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore - @distributed_trace - def list_logs( + return deserialized # type: ignore + + @overload + def begin_create_or_update( self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, + parameters: _models.SyncGroup, + *, + content_type: str = "application/json", **kwargs: Any - ) -> ItemPaged["_models.SyncGroupLogProperties"]: - """Gets a collection of sync group logs. + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync 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. @@ -742,89 +824,29 @@ def list_logs( :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :param start_time: Get logs generated after this time. Required. - :type start_time: str - :param end_time: Get logs generated before this time. Required. - :type end_time: str - :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and - "Success". Required. - :type type: str or ~azure.mgmt.sql.models.SyncGroupsType - :param continuation_token_parameter: The continuation token for this operation. Default value - is None. - :type continuation_token_parameter: str - :return: An iterator like instance of either SyncGroupLogProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :param parameters: The requested sync group resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup + :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 SyncGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_logs_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - type=type, - continuation_token_parameter=continuation_token_parameter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel_sync( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Cancels a sync group synchronization. + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync 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. @@ -835,55 +857,27 @@ def cancel_sync( # pylint: disable=inconsistent-return-statements :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None + :param parameters: The requested sync group resource state. 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 SyncGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] :raises ~azure.core.exceptions.HttpResponseError: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def trigger_sync( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Triggers a sync group synchronization. + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync 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. @@ -894,10 +888,65 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None + :param parameters: The requested sync group resource state. Is either a SyncGroup type or a + IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] + :return: An instance of LROPoller that returns either SyncGroup or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] :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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncGroup] = 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, + sync_group_name=sync_group_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("SyncGroup", pipeline_response.http_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.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -909,10 +958,10 @@ def trigger_sync( # 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", "2020-11-01-preview")) - cls: ClsType[None] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_trigger_sync_request( + _request = build_delete_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -924,25 +973,42 @@ def trigger_sync( # pylint: disable=inconsistent-return-statements ) _request.url = self._client.format_url(_request.url) - _stream = False + _decompress = kwargs.pop("decompress", True) + _stream = True pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore @distributed_trace - def get( + def begin_delete( self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> _models.SyncGroup: - """Gets a sync group. + ) -> LROPoller[None]: + """Deletes a sync 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. @@ -953,55 +1019,53 @@ def get( :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncGroup + :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: """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - deserialized = self._deserialize("SyncGroup", pipeline_response.http_response) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore - return deserialized # type: ignore + 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[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _create_or_update_initial( + def _update_initial( self, resource_group_name: str, server_name: str, @@ -1021,7 +1085,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -1033,7 +1097,7 @@ def _create_or_update_initial( else: _json = self._serialize.body(parameters, "SyncGroup") - _request = build_create_or_update_request( + _request = build_update_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1056,23 +1120,31 @@ def _create_or_update_initial( response = pipeline_response.http_response - if response.status_code not in [200, 201, 202]: + if response.status_code not in [200, 202]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, server_name: str, @@ -1083,7 +1155,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync group. + """Updates a sync 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. @@ -1105,7 +1177,7 @@ def begin_create_or_update( """ @overload - def begin_create_or_update( + def begin_update( self, resource_group_name: str, server_name: str, @@ -1116,7 +1188,7 @@ def begin_create_or_update( content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync group. + """Updates a sync 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. @@ -1138,7 +1210,7 @@ def begin_create_or_update( """ @distributed_trace - def begin_create_or_update( + def begin_update( self, resource_group_name: str, server_name: str, @@ -1147,7 +1219,7 @@ def begin_create_or_update( parameters: Union[_models.SyncGroup, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync group. + """Updates a sync 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. @@ -1168,14 +1240,14 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncGroup] = 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( + raw_result = self._update_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1214,9 +1286,25 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_initial( + @distributed_trace + def cancel_sync( # pylint: disable=inconsistent-return-statements self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: + ) -> None: + """Cancels a sync group synchronization. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None or the result of cls(response) + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1228,10 +1316,10 @@ def _delete_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", "2020-11-01-preview")) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) - _request = build_delete_request( + _request = build_cancel_sync_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -1243,34 +1331,29 @@ def _delete_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _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, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + return cls(pipeline_response, None, {}) # type: ignore @distributed_trace - def begin_delete( + def list_hub_schemas( self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a sync group. + ) -> ItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a collection of hub database schemas. :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. @@ -1281,60 +1364,204 @@ def begin_delete( :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] + :return: An iterator like instance of either SyncFullSchemaProperties or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] :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", "2020-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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_hub_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_logs( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SyncGroupLogProperties"]: + """Gets a collection of sync group logs. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param start_time: Get logs generated after this time. Required. + :type start_time: str + :param end_time: Get logs generated before this time. Required. + :type end_time: str + :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and + "Success". Required. + :type type: str or ~azure.mgmt.sql.models.SyncGroupsType + :param continuation_token_parameter: The continuation token for this operation. Default value + is None. + :type continuation_token_parameter: str + :return: An iterator like instance of either SyncGroupLogProperties or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :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", self._config.api_version)) + cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_logs_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + type=type, + continuation_token_parameter=continuation_token_parameter, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) + list_of_elem = deserialized.value if cls: - return cls(pipeline_response, None, {}) # type: ignore + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + response = pipeline_response.http_response - def _update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any + 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) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _refresh_hub_schema_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -1344,31 +1571,19 @@ def _update_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = 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, "SyncGroup") - - _request = build_update_request( + _request = build_refresh_hub_schema_request( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, sync_group_name=sync_group_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -1388,92 +1603,28 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: _models.SyncGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup - :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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. 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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync group. + def begin_refresh_hub_schema( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Refreshes a hub database schema. :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. @@ -1484,31 +1635,25 @@ def begin_update( :type database_name: str :param sync_group_name: The name of the sync group. Required. :type sync_group_name: str - :param parameters: The requested sync group resource state. Is either a SyncGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] - :return: An instance of LROPoller that returns either SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :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 = case_insensitive_dict(kwargs.pop("headers", {}) 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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + 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._update_initial( + raw_result = self._refresh_hub_schema_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, sync_group_name=sync_group_name, - parameters=parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -1517,11 +1662,9 @@ def begin_update( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncGroup", pipeline_response.http_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(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -1530,21 +1673,19 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.SyncGroup].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.SyncGroup]( - 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_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncGroup"]: - """Lists sync groups under a hub database. + def trigger_sync( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Triggers a sync group synchronization. :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. @@ -1553,16 +1694,12 @@ def list_by_database( :type server_name: str :param database_name: The name of the database on which the sync group is hosted. Required. :type database_name: str - :return: An iterator like instance of either SyncGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroup] + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None or the result of cls(response) + :rtype: 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", "2020-11-01-preview")) - cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) - error_map: MutableMapping = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1571,46 +1708,38 @@ def list_by_database( } error_map.update(kwargs.pop("error_map", {}) or {}) - def prepare_request(next_link=None): - if not next_link: + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[None] = kwargs.pop("cls", None) - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + _request = build_trigger_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) - def get_next(next_link=None): - _request = prepare_request(next_link) + response = pipeline_response.http_response - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + 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, ) - response = pipeline_response.http_response + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) + if cls: + return cls(pipeline_response, None, {}) # type: ignore 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 fd62a94be58d..e74d84e33084 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,32 +43,30 @@ _SERIALIZER.client_side_validation = False -def build_get_request( +def build_list_by_sync_group_request( resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, - sync_member_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers", ) 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"), "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -82,7 +81,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -94,8 +93,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,14 +116,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -134,9 +130,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -156,10 +156,15 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_update_request( + +def build_delete_request( resource_group_name: str, server_name: str, database_name: str, @@ -171,8 +176,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -195,37 +199,38 @@ def build_update_request( _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) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_by_sync_group_request( +def build_update_request( resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, + sync_member_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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}/syncGroups/{syncGroupName}/syncMembers", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", ) 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"), "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -235,12 +240,14 @@ def build_list_by_sync_group_request( _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="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_member_schemas_request( +def build_refresh_member_schema_request( resource_group_name: str, server_name: str, database_name: str, @@ -252,13 +259,13 @@ def build_list_member_schemas_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -277,10 +284,10 @@ def build_list_member_schemas_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_refresh_member_schema_request( +def build_list_member_schemas_request( resource_group_name: str, server_name: str, database_name: str, @@ -289,13 +296,16 @@ def build_refresh_member_schema_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), @@ -311,7 +321,10 @@ def build_refresh_member_schema_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) class SyncMembersOperations: @@ -333,6 +346,99 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_sync_group( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncMember"]: + """Lists sync members in the given sync 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 server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of either SyncMember or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncMember] + :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", self._config.api_version)) + cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_sync_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncMemberListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -372,7 +478,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) _request = build_get_request( @@ -397,7 +503,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("SyncMember", pipeline_response.http_response) @@ -427,7 +537,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -469,12 +579,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -587,7 +705,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -654,7 +772,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -684,12 +802,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -724,7 +850,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -785,7 +911,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -827,12 +953,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -945,7 +1079,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -992,173 +1126,6 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_by_sync_group( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncMember"]: - """Lists sync members in the given sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncMember or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncMember] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sync_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncMemberListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_member_schemas( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> ItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", "2020-11-01-preview")) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_member_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - def _refresh_member_schema_initial( self, resource_group_name: str, @@ -1179,7 +1146,7 @@ def _refresh_member_schema_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_refresh_member_schema_request( @@ -1209,12 +1176,20 @@ def _refresh_member_schema_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -1249,7 +1224,7 @@ def begin_refresh_member_schema( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -1288,3 +1263,107 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_member_schemas( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> ItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a sync member database schema. + + :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 on which the sync group is hosted. Required. + :type database_name: str + :param sync_group_name: The name of the sync group on which the sync member is hosted. + Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An iterator like instance of either SyncFullSchemaProperties or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :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", self._config.api_version)) + cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_member_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) 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 892fea524bca..6e1364e6083a 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 @@ -47,8 +47,10 @@ def build_create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) 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", @@ -68,6 +70,7 @@ def build_create_request( # 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) @@ -109,7 +112,7 @@ def _create_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -148,12 +151,20 @@ def _create_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -236,7 +247,7 @@ def begin_create( _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) 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 921d47b6c57c..6cbef11d2caf 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 @@ -7,6 +7,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -40,7 +41,7 @@ def build_list_by_location_request(location_name: str, subscription_id: str, **k _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +68,7 @@ def build_get_request(location_name: str, time_zone_id: str, subscription_id: st _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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -124,7 +125,7 @@ def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_mod _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -148,7 +149,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -171,7 +183,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -200,7 +216,7 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) _request = build_get_request( @@ -222,7 +238,11 @@ def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.T if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("TimeZone", pipeline_response.http_response) 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 31c6b1a814be..61d69c4bc7cc 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +86,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -123,7 +124,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -153,6 +154,82 @@ def build_create_or_update_request( return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) +def build_resume_request( + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/resume", + ) + 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"), + "tdeName": _SERIALIZER.url("tde_name", tde_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_suspend_request( + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = kwargs.pop( + "template_url", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/suspend", + ) + 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"), + "tdeName": _SERIALIZER.url("tde_name", tde_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) + + class TransparentDataEncryptionsOperations: """ .. warning:: @@ -195,7 +272,7 @@ 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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -221,7 +298,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -244,7 +332,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -286,7 +378,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-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) _request = build_get_request( @@ -310,7 +402,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryption", pipeline_response.http_response) @@ -339,7 +435,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -380,12 +476,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -495,7 +599,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", "2022-08-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -544,3 +648,283 @@ def get_long_running_output(pipeline_response): return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) + + def _resume_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_resume( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Resume ongoing logical database's Transparent Data Encryption scan configuration. + + :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 logical database for which the Transparent Data + Encryption is defined. Required. + :type database_name: str + :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of LROPoller that returns either LogicalDatabaseTransparentDataEncryption + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _suspend_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_suspend_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_suspend( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Suspend ongoing logical database's Transparent Data Encryption scan configuration. + + :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 logical database for which the Transparent Data + Encryption is defined. Required. + :type database_name: str + :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of LROPoller that returns either LogicalDatabaseTransparentDataEncryption + or the result of cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :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", self._config.api_version)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize( + "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) 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 021eb409e038..5a92c389aeac 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 @@ -8,6 +8,7 @@ # -------------------------------------------------------------------------- from collections.abc import MutableMapping from typing import Any, Callable, Optional, TypeVar +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -48,7 +49,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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -115,7 +116,7 @@ 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", "2021-02-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -141,7 +142,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -164,7 +176,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response 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 cfc95394305e..640490fd4370 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 @@ -1,4 +1,4 @@ -# pylint: disable=line-too-long,useless-suppression +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -46,7 +47,7 @@ def build_list_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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -70,7 +71,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -100,7 +101,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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -125,12 +126,49 @@ 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, virtual_cluster_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", "2025-01-01")) + 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/virtualClusters/{virtualClusterName}", + ) + path_format_arguments = { + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + def build_delete_request( resource_group_name: str, virtual_cluster_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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + accept = _headers.pop("Accept", "application/json") + # Construct URL _url = kwargs.pop( "template_url", @@ -147,7 +185,10 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) def build_update_request( @@ -156,7 +197,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -190,7 +231,7 @@ def build_update_dns_servers_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +286,7 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.VirtualCluster"]: _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -268,7 +309,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -291,7 +343,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -311,7 +367,7 @@ def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> Ite _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) error_map: MutableMapping = { @@ -335,7 +391,18 @@ def prepare_request(next_link=None): _request.url = self._client.format_url(_request.url) else: - _request = HttpRequest("GET", next_link) + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) _request.url = self._client.format_url(_request.url) _request.method = "GET" return _request @@ -358,7 +425,11 @@ 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) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response @@ -388,7 +459,7 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) _request = build_get_request( @@ -410,7 +481,11 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualCluster", pipeline_response.http_response) @@ -419,6 +494,206 @@ def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any return deserialized # type: ignore + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _json = None + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _json = self._serialize.body(parameters, "VirtualCluster") + + _request = build_create_or_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + content_type=content_type, + json=_json, + content=_content, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster + :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 VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is either a VirtualCluster + type or a IO[bytes] type. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster or IO[bytes] + :return: An instance of LROPoller that returns either VirtualCluster or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :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", self._config.api_version)) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + api_version=api_version, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + def _delete_initial(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -431,7 +706,7 @@ def _delete_initial(self, resource_group_name: str, virtual_cluster_name: str, * _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -458,12 +733,20 @@ def _delete_initial(self, resource_group_name: str, virtual_cluster_name: str, * except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -483,7 +766,7 @@ def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kw _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -538,7 +821,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -577,12 +860,20 @@ def _update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -668,7 +959,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", "2022-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -726,7 +1017,7 @@ def _update_dns_servers_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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_update_dns_servers_request( @@ -753,12 +1044,20 @@ def _update_dns_servers_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -783,7 +1082,7 @@ def begin_update_dns_servers( _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-05-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py index 5c4e528d4421..9f10ee7fc266 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,24 +43,23 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, server_name: str, virtual_network_rule_name: str, subscription_id: str, **kwargs: Any +def build_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -74,14 +74,13 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, virtual_network_rule_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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -102,19 +101,21 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, virtual_network_rule_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -132,26 +133,32 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +def build_delete_request( + resource_group_name: str, server_name: str, virtual_network_rule_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", ) path_format_arguments = { "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -163,7 +170,7 @@ def build_list_by_server_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class VirtualNetworkRulesOperations: @@ -185,6 +192,93 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.VirtualNetworkRule"]: + """Gets a list of virtual network rules in a server. + + :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 + :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] + :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", self._config.api_version)) + cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any @@ -213,7 +307,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) _request = build_get_request( @@ -236,7 +330,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("VirtualNetworkRule", pipeline_response.http_response) @@ -264,7 +362,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -304,12 +402,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -404,7 +510,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -463,7 +569,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -491,12 +597,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -520,7 +634,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -557,75 +671,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.VirtualNetworkRule"]: - """Gets a list of virtual network rules in a server. - - :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 - :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", "2020-11-01-preview")) - cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 fa7db3db3cc0..e9de225b9d78 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,32 +43,30 @@ _SERIALIZER.client_side_validation = False -def build_get_request( +def build_list_by_workload_group_request( resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, - workload_classifier_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers", ) 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"), "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), - "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -82,7 +81,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -94,8 +93,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -118,14 +116,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -134,9 +130,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -156,33 +156,40 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_workload_group_request( + +def build_delete_request( resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, + workload_classifier_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", ) 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"), "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -194,7 +201,7 @@ def build_list_by_workload_group_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class WorkloadClassifiersOperations: @@ -216,6 +223,100 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_workload_group( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.WorkloadClassifier"]: + """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the + classifiers from. Required. + :type workload_group_name: str + :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] + :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", self._config.api_version)) + cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_workload_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, @@ -255,7 +356,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) _request = build_get_request( @@ -280,7 +381,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadClassifier", pipeline_response.http_response) @@ -310,7 +415,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -352,12 +457,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -476,7 +589,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -543,7 +656,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -573,12 +686,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -613,7 +734,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -652,82 +773,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_workload_group( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.WorkloadClassifier"]: - """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the - classifiers from. Required. - :type workload_group_name: str - :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] - :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", "2020-11-01-preview")) - cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_workload_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 e8871be6d31f..eeda021908a0 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 @@ -9,6 +9,7 @@ from collections.abc import MutableMapping from io import IOBase from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload +import urllib.parse from azure.core import PipelineClient from azure.core.exceptions import ( @@ -42,30 +43,24 @@ _SERIALIZER.client_side_validation = False -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - subscription_id: str, - **kwargs: Any +def build_list_by_database_request( + resource_group_name: str, server_name: str, database_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups", ) 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -80,7 +75,7 @@ def build_get_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_or_update_request( +def build_get_request( resource_group_name: str, server_name: str, database_name: str, @@ -91,8 +86,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", "2020-11-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -114,14 +108,12 @@ def build_create_or_update_request( _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) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_request( +def build_create_or_update_request( resource_group_name: str, server_name: str, database_name: str, @@ -129,9 +121,13 @@ 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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + 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", @@ -150,27 +146,38 @@ def build_delete_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + # 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_list_by_database_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any + +def build_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + workload_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}", ) 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"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), } @@ -182,7 +189,7 @@ def build_list_by_database_request( # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) class WorkloadGroupsOperations: @@ -204,6 +211,96 @@ def __init__(self, *args, **kwargs) -> None: self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.WorkloadGroup"]: + """Gets the list of workload groups. + + :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 + :return: An iterator like instance of either WorkloadGroup or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadGroup] + :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", self._config.api_version)) + cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + @distributed_trace def get( self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any @@ -234,7 +331,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) _request = build_get_request( @@ -258,7 +355,11 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize("WorkloadGroup", pipeline_response.http_response) @@ -287,7 +388,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) @@ -328,12 +429,20 @@ def _create_or_update_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -437,7 +546,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) @@ -497,7 +606,7 @@ def _delete_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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) _request = build_delete_request( @@ -526,12 +635,20 @@ def _delete_initial( except (StreamConsumedError, StreamClosedError): pass map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + error = self._deserialize.failsafe_deserialize( + _models.ErrorResponse, + pipeline_response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore @@ -557,7 +674,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", "2020-11-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) 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) @@ -595,78 +712,3 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- deserialization_callback=get_long_running_output, ) return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.WorkloadGroup"]: - """Gets the list of workload groups. - - :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 - :return: An iterator like instance of either WorkloadGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadGroup] - :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", "2020-11-01-preview")) - cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - _request = HttpRequest("GET", next_link) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/sql/azure-mgmt-sql/code_report_swagger.json b/sdk/sql/azure-mgmt-sql/code_report_swagger.json new file mode 100644 index 000000000000..0acea43f60c2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/code_report_swagger.json @@ -0,0 +1,125814 @@ +{ + "azure.mgmt.sql": { + "class_nodes": { + "SqlManagementClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "backup_short_term_retention_policies": { + "attr_type": "BackupShortTermRetentionPoliciesOperations" + }, + "server_blob_auditing_policies": { + "attr_type": "ServerBlobAuditingPoliciesOperations" + }, + "database_blob_auditing_policies": { + "attr_type": "DatabaseBlobAuditingPoliciesOperations" + }, + "extended_database_blob_auditing_policies": { + "attr_type": "ExtendedDatabaseBlobAuditingPoliciesOperations" + }, + "extended_server_blob_auditing_policies": { + "attr_type": "ExtendedServerBlobAuditingPoliciesOperations" + }, + "database_advanced_threat_protection_settings": { + "attr_type": "DatabaseAdvancedThreatProtectionSettingsOperations" + }, + "database_advisors": { + "attr_type": "DatabaseAdvisorsOperations" + }, + "database_automatic_tuning": { + "attr_type": "DatabaseAutomaticTuningOperations" + }, + "database_columns": { + "attr_type": "DatabaseColumnsOperations" + }, + "database_encryption_protectors": { + "attr_type": "DatabaseEncryptionProtectorsOperations" + }, + "database_extensions": { + "attr_type": "DatabaseExtensionsOperations" + }, + "database_operations": { + "attr_type": "DatabaseOperationsOperations" + }, + "database_recommended_actions": { + "attr_type": "DatabaseRecommendedActionsOperations" + }, + "databases": { + "attr_type": "DatabasesOperations" + }, + "database_schemas": { + "attr_type": "DatabaseSchemasOperations" + }, + "database_security_alert_policies": { + "attr_type": "DatabaseSecurityAlertPoliciesOperations" + }, + "database_sql_vulnerability_assessment_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentBaselinesOperations" + }, + "database_sql_vulnerability_assessment_execute_scan": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations" + }, + "database_sql_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_sql_vulnerability_assessment_scan_result": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScanResultOperations" + }, + "database_sql_vulnerability_assessment_scans": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScansOperations" + }, + "database_sql_vulnerability_assessments_settings": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentsSettingsOperations" + }, + "database_tables": { + "attr_type": "DatabaseTablesOperations" + }, + "database_usages": { + "attr_type": "DatabaseUsagesOperations" + }, + "database_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_vulnerability_assessments": { + "attr_type": "DatabaseVulnerabilityAssessmentsOperations" + }, + "database_vulnerability_assessment_scans": { + "attr_type": "DatabaseVulnerabilityAssessmentScansOperations" + }, + "data_masking_policies": { + "attr_type": "DataMaskingPoliciesOperations" + }, + "data_masking_rules": { + "attr_type": "DataMaskingRulesOperations" + }, + "data_warehouse_user_activities": { + "attr_type": "DataWarehouseUserActivitiesOperations" + }, + "deleted_servers": { + "attr_type": "DeletedServersOperations" + }, + "distributed_availability_groups": { + "attr_type": "DistributedAvailabilityGroupsOperations" + }, + "elastic_pool_operations": { + "attr_type": "ElasticPoolOperationsOperations" + }, + "elastic_pools": { + "attr_type": "ElasticPoolsOperations" + }, + "encryption_protectors": { + "attr_type": "EncryptionProtectorsOperations" + }, + "endpoint_certificates": { + "attr_type": "EndpointCertificatesOperations" + }, + "failover_groups": { + "attr_type": "FailoverGroupsOperations" + }, + "firewall_rules": { + "attr_type": "FirewallRulesOperations" + }, + "geo_backup_policies": { + "attr_type": "GeoBackupPoliciesOperations" + }, + "instance_failover_groups": { + "attr_type": "InstanceFailoverGroupsOperations" + }, + "instance_pool_operations": { + "attr_type": "InstancePoolOperationsOperations" + }, + "instance_pools": { + "attr_type": "InstancePoolsOperations" + }, + "ipv6_firewall_rules": { + "attr_type": "IPv6FirewallRulesOperations" + }, + "job_agents": { + "attr_type": "JobAgentsOperations" + }, + "job_credentials": { + "attr_type": "JobCredentialsOperations" + }, + "job_executions": { + "attr_type": "JobExecutionsOperations" + }, + "job_private_endpoints": { + "attr_type": "JobPrivateEndpointsOperations" + }, + "jobs": { + "attr_type": "JobsOperations" + }, + "job_step_executions": { + "attr_type": "JobStepExecutionsOperations" + }, + "job_steps": { + "attr_type": "JobStepsOperations" + }, + "job_target_executions": { + "attr_type": "JobTargetExecutionsOperations" + }, + "job_target_groups": { + "attr_type": "JobTargetGroupsOperations" + }, + "job_versions": { + "attr_type": "JobVersionsOperations" + }, + "ledger_digest_uploads": { + "attr_type": "LedgerDigestUploadsOperations" + }, + "capabilities": { + "attr_type": "CapabilitiesOperations" + }, + "long_term_retention_backups": { + "attr_type": "LongTermRetentionBackupsOperations" + }, + "long_term_retention_managed_instance_backups": { + "attr_type": "LongTermRetentionManagedInstanceBackupsOperations" + }, + "long_term_retention_policies": { + "attr_type": "LongTermRetentionPoliciesOperations" + }, + "maintenance_window_options": { + "attr_type": "MaintenanceWindowOptionsOperations" + }, + "maintenance_windows": { + "attr_type": "MaintenanceWindowsOperations" + }, + "managed_backup_short_term_retention_policies": { + "attr_type": "ManagedBackupShortTermRetentionPoliciesOperations" + }, + "managed_database_advanced_threat_protection_settings": { + "attr_type": "ManagedDatabaseAdvancedThreatProtectionSettingsOperations" + }, + "managed_database_columns": { + "attr_type": "ManagedDatabaseColumnsOperations" + }, + "managed_database_move_operations": { + "attr_type": "ManagedDatabaseMoveOperationsOperations" + }, + "managed_database_queries": { + "attr_type": "ManagedDatabaseQueriesOperations" + }, + "managed_database_restore_details": { + "attr_type": "ManagedDatabaseRestoreDetailsOperations" + }, + "managed_databases": { + "attr_type": "ManagedDatabasesOperations" + }, + "managed_database_schemas": { + "attr_type": "ManagedDatabaseSchemasOperations" + }, + "managed_database_security_alert_policies": { + "attr_type": "ManagedDatabaseSecurityAlertPoliciesOperations" + }, + "managed_database_security_events": { + "attr_type": "ManagedDatabaseSecurityEventsOperations" + }, + "managed_database_sensitivity_labels": { + "attr_type": "ManagedDatabaseSensitivityLabelsOperations" + }, + "managed_database_recommended_sensitivity_labels": { + "attr_type": "ManagedDatabaseRecommendedSensitivityLabelsOperations" + }, + "managed_database_tables": { + "attr_type": "ManagedDatabaseTablesOperations" + }, + "managed_database_transparent_data_encryption": { + "attr_type": "ManagedDatabaseTransparentDataEncryptionOperations" + }, + "managed_database_vulnerability_assessment_rule_baselines": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "managed_database_vulnerability_assessments": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentsOperations" + }, + "managed_database_vulnerability_assessment_scans": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentScansOperations" + }, + "managed_instance_administrators": { + "attr_type": "ManagedInstanceAdministratorsOperations" + }, + "managed_instance_advanced_threat_protection_settings": { + "attr_type": "ManagedInstanceAdvancedThreatProtectionSettingsOperations" + }, + "managed_instance_azure_ad_only_authentications": { + "attr_type": "ManagedInstanceAzureADOnlyAuthenticationsOperations" + }, + "managed_instance_dtcs": { + "attr_type": "ManagedInstanceDtcsOperations" + }, + "managed_instance_encryption_protectors": { + "attr_type": "ManagedInstanceEncryptionProtectorsOperations" + }, + "managed_instance_keys": { + "attr_type": "ManagedInstanceKeysOperations" + }, + "managed_instance_long_term_retention_policies": { + "attr_type": "ManagedInstanceLongTermRetentionPoliciesOperations" + }, + "managed_instance_operations": { + "attr_type": "ManagedInstanceOperationsOperations" + }, + "managed_instance_private_endpoint_connections": { + "attr_type": "ManagedInstancePrivateEndpointConnectionsOperations" + }, + "managed_instance_private_link_resources": { + "attr_type": "ManagedInstancePrivateLinkResourcesOperations" + }, + "managed_instances": { + "attr_type": "ManagedInstancesOperations" + }, + "managed_instance_tde_certificates": { + "attr_type": "ManagedInstanceTdeCertificatesOperations" + }, + "managed_instance_vulnerability_assessments": { + "attr_type": "ManagedInstanceVulnerabilityAssessmentsOperations" + }, + "managed_ledger_digest_uploads": { + "attr_type": "ManagedLedgerDigestUploadsOperations" + }, + "managed_restorable_dropped_database_backup_short_term_retention_policies": { + "attr_type": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations" + }, + "managed_server_dns_aliases": { + "attr_type": "ManagedServerDnsAliasesOperations" + }, + "managed_server_security_alert_policies": { + "attr_type": "ManagedServerSecurityAlertPoliciesOperations" + }, + "network_security_perimeter_configurations": { + "attr_type": "NetworkSecurityPerimeterConfigurationsOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "outbound_firewall_rules": { + "attr_type": "OutboundFirewallRulesOperations" + }, + "private_endpoint_connections": { + "attr_type": "PrivateEndpointConnectionsOperations" + }, + "private_link_resources": { + "attr_type": "PrivateLinkResourcesOperations" + }, + "recoverable_databases": { + "attr_type": "RecoverableDatabasesOperations" + }, + "recoverable_managed_databases": { + "attr_type": "RecoverableManagedDatabasesOperations" + }, + "replication_links": { + "attr_type": "ReplicationLinksOperations" + }, + "restorable_dropped_databases": { + "attr_type": "RestorableDroppedDatabasesOperations" + }, + "restorable_dropped_managed_databases": { + "attr_type": "RestorableDroppedManagedDatabasesOperations" + }, + "restore_points": { + "attr_type": "RestorePointsOperations" + }, + "sensitivity_labels": { + "attr_type": "SensitivityLabelsOperations" + }, + "recommended_sensitivity_labels": { + "attr_type": "RecommendedSensitivityLabelsOperations" + }, + "server_advanced_threat_protection_settings": { + "attr_type": "ServerAdvancedThreatProtectionSettingsOperations" + }, + "server_advisors": { + "attr_type": "ServerAdvisorsOperations" + }, + "server_automatic_tuning": { + "attr_type": "ServerAutomaticTuningOperations" + }, + "server_azure_ad_administrators": { + "attr_type": "ServerAzureADAdministratorsOperations" + }, + "server_azure_ad_only_authentications": { + "attr_type": "ServerAzureADOnlyAuthenticationsOperations" + }, + "server_configuration_options": { + "attr_type": "ServerConfigurationOptionsOperations" + }, + "server_connection_policies": { + "attr_type": "ServerConnectionPoliciesOperations" + }, + "server_dev_ops_audit_settings": { + "attr_type": "ServerDevOpsAuditSettingsOperations" + }, + "server_dns_aliases": { + "attr_type": "ServerDnsAliasesOperations" + }, + "server_keys": { + "attr_type": "ServerKeysOperations" + }, + "server_operations": { + "attr_type": "ServerOperationsOperations" + }, + "servers": { + "attr_type": "ServersOperations" + }, + "server_security_alert_policies": { + "attr_type": "ServerSecurityAlertPoliciesOperations" + }, + "server_trust_certificates": { + "attr_type": "ServerTrustCertificatesOperations" + }, + "server_trust_groups": { + "attr_type": "ServerTrustGroupsOperations" + }, + "server_usages": { + "attr_type": "ServerUsagesOperations" + }, + "server_vulnerability_assessments": { + "attr_type": "ServerVulnerabilityAssessmentsOperations" + }, + "sql_agent": { + "attr_type": "SqlAgentOperations" + }, + "sql_vulnerability_assessment_baseline": { + "attr_type": "SqlVulnerabilityAssessmentBaselineOperations" + }, + "sql_vulnerability_assessment_baselines": { + "attr_type": "SqlVulnerabilityAssessmentBaselinesOperations" + }, + "sql_vulnerability_assessment_execute_scan": { + "attr_type": "SqlVulnerabilityAssessmentExecuteScanOperations" + }, + "sql_vulnerability_assessment_rule_baseline": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselineOperations" + }, + "sql_vulnerability_assessment_rule_baselines": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "sql_vulnerability_assessment_scan_result": { + "attr_type": "SqlVulnerabilityAssessmentScanResultOperations" + }, + "sql_vulnerability_assessment_scans": { + "attr_type": "SqlVulnerabilityAssessmentScansOperations" + }, + "sql_vulnerability_assessments_settings": { + "attr_type": "SqlVulnerabilityAssessmentsSettingsOperations" + }, + "sql_vulnerability_assessments": { + "attr_type": "SqlVulnerabilityAssessmentsOperations" + }, + "start_stop_managed_instance_schedules": { + "attr_type": "StartStopManagedInstanceSchedulesOperations" + }, + "subscription_usages": { + "attr_type": "SubscriptionUsagesOperations" + }, + "synapse_link_workspaces": { + "attr_type": "SynapseLinkWorkspacesOperations" + }, + "sync_agents": { + "attr_type": "SyncAgentsOperations" + }, + "sync_groups": { + "attr_type": "SyncGroupsOperations" + }, + "sync_members": { + "attr_type": "SyncMembersOperations" + }, + "tde_certificates": { + "attr_type": "TdeCertificatesOperations" + }, + "time_zones": { + "attr_type": "TimeZonesOperations" + }, + "transparent_data_encryptions": { + "attr_type": "TransparentDataEncryptionsOperations" + }, + "usages": { + "attr_type": "UsagesOperations" + }, + "virtual_clusters": { + "attr_type": "VirtualClustersOperations" + }, + "virtual_network_rules": { + "attr_type": "VirtualNetworkRulesOperations" + }, + "workload_classifiers": { + "attr_type": "WorkloadClassifiersOperations" + }, + "workload_groups": { + "attr_type": "WorkloadGroupsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.operations": { + "class_nodes": { + "BackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "CapabilitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "include": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataWarehouseUserActivitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_warehouse_user_activity_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revert": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseExtensionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseExtensions", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseRecommendedActionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database_advisor": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedActionAutoGenerated", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Database", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExportDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_import_method": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportExistingDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_pause": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_upgrade_data_warehouse": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "rename": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ResourceMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DeletedServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_recover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DistributedAvailabilityGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupsFailoverRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_set_role": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupSetRole", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "EncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EndpointCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "endpoint_type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedDatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedDatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_try_planned_before_forced_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroupUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "replace": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRuleList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "GeoBackupPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "GeoBackupPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "IPv6FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IPv6FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstanceFailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstanceFailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgentUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobCredentialsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobCredential", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobPrivateEndpointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobPrivateEndpoint", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobStep", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_step": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobTargetGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobVersionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Job", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_change_access_tier": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_change_access_tier_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_copy_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_lock_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_lock_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_set_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_set_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionManagedInstanceBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_options_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "MaintenanceWindows", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseMoveOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseQueriesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_query": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseRecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseRestoreDetailsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_details_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseTransparentDataEncryptionOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_cancel_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_complete_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_complete_restore": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CompleteDatabaseRestoreDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabase", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_start_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseStartMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceDtcsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceDtc", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceEncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceLongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceLongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstancePrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceTdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedInstanceVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstance", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_start": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_stop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_validate_azure_key_vault_encryption_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "number_of_queries": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "databases": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "aggregation_function": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "observation_metric": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_outbound_network_dependencies_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedLedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedLedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_restorable_dropped_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasCreation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "NetworkSecurityPerimeterConfigurationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reconcile": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "OutboundFirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "PrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "RecoverableDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecoverableManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recoverable_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ReplicationLinksOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLink", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLinkUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorePointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CreateDatabaseRestorePointDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAzureADAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConfigurationOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConfigurationOption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConnectionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConnectionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDevOpsAuditSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDevOpsAuditingSettings", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Server", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_import_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportNewDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_name_availability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckNameAvailabilityRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlAgentOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlAgentConfiguration", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "StartStopManagedInstanceSchedulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "StartStopManagedInstanceSchedule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SubscriptionUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "usage_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SynapseLinkWorkspacesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "generate_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_linked_databases": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_hub_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "cancel_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_hub_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_logs": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "continuation_token_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_sync_database_ids": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "trigger_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncMembersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_member_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sync_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_member_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "TimeZonesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_zone_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TransparentDataEncryptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LogicalDatabaseTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_suspend": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "UsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand_children": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualClustersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualCluster", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualClusterUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update_dns_servers": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualNetworkRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualNetworkRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadClassifiersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadClassifier", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_workload_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.models": { + "class_nodes": { + "AdministratorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AdministratorName": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdministratorType": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdvancedThreatProtectionName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdvancedThreatProtectionState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "NEW": "NEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Advisor": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "auto_execute_status": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "advisor_status": { + "attr_type": null + }, + "auto_execute_status": { + "attr_type": "auto_execute_status" + }, + "auto_execute_status_inherited_from": { + "attr_type": null + }, + "recommendations_status": { + "attr_type": null + }, + "last_checked": { + "attr_type": null + }, + "recommended_actions": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AdvisorStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "GA": "GA", + "LIMITED_PUBLIC_PREVIEW": "LIMITED_PUBLIC_PREVIEW", + "PRIVATE_PREVIEW": "PRIVATE_PREVIEW", + "PUBLIC_PREVIEW": "PUBLIC_PREVIEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AggregationFunctionType": { + "type": "Enum", + "methods": {}, + "properties": { + "AVG": "AVG", + "MAX": "MAX", + "MIN": "MIN", + "STDEV": "STDEV", + "SUM": "SUM", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AlwaysEncryptedEnclaveType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "VBS": "VBS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AuthMetadataLookupModes": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_AD": "AZURE_AD", + "PAIRED": "PAIRED", + "WINDOWS": "WINDOWS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AuthenticationName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoExecuteStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoExecuteStatusInheritedFrom": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE": "DATABASE", + "DEFAULT": "DEFAULT", + "ELASTIC_POOL": "ELASTIC_POOL", + "SERVER": "SERVER", + "SUBSCRIPTION": "SUBSCRIPTION", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoPauseDelayTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "step_size": { + "attr_type": null + }, + "default": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "do_not_pause_value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningDisabledReason": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CONFIGURED": "AUTO_CONFIGURED", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "INHERITED_FROM_SERVER": "INHERITED_FROM_SERVER", + "NOT_SUPPORTED": "NOT_SUPPORTED", + "QUERY_STORE_OFF": "QUERY_STORE_OFF", + "QUERY_STORE_READ_ONLY": "QUERY_STORE_READ_ONLY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningMode": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO": "AUTO", + "CUSTOM": "CUSTOM", + "INHERIT": "INHERIT", + "UNSPECIFIED": "UNSPECIFIED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptionModeActual": { + "type": "Enum", + "methods": {}, + "properties": { + "OFF": "OFF", + "ON": "ON", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptionModeDesired": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "OFF": "OFF", + "ON": "ON", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "reason_code": { + "attr_type": null + }, + "reason_desc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningServerMode": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO": "AUTO", + "CUSTOM": "CUSTOM", + "UNSPECIFIED": "UNSPECIFIED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningServerOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "reason_code": { + "attr_type": null + }, + "reason_desc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningServerReason": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CONFIGURED": "AUTO_CONFIGURED", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AvailabilityZoneType": { + "type": "Enum", + "methods": {}, + "properties": { + "NO_PREFERENCE": "NO_PREFERENCE", + "ONE": "ONE", + "THREE": "THREE", + "TWO": "TWO", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AzureADOnlyAuthListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupShortTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "diff_backup_interval_in_hours": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "retention_days": { + "attr_type": "retention_days" + }, + "diff_backup_interval_in_hours": { + "attr_type": "diff_backup_interval_in_hours" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupShortTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupStorageAccessTier": { + "type": "Enum", + "methods": {}, + "properties": { + "ARCHIVE": "ARCHIVE", + "HOT": "HOT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "BackupStorageRedundancy": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "GEO_ZONE": "GEO_ZONE", + "LOCAL": "LOCAL", + "ZONE": "ZONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Baseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "expected_results": { + "attr_type": null + }, + "updated_time": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BaselineAdjustedResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "baseline": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "results_not_in_baseline": { + "attr_type": null + }, + "results_only_in_baseline": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BaselineName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "BenchmarkReference": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "benchmark": { + "attr_type": null + }, + "reference": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BlobAuditingPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CapabilityGroup": { + "type": "Enum", + "methods": {}, + "properties": { + "SUPPORTED_EDITIONS": "SUPPORTED_EDITIONS", + "SUPPORTED_ELASTIC_POOL_EDITIONS": "SUPPORTED_ELASTIC_POOL_EDITIONS", + "SUPPORTED_INSTANCE_POOL_EDITIONS": "SUPPORTED_INSTANCE_POOL_EDITIONS", + "SUPPORTED_JOB_AGENT_VERSIONS": "SUPPORTED_JOB_AGENT_VERSIONS", + "SUPPORTED_MANAGED_INSTANCE_EDITIONS": "SUPPORTED_MANAGED_INSTANCE_EDITIONS", + "SUPPORTED_MANAGED_INSTANCE_VERSIONS": "SUPPORTED_MANAGED_INSTANCE_VERSIONS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CapabilityStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "AVAILABLE": "AVAILABLE", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "VISIBLE": "VISIBLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CatalogCollationType": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE_DEFAULT": "DATABASE_DEFAULT", + "SQL_LATIN1_GENERAL_CP1_CI_AS": "SQL_LATIN1_GENERAL_CP1_CI_AS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CertificateInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "certificate_name": { + "attr_type": null + }, + "expiry_date": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ChangeLongTermRetentionBackupAccessTierParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_storage_access_tier": { + "default": null, + "param_type": "keyword_only" + }, + "operation_mode": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "backup_storage_access_tier": { + "attr_type": "backup_storage_access_tier" + }, + "operation_mode": { + "attr_type": "operation_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckNameAvailabilityReason": { + "type": "Enum", + "methods": {}, + "properties": { + "ALREADY_EXISTS": "ALREADY_EXISTS", + "INVALID": "INVALID", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CheckNameAvailabilityRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckNameAvailabilityResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "available": { + "attr_type": null + }, + "reason": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ClientClassificationSource": { + "type": "Enum", + "methods": {}, + "properties": { + "MIP": "MIP", + "NATIVE": "NATIVE", + "NONE": "NONE", + "RECOMMENDED": "RECOMMENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ColumnDataType": { + "type": "Enum", + "methods": {}, + "properties": { + "BIGINT": "BIGINT", + "BINARY": "BINARY", + "BIT": "BIT", + "CHAR": "CHAR", + "DATE": "DATE", + "DATETIME": "DATETIME", + "DATETIME2": "DATETIME2", + "DATETIMEOFFSET": "DATETIMEOFFSET", + "DECIMAL": "DECIMAL", + "FLOAT": "FLOAT", + "GEOGRAPHY": "GEOGRAPHY", + "GEOMETRY": "GEOMETRY", + "HIERARCHYID": "HIERARCHYID", + "IMAGE": "IMAGE", + "INT": "INT", + "MONEY": "MONEY", + "NCHAR": "NCHAR", + "NTEXT": "NTEXT", + "NUMERIC": "NUMERIC", + "NVARCHAR": "NVARCHAR", + "REAL": "REAL", + "SMALLDATETIME": "SMALLDATETIME", + "SMALLINT": "SMALLINT", + "SMALLMONEY": "SMALLMONEY", + "SQL_VARIANT": "SQL_VARIANT", + "SYSNAME": "SYSNAME", + "TEXT": "TEXT", + "TIME": "TIME", + "TIMESTAMP": "TIMESTAMP", + "TINYINT": "TINYINT", + "UNIQUEIDENTIFIER": "UNIQUEIDENTIFIER", + "VARBINARY": "VARBINARY", + "VARCHAR": "VARCHAR", + "XML": "XML", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CompleteDatabaseRestoreDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "last_backup_name": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ConnectionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CopyLongTermRetentionBackupParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_resource_group": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server_fully_qualified_domain_name": { + "default": "none", + "param_type": "keyword_only" + }, + "target_database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "target_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "target_subscription_id": { + "attr_type": "target_subscription_id" + }, + "target_resource_group": { + "attr_type": "target_resource_group" + }, + "target_server_resource_id": { + "attr_type": "target_server_resource_id" + }, + "target_server_fully_qualified_domain_name": { + "attr_type": "target_server_fully_qualified_domain_name" + }, + "target_database_name": { + "attr_type": "target_database_name" + }, + "target_backup_storage_redundancy": { + "attr_type": "target_backup_storage_redundancy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CreateDatabaseRestorePointDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_label": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "restore_point_label": { + "attr_type": "restore_point_label" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "DEFAULT": "DEFAULT", + "ONLINE_SECONDARY": "ONLINE_SECONDARY", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "RECOVERY": "RECOVERY", + "RESTORE": "RESTORE", + "RESTORE_EXTERNAL_BACKUP": "RESTORE_EXTERNAL_BACKUP", + "RESTORE_EXTERNAL_BACKUP_SECONDARY": "RESTORE_EXTERNAL_BACKUP_SECONDARY", + "RESTORE_LONG_TERM_RETENTION_BACKUP": "RESTORE_LONG_TERM_RETENTION_BACKUP", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CreatedByType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "KEY": "KEY", + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DNSRefreshOperationStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingFunction": { + "type": "Enum", + "methods": {}, + "properties": { + "CCN": "CCN", + "DEFAULT": "DEFAULT", + "EMAIL": "EMAIL", + "NUMBER": "NUMBER", + "SSN": "SSN", + "TEXT": "TEXT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_state": { + "default": "none", + "param_type": "keyword_only" + }, + "exempt_principals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "data_masking_state": { + "attr_type": "data_masking_state" + }, + "exempt_principals": { + "attr_type": "exempt_principals" + }, + "application_principals": { + "attr_type": null + }, + "masking_level": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_state": { + "default": "none", + "param_type": "keyword_only" + }, + "schema_name": { + "default": "none", + "param_type": "keyword_only" + }, + "table_name": { + "default": "none", + "param_type": "keyword_only" + }, + "column_name": { + "default": "none", + "param_type": "keyword_only" + }, + "alias_name": { + "default": "none", + "param_type": "keyword_only" + }, + "masking_function": { + "default": "none", + "param_type": "keyword_only" + }, + "number_from": { + "default": "none", + "param_type": "keyword_only" + }, + "number_to": { + "default": "none", + "param_type": "keyword_only" + }, + "prefix_size": { + "default": "none", + "param_type": "keyword_only" + }, + "suffix_size": { + "default": "none", + "param_type": "keyword_only" + }, + "replacement_string": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "id_properties_id": { + "attr_type": null + }, + "rule_state": { + "attr_type": "rule_state" + }, + "schema_name": { + "attr_type": "schema_name" + }, + "table_name": { + "attr_type": "table_name" + }, + "column_name": { + "attr_type": "column_name" + }, + "alias_name": { + "attr_type": "alias_name" + }, + "masking_function": { + "attr_type": "masking_function" + }, + "number_from": { + "attr_type": "number_from" + }, + "number_to": { + "attr_type": "number_to" + }, + "prefix_size": { + "attr_type": "prefix_size" + }, + "suffix_size": { + "attr_type": "suffix_size" + }, + "replacement_string": { + "attr_type": "replacement_string" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingRuleState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataWarehouseUserActivities": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "active_queries_count": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataWarehouseUserActivitiesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataWarehouseUserActivityName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Database": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "sample_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_deletion_date": { + "default": "none", + "param_type": "keyword_only" + }, + "recovery_services_recovery_point_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_scale": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "use_free_limit": { + "default": "none", + "param_type": "keyword_only" + }, + "free_limit_exhaustion_behavior": { + "default": "none", + "param_type": "keyword_only" + }, + "source_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "manual_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "perform_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector_auto_rotation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "kind": { + "attr_type": null + }, + "managed_by": { + "attr_type": null + }, + "identity": { + "attr_type": "identity" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "collation": { + "attr_type": "collation" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "sample_name": { + "attr_type": "sample_name" + }, + "elastic_pool_id": { + "attr_type": "elastic_pool_id" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "status": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "current_service_objective_name": { + "attr_type": null + }, + "requested_service_objective_name": { + "attr_type": null + }, + "default_secondary_location": { + "attr_type": null + }, + "failover_group_id": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "source_database_deletion_date": { + "attr_type": "source_database_deletion_date" + }, + "recovery_services_recovery_point_id": { + "attr_type": "recovery_services_recovery_point_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "max_log_size_bytes": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "read_scale": { + "attr_type": "read_scale" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "current_sku": { + "attr_type": null + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "paused_date": { + "attr_type": null + }, + "resumed_date": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "is_infra_encryption_enabled": { + "attr_type": null + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "keys": { + "attr_type": "keys" + }, + "encryption_protector": { + "attr_type": "encryption_protector" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "use_free_limit": { + "attr_type": "use_free_limit" + }, + "free_limit_exhaustion_behavior": { + "attr_type": "free_limit_exhaustion_behavior" + }, + "source_resource_id": { + "attr_type": "source_resource_id" + }, + "manual_cutover": { + "attr_type": "manual_cutover" + }, + "perform_cutover": { + "attr_type": "perform_cutover" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "encryption_protector_auto_rotation": { + "attr_type": "encryption_protector_auto_rotation" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAutomaticTuning": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "options": { + "attr_type": "options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_type": { + "default": "none", + "param_type": "keyword_only" + }, + "temporal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_optimized": { + "default": "none", + "param_type": "keyword_only" + }, + "is_computed": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "column_type": { + "attr_type": "column_type" + }, + "temporal_type": { + "attr_type": "temporal_type" + }, + "memory_optimized": { + "attr_type": "memory_optimized" + }, + "is_computed": { + "attr_type": "is_computed" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseColumnListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseExtensions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "database_edition": { + "default": "none", + "param_type": "keyword_only" + }, + "service_objective_name": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation_mode": { + "attr_type": "operation_mode" + }, + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "database_edition": { + "attr_type": "database_edition" + }, + "service_objective_name": { + "attr_type": "service_objective_name" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "tenant_id": { + "attr_type": null + }, + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseIdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "key_version": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_KEY_VAULT": "AZURE_KEY_VAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "operation_phase_details": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseReadScale": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseSchema": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSchemaListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSecurityAlertListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentBaselineSet": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "latest_scan": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "latest_scan": { + "attr_type": "latest_scan" + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "latest_scan": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "latest_scan": { + "attr_type": "latest_scan" + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseState": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "DELETED": "DELETED", + "LIVE": "LIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CLOSED": "AUTO_CLOSED", + "COPYING": "COPYING", + "CREATING": "CREATING", + "DISABLED": "DISABLED", + "EMERGENCY_MODE": "EMERGENCY_MODE", + "INACCESSIBLE": "INACCESSIBLE", + "OFFLINE": "OFFLINE", + "OFFLINE_CHANGING_DW_PERFORMANCE_TIERS": "OFFLINE_CHANGING_DW_PERFORMANCE_TIERS", + "OFFLINE_SECONDARY": "OFFLINE_SECONDARY", + "ONLINE": "ONLINE", + "ONLINE_CHANGING_DW_PERFORMANCE_TIERS": "ONLINE_CHANGING_DW_PERFORMANCE_TIERS", + "PAUSED": "PAUSED", + "PAUSING": "PAUSING", + "RECOVERING": "RECOVERING", + "RECOVERY_PENDING": "RECOVERY_PENDING", + "RESTORING": "RESTORING", + "RESUMING": "RESUMING", + "SCALING": "SCALING", + "SHUTDOWN": "SHUTDOWN", + "STANDBY": "STANDBY", + "STARTING": "STARTING", + "STOPPED": "STOPPED", + "STOPPING": "STOPPING", + "SUSPECT": "SUSPECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "temporal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_optimized": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "temporal_type": { + "attr_type": "temporal_type" + }, + "memory_optimized": { + "attr_type": "memory_optimized" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseTableListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "sample_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_deletion_date": { + "default": "none", + "param_type": "keyword_only" + }, + "recovery_services_recovery_point_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_scale": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "use_free_limit": { + "default": "none", + "param_type": "keyword_only" + }, + "free_limit_exhaustion_behavior": { + "default": "none", + "param_type": "keyword_only" + }, + "manual_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "perform_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector_auto_rotation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "collation": { + "attr_type": "collation" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "sample_name": { + "attr_type": "sample_name" + }, + "elastic_pool_id": { + "attr_type": "elastic_pool_id" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "status": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "current_service_objective_name": { + "attr_type": null + }, + "requested_service_objective_name": { + "attr_type": null + }, + "default_secondary_location": { + "attr_type": null + }, + "failover_group_id": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "source_database_deletion_date": { + "attr_type": "source_database_deletion_date" + }, + "recovery_services_recovery_point_id": { + "attr_type": "recovery_services_recovery_point_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "max_log_size_bytes": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "read_scale": { + "attr_type": "read_scale" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "current_sku": { + "attr_type": null + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "paused_date": { + "attr_type": null + }, + "resumed_date": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "is_infra_encryption_enabled": { + "attr_type": null + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "keys": { + "attr_type": "keys" + }, + "encryption_protector": { + "attr_type": "encryption_protector" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "use_free_limit": { + "attr_type": "use_free_limit" + }, + "free_limit_exhaustion_behavior": { + "attr_type": "free_limit_exhaustion_behavior" + }, + "manual_cutover": { + "attr_type": "manual_cutover" + }, + "perform_cutover": { + "attr_type": "perform_cutover" + }, + "encryption_protector_auto_rotation": { + "attr_type": "encryption_protector_auto_rotation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUserIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentRuleBaseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "baseline_results": { + "attr_type": "baseline_results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentRuleBaselineItem": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": { + "attr_type": "result" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentScansExport": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "exported_report_location": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DayOfWeek": { + "type": "Enum", + "methods": {}, + "properties": { + "FRIDAY": "FRIDAY", + "MONDAY": "MONDAY", + "SATURDAY": "SATURDAY", + "SUNDAY": "SUNDAY", + "THURSDAY": "THURSDAY", + "TUESDAY": "TUESDAY", + "WEDNESDAY": "WEDNESDAY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DeletedServer": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "version": { + "attr_type": null + }, + "deletion_time": { + "attr_type": null + }, + "original_id": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DeletedServerListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DevOpsAuditingSettingsName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DiffBackupIntervalInHours": { + "type": "Enum", + "methods": {}, + "properties": { + "TWELVE": "TWELVE", + "TWENTY_FOUR": "TWENTY_FOUR", + "as_integer_ratio": "as_integer_ratio", + "bit_count": "bit_count", + "bit_length": "bit_length", + "conjugate": "conjugate", + "denominator": "denominator", + "from_bytes": "from_bytes", + "imag": "imag", + "is_integer": "is_integer", + "numerator": "numerator", + "real": "real", + "to_bytes": "to_bytes" + } + }, + "DistributedAvailabilityGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replication_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_availability_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_link_role": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_availability_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "failover_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "seeding_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "distributed_availability_group_name": { + "attr_type": null + }, + "distributed_availability_group_id": { + "attr_type": null + }, + "replication_mode": { + "attr_type": "replication_mode" + }, + "partner_link_role": { + "attr_type": null + }, + "partner_availability_group_name": { + "attr_type": "partner_availability_group_name" + }, + "partner_endpoint": { + "attr_type": "partner_endpoint" + }, + "instance_link_role": { + "attr_type": "instance_link_role" + }, + "instance_availability_group_name": { + "attr_type": "instance_availability_group_name" + }, + "failover_mode": { + "attr_type": "failover_mode" + }, + "seeding_mode": { + "attr_type": "seeding_mode" + }, + "databases": { + "attr_type": "databases" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": "database_name" + }, + "instance_replica_id": { + "attr_type": null + }, + "partner_replica_id": { + "attr_type": null + }, + "replica_state": { + "attr_type": null + }, + "seeding_progress": { + "attr_type": null + }, + "synchronization_health": { + "attr_type": null + }, + "connected_state": { + "attr_type": null + }, + "last_received_lsn": { + "attr_type": null + }, + "last_received_time": { + "attr_type": null + }, + "last_sent_lsn": { + "attr_type": null + }, + "last_sent_time": { + "attr_type": null + }, + "last_commit_lsn": { + "attr_type": null + }, + "last_commit_time": { + "attr_type": null + }, + "last_hardened_lsn": { + "attr_type": null + }, + "last_hardened_time": { + "attr_type": null + }, + "last_backup_lsn": { + "attr_type": null + }, + "last_backup_time": { + "attr_type": null + }, + "most_recent_link_error": { + "attr_type": null + }, + "partner_auth_cert_validity": { + "attr_type": null + }, + "instance_send_replication_lag_seconds": { + "attr_type": null + }, + "instance_redo_replication_lag_seconds": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupSetRole": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_role": { + "default": null, + "param_type": "keyword_only" + }, + "role_change_type": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "instance_role": { + "attr_type": "instance_role" + }, + "role_change_type": { + "attr_type": "role_change_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupsFailoverRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_type": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_type": { + "attr_type": "failover_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DtcName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "EditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_service_level_objectives": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "read_scale": { + "attr_type": null + }, + "supported_storage_capabilities": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPool": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "per_database_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "kind": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "per_database_settings": { + "attr_type": "per_database_settings" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_elastic_pool_performance_levels": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ElasticPoolListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "elastic_pool_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseMaxPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "supported_per_database_min_performance_levels": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseMinPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "max_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_capacity": { + "attr_type": "min_capacity" + }, + "max_capacity": { + "attr_type": "max_capacity" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "performance_level": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "max_database_count": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "supported_max_sizes": { + "attr_type": null + }, + "supported_per_database_max_sizes": { + "attr_type": null + }, + "supported_per_database_max_performance_levels": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "supported_min_capacities": { + "attr_type": null + }, + "supported_auto_pause_delay": { + "attr_type": null + }, + "supported_per_database_auto_pause_delay": { + "attr_type": null + }, + "supported_zones": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolState": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DISABLED": "DISABLED", + "READY": "READY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ElasticPoolUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "per_database_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "per_database_settings": { + "attr_type": "per_database_settings" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtector": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_name": { + "default": "none", + "param_type": "keyword_only" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_rotation_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "server_key_name": { + "attr_type": "server_key_name" + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": "auto_rotation_enabled" + }, + "key_version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtectorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtectorName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "EndpointCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "public_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "public_blob": { + "attr_type": "public_blob" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointCertificateListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointDependency": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "domain_name": { + "attr_type": null + }, + "endpoint_details": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "port": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorAdditionalInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ExportDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedDatabaseBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "predicate_expression": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "predicate_expression": { + "attr_type": "predicate_expression" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedDatabaseBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedServerBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_devops_audit_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "predicate_expression": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_devops_audit_enabled": { + "attr_type": "is_devops_audit_enabled" + }, + "predicate_expression": { + "attr_type": "predicate_expression" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedServerBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExternalGovernanceStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_servers": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "tags": { + "attr_type": "tags" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "replication_role": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "partner_servers": { + "attr_type": "partner_servers" + }, + "databases": { + "attr_type": "databases" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupDatabasesSecondaryType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReadOnlyEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "target_server": { + "attr_type": "target_server" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReadWriteEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": null, + "param_type": "keyword_only" + }, + "failover_with_data_loss_grace_period_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "failover_with_data_loss_grace_period_minutes": { + "attr_type": "failover_with_data_loss_grace_period_minutes" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroupUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_servers": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "databases": { + "attr_type": "databases" + }, + "partner_servers": { + "attr_type": "partner_servers" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "MANUAL": "MANUAL", + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverType": { + "type": "Enum", + "methods": {}, + "properties": { + "FORCED_ALLOW_DATA_LOSS": "FORCED_ALLOW_DATA_LOSS", + "PLANNED": "PLANNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "start_ip_address": { + "default": "none", + "param_type": "keyword_only" + }, + "end_ip_address": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_ip_address": { + "attr_type": "start_ip_address" + }, + "end_ip_address": { + "attr_type": "end_ip_address" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FirewallRuleList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "values": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "values": { + "attr_type": "values" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FreeLimitExhaustionBehavior": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_PAUSE": "AUTO_PAUSE", + "BILL_OVER_USAGE": "BILL_OVER_USAGE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FreeLimitExhaustionBehaviorCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "exhaustion_behavior_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "storage_type": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "GeoBackupPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "HybridSecondaryUsage": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "PASSIVE": "PASSIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "HybridSecondaryUsageDetected": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "PASSIVE": "PASSIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "IPv6FirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "start_i_pv6_address": { + "default": "none", + "param_type": "keyword_only" + }, + "end_i_pv6_address": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_i_pv6_address": { + "attr_type": "start_i_pv6_address" + }, + "end_i_pv6_address": { + "attr_type": "end_i_pv6_address" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "IPv6FirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "IdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "SYSTEM_ASSIGNED_USER_ASSIGNED": "SYSTEM_ASSIGNED_USER_ASSIGNED", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ImplementationMethod": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_POWER_SHELL": "AZURE_POWER_SHELL", + "T_SQL": "T_SQL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ImportExistingDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportExtensionsOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportExtensionsOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "last_modified_time": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "blob_uri": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "last_modified_time": { + "attr_type": null + }, + "blob_uri": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportNewDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "edition": { + "default": "none", + "param_type": "keyword_only" + }, + "service_objective_name": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": "database_name" + }, + "edition": { + "attr_type": "edition" + }, + "service_objective_name": { + "attr_type": "service_objective_name" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InaccessibilityReason": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE_REPLICATION": "DATABASE_REPLICATION", + "TRANSPARENT_DATA_ENCRYPTION": "TRANSPARENT_DATA_ENCRYPTION", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstanceFailoverGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_regions": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_pairs": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "secondary_type": { + "attr_type": "secondary_type" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "replication_role": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "partner_regions": { + "attr_type": "partner_regions" + }, + "managed_instance_pairs": { + "attr_type": "managed_instance_pairs" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReadOnlyEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReadWriteEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": null, + "param_type": "keyword_only" + }, + "failover_with_data_loss_grace_period_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "failover_with_data_loss_grace_period_minutes": { + "attr_type": "failover_with_data_loss_grace_period_minutes" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstancePool": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "license_type": { + "attr_type": "license_type" + }, + "dns_zone": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_families": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolFamilyCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "supported_vcores_values": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstancePoolListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "instance_pool_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "error_type": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "license_type": { + "attr_type": "license_type" + }, + "dns_zone": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolVcoresCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "storage_limit": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "IsRetryable": { + "type": "Enum", + "methods": {}, + "properties": { + "NO": "NO", + "YES": "YES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Job": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "default": "str", + "param_type": "keyword_only" + }, + "schedule": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": "description" + }, + "version": { + "attr_type": null + }, + "schedule": { + "attr_type": "schedule" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "database_id": { + "attr_type": "database_id" + }, + "state": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_service_level_objectives": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tenant_id": { + "attr_type": "tenant_id" + }, + "type": { + "attr_type": "type" + }, + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentIdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "SYSTEM_ASSIGNED_USER_ASSIGNED": "SYSTEM_ASSIGNED_USER_ASSIGNED", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobAgentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentServiceLevelObjectiveCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentState": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DELETING": "DELETING", + "DISABLED": "DISABLED", + "READY": "READY", + "UPDATING": "UPDATING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobAgentUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentUserAssignedIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobCredential": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "username": { + "default": "none", + "param_type": "keyword_only" + }, + "password": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "username": { + "attr_type": "username" + }, + "password": { + "attr_type": "password" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobCredentialListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecution": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "current_attempts": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "job_version": { + "attr_type": null + }, + "step_name": { + "attr_type": null + }, + "step_id": { + "attr_type": null + }, + "job_execution_id": { + "attr_type": null + }, + "lifecycle": { + "attr_type": null + }, + "provisioning_state": { + "attr_type": null + }, + "create_time": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "current_attempts": { + "attr_type": "current_attempts" + }, + "current_attempt_start_time": { + "attr_type": null + }, + "last_message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecutionLifecycle": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "CREATED": "CREATED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SKIPPED": "SKIPPED", + "SUCCEEDED": "SUCCEEDED", + "SUCCEEDED_WITH_SKIPPED": "SUCCEEDED_WITH_SKIPPED", + "TIMED_OUT": "TIMED_OUT", + "WAITING_FOR_CHILD_JOB_EXECUTIONS": "WAITING_FOR_CHILD_JOB_EXECUTIONS", + "WAITING_FOR_RETRY": "WAITING_FOR_RETRY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobExecutionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecutionTarget": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobPrivateEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_server_azure_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "target_server_azure_resource_id": { + "attr_type": "target_server_azure_resource_id" + }, + "private_endpoint_id": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobPrivateEndpointListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobSchedule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "str", + "param_type": "keyword_only" + }, + "end_time": { + "default": "str", + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "interval": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_time": { + "attr_type": "start_time" + }, + "end_time": { + "attr_type": "end_time" + }, + "type": { + "attr_type": "type" + }, + "enabled": { + "attr_type": "enabled" + }, + "interval": { + "attr_type": "interval" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobScheduleType": { + "type": "Enum", + "methods": {}, + "properties": { + "ONCE": "ONCE", + "RECURRING": "RECURRING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStep": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_group": { + "default": "none", + "param_type": "keyword_only" + }, + "credential": { + "default": "none", + "param_type": "keyword_only" + }, + "action": { + "default": "none", + "param_type": "keyword_only" + }, + "output": { + "default": "none", + "param_type": "keyword_only" + }, + "execution_options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "step_id": { + "attr_type": "step_id" + }, + "target_group": { + "attr_type": "target_group" + }, + "credential": { + "attr_type": "credential" + }, + "action": { + "attr_type": "action" + }, + "output": { + "attr_type": "output" + }, + "execution_options": { + "attr_type": "execution_options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepAction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "value": { + "default": null, + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "source": { + "default": "str", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "source": { + "attr_type": "source" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepActionSource": { + "type": "Enum", + "methods": {}, + "properties": { + "INLINE": "INLINE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStepActionType": { + "type": "Enum", + "methods": {}, + "properties": { + "T_SQL": "T_SQL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStepExecutionOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "timeout_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "retry_attempts": { + "default": "int", + "param_type": "keyword_only" + }, + "initial_retry_interval_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "maximum_retry_interval_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "retry_interval_backoff_multiplier": { + "default": "int", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "timeout_seconds": { + "attr_type": "timeout_seconds" + }, + "retry_attempts": { + "attr_type": "retry_attempts" + }, + "initial_retry_interval_seconds": { + "attr_type": "initial_retry_interval_seconds" + }, + "maximum_retry_interval_seconds": { + "attr_type": "maximum_retry_interval_seconds" + }, + "retry_interval_backoff_multiplier": { + "attr_type": "retry_interval_backoff_multiplier" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepOutput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "keyword_only" + }, + "database_name": { + "default": null, + "param_type": "keyword_only" + }, + "table_name": { + "default": null, + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "schema_name": { + "default": "str", + "param_type": "keyword_only" + }, + "credential": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "subscription_id": { + "attr_type": "subscription_id" + }, + "resource_group_name": { + "attr_type": "resource_group_name" + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "schema_name": { + "attr_type": "schema_name" + }, + "table_name": { + "attr_type": "table_name" + }, + "credential": { + "attr_type": "credential" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepOutputType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_DATABASE": "SQL_DATABASE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobTarget": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "keyword_only" + }, + "membership_type": { + "default": "str", + "param_type": "keyword_only" + }, + "server_name": { + "default": "none", + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_name": { + "default": "none", + "param_type": "keyword_only" + }, + "shard_map_name": { + "default": "none", + "param_type": "keyword_only" + }, + "refresh_credential": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "membership_type": { + "attr_type": "membership_type" + }, + "type": { + "attr_type": "type" + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "elastic_pool_name": { + "attr_type": "elastic_pool_name" + }, + "shard_map_name": { + "attr_type": "shard_map_name" + }, + "refresh_credential": { + "attr_type": "refresh_credential" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "members": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "members": { + "attr_type": "members" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroupMembershipType": { + "type": "Enum", + "methods": {}, + "properties": { + "EXCLUDE": "EXCLUDE", + "INCLUDE": "INCLUDE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobTargetType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_DATABASE": "SQL_DATABASE", + "SQL_ELASTIC_POOL": "SQL_ELASTIC_POOL", + "SQL_SERVER": "SQL_SERVER", + "SQL_SHARD_MAP": "SQL_SHARD_MAP", + "TARGET_GROUP": "TARGET_GROUP", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobVersion": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobVersionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploads": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "digest_storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "digest_storage_endpoint": { + "attr_type": "digest_storage_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploadsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploadsName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LedgerDigestUploadsState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LicenseTypeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LinkRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LocationCapabilities": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_server_versions": { + "attr_type": null + }, + "supported_managed_instance_versions": { + "attr_type": null + }, + "supported_job_agent_versions": { + "attr_type": null + }, + "is_zone_resilient_provisioning_allowed": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogSizeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogSizeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "GIGABYTES": "GIGABYTES", + "MEGABYTES": "MEGABYTES", + "PERCENT": "PERCENT", + "PETABYTES": "PETABYTES", + "TERABYTES": "TERABYTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LogicalDatabaseTransparentDataEncryption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "scan_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "scan_state": { + "attr_type": "scan_state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalDatabaseTransparentDataEncryptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalServerAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalServerSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "is_backup_immutable": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "legal_hold_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_name": { + "attr_type": null + }, + "server_create_time": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "database_deletion_time": { + "attr_type": null + }, + "backup_time": { + "attr_type": null + }, + "backup_expiration_time": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "is_backup_immutable": { + "attr_type": "is_backup_immutable" + }, + "time_based_immutability": { + "attr_type": "time_based_immutability" + }, + "time_based_immutability_mode": { + "attr_type": "time_based_immutability_mode" + }, + "legal_hold_immutability": { + "attr_type": "legal_hold_immutability" + }, + "backup_storage_access_tier": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackupOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "operation_type": { + "attr_type": null + }, + "from_backup_resource_id": { + "attr_type": null + }, + "to_backup_resource_id": { + "attr_type": null + }, + "target_backup_storage_redundancy": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_based_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "weekly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "monthly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "yearly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "week_of_year": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_based_immutability": { + "attr_type": "time_based_immutability" + }, + "time_based_immutability_mode": { + "attr_type": "time_based_immutability_mode" + }, + "weekly_retention": { + "attr_type": "weekly_retention" + }, + "monthly_retention": { + "attr_type": "monthly_retention" + }, + "yearly_retention": { + "attr_type": "yearly_retention" + }, + "week_of_year": { + "attr_type": "week_of_year" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MaintenanceConfigurationCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindowOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_window_cycles": { + "default": "none", + "param_type": "keyword_only" + }, + "min_duration_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "default_duration_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_cycles": { + "default": "none", + "param_type": "keyword_only" + }, + "time_granularity_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "allow_multiple_maintenance_windows_per_cycle": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_enabled": { + "attr_type": "is_enabled" + }, + "maintenance_window_cycles": { + "attr_type": "maintenance_window_cycles" + }, + "min_duration_in_minutes": { + "attr_type": "min_duration_in_minutes" + }, + "default_duration_in_minutes": { + "attr_type": "default_duration_in_minutes" + }, + "min_cycles": { + "attr_type": "min_cycles" + }, + "time_granularity_in_minutes": { + "attr_type": "time_granularity_in_minutes" + }, + "allow_multiple_maintenance_windows_per_cycle": { + "attr_type": "allow_multiple_maintenance_windows_per_cycle" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindowTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "day_of_week": { + "default": "none", + "param_type": "keyword_only" + }, + "start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "duration": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "day_of_week": { + "attr_type": "day_of_week" + }, + "start_time": { + "attr_type": "start_time" + }, + "duration": { + "attr_type": "duration" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindows": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_ranges": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_ranges": { + "attr_type": "time_ranges" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedBackupShortTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "retention_days": { + "attr_type": "retention_days" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedBackupShortTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_identity": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_token": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_complete_restore": { + "default": "none", + "param_type": "keyword_only" + }, + "last_backup_name": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_target_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "collation": { + "attr_type": "collation" + }, + "status": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "earliest_restore_point": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "default_secondary_location": { + "attr_type": null + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "storage_container_uri": { + "attr_type": "storage_container_uri" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "cross_subscription_source_database_id": { + "attr_type": "cross_subscription_source_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "cross_subscription_restorable_dropped_database_id": { + "attr_type": "cross_subscription_restorable_dropped_database_id" + }, + "storage_container_identity": { + "attr_type": "storage_container_identity" + }, + "storage_container_sas_token": { + "attr_type": "storage_container_sas_token" + }, + "failover_group_id": { + "attr_type": null + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "auto_complete_restore": { + "attr_type": "auto_complete_restore" + }, + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "cross_subscription_target_managed_instance_id": { + "attr_type": "cross_subscription_target_managed_instance_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "extended_accessibility_info": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "RECOVERY": "RECOVERY", + "RESTORE_EXTERNAL_BACKUP": "RESTORE_EXTERNAL_BACKUP", + "RESTORE_LONG_TERM_RETENTION_BACKUP": "RESTORE_LONG_TERM_RETENTION_BACKUP", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedDatabaseExtendedAccessibilityInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "inaccessibility_reason_error_code": { + "attr_type": null + }, + "inaccessibility_reason_description": { + "attr_type": null + }, + "inaccessibility_reason_kind": { + "attr_type": null + }, + "inaccessibility_reason_tde_key_uri": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "destination_managed_database_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "destination_managed_database_id": { + "attr_type": "destination_managed_database_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "operation_mode": { + "attr_type": null + }, + "source_managed_instance_name": { + "attr_type": null + }, + "target_managed_instance_name": { + "attr_type": null + }, + "source_managed_instance_id": { + "attr_type": null + }, + "target_managed_instance_id": { + "attr_type": null + }, + "source_database_name": { + "attr_type": null + }, + "target_database_name": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsBackupSetProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": null + }, + "first_stripe_name": { + "attr_type": null + }, + "number_of_stripes": { + "attr_type": null + }, + "backup_size_mb": { + "attr_type": null + }, + "restore_started_timestamp_utc": { + "attr_type": null + }, + "restore_finished_timestamp_utc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type_properties_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "block_reason": { + "attr_type": null + }, + "last_uploaded_file_name": { + "attr_type": null + }, + "last_uploaded_file_time": { + "attr_type": null + }, + "last_restored_file_name": { + "attr_type": null + }, + "last_restored_file_time": { + "attr_type": null + }, + "percent_completed": { + "attr_type": null + }, + "current_restored_size_mb": { + "attr_type": null + }, + "current_restore_plan_size_mb": { + "attr_type": null + }, + "current_backup_type": { + "attr_type": null + }, + "current_restoring_file_name": { + "attr_type": null + }, + "number_of_files_detected": { + "attr_type": null + }, + "number_of_files_queued": { + "attr_type": null + }, + "number_of_files_skipped": { + "attr_type": null + }, + "number_of_files_restoring": { + "attr_type": null + }, + "number_of_files_restored": { + "attr_type": null + }, + "number_of_files_unrestorable": { + "attr_type": null + }, + "full_backup_sets": { + "attr_type": null + }, + "diff_backup_sets": { + "attr_type": null + }, + "log_backup_sets": { + "attr_type": null + }, + "unrestorable_files": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsUnrestorableFileProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseStartMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "destination_managed_database_id": { + "default": null, + "param_type": "keyword_only" + }, + "operation_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "destination_managed_database_id": { + "attr_type": "destination_managed_database_id" + }, + "operation_mode": { + "attr_type": "operation_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DB_COPYING": "DB_COPYING", + "DB_MOVING": "DB_MOVING", + "INACCESSIBLE": "INACCESSIBLE", + "OFFLINE": "OFFLINE", + "ONLINE": "ONLINE", + "RESTORING": "RESTORING", + "SHUTDOWN": "SHUTDOWN", + "STARTING": "STARTING", + "STOPPED": "STOPPED", + "STOPPING": "STOPPING", + "UPDATING": "UPDATING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedDatabaseUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_identity": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_token": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_complete_restore": { + "default": "none", + "param_type": "keyword_only" + }, + "last_backup_name": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_target_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "collation": { + "attr_type": "collation" + }, + "status": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "earliest_restore_point": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "default_secondary_location": { + "attr_type": null + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "storage_container_uri": { + "attr_type": "storage_container_uri" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "cross_subscription_source_database_id": { + "attr_type": "cross_subscription_source_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "cross_subscription_restorable_dropped_database_id": { + "attr_type": "cross_subscription_restorable_dropped_database_id" + }, + "storage_container_identity": { + "attr_type": "storage_container_identity" + }, + "storage_container_sas_token": { + "attr_type": "storage_container_sas_token" + }, + "failover_group_id": { + "attr_type": null + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "auto_complete_restore": { + "attr_type": "auto_complete_restore" + }, + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "cross_subscription_target_managed_instance_id": { + "attr_type": "cross_subscription_target_managed_instance_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "extended_accessibility_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstance": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "is_general_purpose_v2": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "hybrid_secondary_usage": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_iops": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_throughput_mbps": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "dns_zone_partner": { + "default": "none", + "param_type": "keyword_only" + }, + "public_data_endpoint_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "source_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "proxy_override": { + "default": "none", + "param_type": "keyword_only" + }, + "timezone_id": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "service_principal": { + "default": "none", + "param_type": "keyword_only" + }, + "pricing_model": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_metadata": { + "default": "none", + "param_type": "keyword_only" + }, + "database_format": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_logical_availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "sku": { + "attr_type": "sku" + }, + "provisioning_state": { + "attr_type": null + }, + "managed_instance_create_mode": { + "attr_type": "managed_instance_create_mode" + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": "is_general_purpose_v2" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "state": { + "attr_type": null + }, + "license_type": { + "attr_type": "license_type" + }, + "hybrid_secondary_usage": { + "attr_type": "hybrid_secondary_usage" + }, + "hybrid_secondary_usage_detected": { + "attr_type": null + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "storage_iops": { + "attr_type": "storage_iops" + }, + "storage_throughput_mbps": { + "attr_type": "storage_throughput_mbps" + }, + "memory_size_in_gb": { + "attr_type": "memory_size_in_gb" + }, + "collation": { + "attr_type": "collation" + }, + "dns_zone": { + "attr_type": null + }, + "dns_zone_partner": { + "attr_type": "dns_zone_partner" + }, + "public_data_endpoint_enabled": { + "attr_type": "public_data_endpoint_enabled" + }, + "source_managed_instance_id": { + "attr_type": "source_managed_instance_id" + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "proxy_override": { + "attr_type": "proxy_override" + }, + "timezone_id": { + "attr_type": "timezone_id" + }, + "instance_pool_id": { + "attr_type": "instance_pool_id" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "service_principal": { + "attr_type": "service_principal" + }, + "virtual_cluster_id": { + "attr_type": null + }, + "external_governance_status": { + "attr_type": null + }, + "pricing_model": { + "attr_type": "pricing_model" + }, + "create_time": { + "attr_type": null + }, + "authentication_metadata": { + "attr_type": "authentication_metadata" + }, + "database_format": { + "attr_type": "database_format" + }, + "requested_logical_availability_zone": { + "attr_type": "requested_logical_availability_zone" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministratorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministratorType": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAzureADOnlyAuthListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAzureADOnlyAuthentication": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDatabaseFormat": { + "type": "Enum", + "methods": {}, + "properties": { + "ALWAYS_UP_TO_DATE": "ALWAYS_UP_TO_DATE", + "SQL_SERVER2022": "SQL_SERVER2022", + "SQL_SERVER2025": "SQL_SERVER2025", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceDtc": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "security_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "external_dns_suffix_search_list": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "dtc_enabled": { + "attr_type": "dtc_enabled" + }, + "security_settings": { + "attr_type": "security_settings" + }, + "external_dns_suffix_search_list": { + "attr_type": "external_dns_suffix_search_list" + }, + "dtc_host_name_dns_suffix": { + "attr_type": null + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcSecuritySettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "transaction_manager_communication_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "sna_lu6_point2_transactions_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_default_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_maximum_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "transaction_manager_communication_settings": { + "attr_type": "transaction_manager_communication_settings" + }, + "xa_transactions_enabled": { + "attr_type": "xa_transactions_enabled" + }, + "sna_lu6_point2_transactions_enabled": { + "attr_type": "sna_lu6_point2_transactions_enabled" + }, + "xa_transactions_default_timeout": { + "attr_type": "xa_transactions_default_timeout" + }, + "xa_transactions_maximum_timeout": { + "attr_type": "xa_transactions_maximum_timeout" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcTransactionManagerCommunicationSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "allow_inbound_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "allow_outbound_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "allow_inbound_enabled": { + "attr_type": "allow_inbound_enabled" + }, + "allow_outbound_enabled": { + "attr_type": "allow_outbound_enabled" + }, + "authentication": { + "attr_type": "authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": null + }, + "supported_families": { + "attr_type": null + }, + "supported_storage_capabilities": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEncryptionProtector": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_name": { + "default": "none", + "param_type": "keyword_only" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_rotation_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "server_key_name": { + "attr_type": "server_key_name" + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": "auto_rotation_enabled" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEncryptionProtectorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceExternalAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "principal_type": { + "attr_type": "principal_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceFamilyCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "supported_vcores_values": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "uri": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": "uri" + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceKeyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionBackup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_instance_name": { + "attr_type": null + }, + "managed_instance_create_time": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "database_deletion_time": { + "attr_type": null + }, + "backup_time": { + "attr_type": null + }, + "backup_expiration_time": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "backup_storage_access_tier": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionBackupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_storage_access_tier": { + "default": "none", + "param_type": "keyword_only" + }, + "weekly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "monthly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "yearly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "week_of_year": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "backup_storage_access_tier": { + "attr_type": "backup_storage_access_tier" + }, + "weekly_retention": { + "attr_type": "weekly_retention" + }, + "monthly_retention": { + "attr_type": "monthly_retention" + }, + "yearly_retention": { + "attr_type": "yearly_retention" + }, + "week_of_year": { + "attr_type": "week_of_year" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceMaintenanceConfigurationCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_instance_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "operation_parameters": { + "attr_type": null + }, + "operation_steps": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationParametersPair": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "current_parameters": { + "attr_type": null + }, + "requested_parameters": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationSteps": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "total_steps": { + "attr_type": null + }, + "current_step": { + "attr_type": null + }, + "steps_list": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePairInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "primary_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "primary_managed_instance_id": { + "attr_type": "primary_managed_instance_id" + }, + "partner_managed_instance_id": { + "attr_type": "partner_managed_instance_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePecProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnectionProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLink": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_id": { + "attr_type": null + }, + "required_members": { + "attr_type": null + }, + "required_zone_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkServiceConnectionStateProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "status": { + "default": null, + "param_type": "keyword_only" + }, + "description": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": "status" + }, + "description": { + "attr_type": "description" + }, + "actions_required": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceProxyOverride": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "PROXY": "PROXY", + "REDIRECT": "REDIRECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceQuery": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_text": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query_text": { + "attr_type": "query_text" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceQueryStatistics": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "is_general_purpose_v2": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "hybrid_secondary_usage": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_iops": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_throughput_mbps": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "dns_zone_partner": { + "default": "none", + "param_type": "keyword_only" + }, + "public_data_endpoint_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "source_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "proxy_override": { + "default": "none", + "param_type": "keyword_only" + }, + "timezone_id": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "service_principal": { + "default": "none", + "param_type": "keyword_only" + }, + "pricing_model": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_metadata": { + "default": "none", + "param_type": "keyword_only" + }, + "database_format": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_logical_availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "provisioning_state": { + "attr_type": null + }, + "managed_instance_create_mode": { + "attr_type": "managed_instance_create_mode" + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": "is_general_purpose_v2" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "state": { + "attr_type": null + }, + "license_type": { + "attr_type": "license_type" + }, + "hybrid_secondary_usage": { + "attr_type": "hybrid_secondary_usage" + }, + "hybrid_secondary_usage_detected": { + "attr_type": null + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "storage_iops": { + "attr_type": "storage_iops" + }, + "storage_throughput_mbps": { + "attr_type": "storage_throughput_mbps" + }, + "memory_size_in_gb": { + "attr_type": "memory_size_in_gb" + }, + "collation": { + "attr_type": "collation" + }, + "dns_zone": { + "attr_type": null + }, + "dns_zone_partner": { + "attr_type": "dns_zone_partner" + }, + "public_data_endpoint_enabled": { + "attr_type": "public_data_endpoint_enabled" + }, + "source_managed_instance_id": { + "attr_type": "source_managed_instance_id" + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "proxy_override": { + "attr_type": "proxy_override" + }, + "timezone_id": { + "attr_type": "timezone_id" + }, + "instance_pool_id": { + "attr_type": "instance_pool_id" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "service_principal": { + "attr_type": "service_principal" + }, + "virtual_cluster_id": { + "attr_type": null + }, + "external_governance_status": { + "attr_type": null + }, + "pricing_model": { + "attr_type": "pricing_model" + }, + "create_time": { + "attr_type": null + }, + "authentication_metadata": { + "attr_type": "authentication_metadata" + }, + "database_format": { + "attr_type": "database_format" + }, + "requested_logical_availability_zone": { + "attr_type": "requested_logical_availability_zone" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_key_uri": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tde_key_uri": { + "attr_type": "tde_key_uri" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVcoresCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "supported_memory_limits_mb": { + "attr_type": null + }, + "supported_memory_sizes_in_gb": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "supported_storage_sizes": { + "attr_type": null + }, + "included_storage_i_ops": { + "attr_type": null + }, + "supported_storage_i_ops": { + "attr_type": null + }, + "iops_min_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "iops_included_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "included_storage_throughput_m_bps": { + "attr_type": null + }, + "supported_storage_throughput_m_bps": { + "attr_type": null + }, + "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "instance_pool_supported": { + "attr_type": null + }, + "standalone_supported": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "supported_instance_pool_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploads": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "digest_storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "digest_storage_endpoint": { + "attr_type": "digest_storage_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploadsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploadsName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedLedgerDigestUploadsState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedServerCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedServerDnsAlias": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_dns_record": { + "attr_type": null + }, + "public_azure_dns_record": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasAcquisition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "old_managed_server_dns_alias_resource_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "old_managed_server_dns_alias_resource_id": { + "attr_type": "old_managed_server_dns_alias_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasCreation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_dns_record": { + "default": "bool", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "create_dns_record": { + "attr_type": "create_dns_record" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedShortTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedTransparentDataEncryption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedTransparentDataEncryptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagementOperationState": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELLED": "CANCELLED", + "CANCEL_IN_PROGRESS": "CANCEL_IN_PROGRESS", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "PENDING": "PENDING", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MaxLimitRangeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "scale_size": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeRangeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "scale_size": { + "attr_type": null + }, + "log_size": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "GIGABYTES": "GIGABYTES", + "MEGABYTES": "MEGABYTES", + "PETABYTES": "PETABYTES", + "TERABYTES": "TERABYTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MetricType": { + "type": "Enum", + "methods": {}, + "properties": { + "CPU": "CPU", + "DTU": "DTU", + "DURATION": "DURATION", + "IO": "IO", + "LOG_IO": "LOG_IO", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MinCapacityCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MinimalTlsVersion": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "ONE0": "ONE0", + "ONE1": "ONE1", + "ONE2": "ONE2", + "ONE3": "ONE3", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MoveOperationMode": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "MOVE": "MOVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "NSPConfigAccessRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "properties": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "properties": { + "attr_type": "properties" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigAccessRuleProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "direction": { + "default": "none", + "param_type": "keyword_only" + }, + "address_prefixes": { + "default": "none", + "param_type": "keyword_only" + }, + "fully_qualified_domain_names": { + "default": "none", + "param_type": "keyword_only" + }, + "subscriptions": { + "default": "none", + "param_type": "keyword_only" + }, + "network_security_perimeters": { + "default": "none", + "param_type": "keyword_only" + }, + "service_tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "direction": { + "attr_type": "direction" + }, + "address_prefixes": { + "attr_type": "address_prefixes" + }, + "fully_qualified_domain_names": { + "attr_type": "fully_qualified_domain_names" + }, + "subscriptions": { + "attr_type": "subscriptions" + }, + "network_security_perimeters": { + "attr_type": "network_security_perimeters" + }, + "service_tags": { + "attr_type": "service_tags" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigAssociation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "access_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "access_mode": { + "attr_type": "access_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigNetworkSecurityPerimeterRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "perimeter_guid": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "perimeter_guid": { + "attr_type": "perimeter_guid" + }, + "location": { + "attr_type": "location" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigPerimeter": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "perimeter_guid": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "perimeter_guid": { + "attr_type": "perimeter_guid" + }, + "location": { + "attr_type": "location" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigProfile": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "access_rules_version": { + "default": "none", + "param_type": "keyword_only" + }, + "access_rules": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "access_rules_version": { + "attr_type": "access_rules_version" + }, + "access_rules": { + "attr_type": "access_rules" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPProvisioningIssue": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "properties": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "properties": { + "attr_type": "properties" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPProvisioningIssueProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "issue_type": { + "default": "none", + "param_type": "keyword_only" + }, + "severity": { + "default": "none", + "param_type": "keyword_only" + }, + "description": { + "default": "none", + "param_type": "keyword_only" + }, + "suggested_resource_ids": { + "default": "none", + "param_type": "keyword_only" + }, + "suggested_access_rules": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "issue_type": { + "attr_type": "issue_type" + }, + "severity": { + "attr_type": "severity" + }, + "description": { + "attr_type": "description" + }, + "suggested_resource_ids": { + "attr_type": "suggested_resource_ids" + }, + "suggested_access_rules": { + "attr_type": "suggested_access_rules" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Name": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "localized_value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": "value" + }, + "localized_value": { + "attr_type": "localized_value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkIsolationSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_account_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_resource_id": { + "attr_type": "storage_account_resource_id" + }, + "sql_server_resource_id": { + "attr_type": "sql_server_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkIsolationSettingsAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_account_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_resource_id": { + "attr_type": "storage_account_resource_id" + }, + "sql_server_resource_id": { + "attr_type": "sql_server_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkSecurityPerimeterConfiguration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "network_security_perimeter": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_association": { + "default": "none", + "param_type": "keyword_only" + }, + "profile": { + "default": "none", + "param_type": "keyword_only" + }, + "provisioning_issues": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provisioning_state": { + "attr_type": null + }, + "network_security_perimeter": { + "attr_type": "network_security_perimeter" + }, + "resource_association": { + "attr_type": "resource_association" + }, + "profile": { + "attr_type": "profile" + }, + "provisioning_issues": { + "attr_type": "provisioning_issues" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkSecurityPerimeterConfigurationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Operation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "display": { + "attr_type": null + }, + "origin": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationDisplay": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provider": { + "attr_type": null + }, + "resource": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationMode": { + "type": "Enum", + "methods": {}, + "properties": { + "EXPORT": "EXPORT", + "IMPORT": "IMPORT", + "POLYBASE_IMPORT": "POLYBASE_IMPORT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "OperationOrigin": { + "type": "Enum", + "methods": {}, + "properties": { + "SYSTEM": "SYSTEM", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "OutboundEnvironmentEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "category": { + "attr_type": null + }, + "endpoints": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundEnvironmentEndpointCollection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundFirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundFirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PartnerInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "location": { + "attr_type": null + }, + "replication_role": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PartnerRegionInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": "location" + }, + "replication_role": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PauseDelayTimeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "MINUTES": "MINUTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PerDatabaseAutoPauseDelayTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "step_size": { + "attr_type": null + }, + "default": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "do_not_pause_value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PerformanceLevelUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "DTU": "DTU", + "V_CORES": "V_CORES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Phase": { + "type": "Enum", + "methods": {}, + "properties": { + "BUILDING_HYPERSCALE_COMPONENTS": "BUILDING_HYPERSCALE_COMPONENTS", + "CATCHUP": "CATCHUP", + "COPYING": "COPYING", + "CUTOVER_IN_PROGRESS": "CUTOVER_IN_PROGRESS", + "LOG_TRANSITION_IN_PROGRESS": "LOG_TRANSITION_IN_PROGRESS", + "WAITING_FOR_CUTOVER": "WAITING_FOR_CUTOVER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PhaseDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "phase": { + "attr_type": null + }, + "phase_information": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PricingModel": { + "type": "Enum", + "methods": {}, + "properties": { + "FREEMIUM": "FREEMIUM", + "REGULAR": "REGULAR", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrincipalType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "GROUP": "GROUP", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "group_ids": { + "attr_type": null + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "group_ids": { + "attr_type": null + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionRequestStatus": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_link_service_id": { + "attr_type": null + }, + "private_endpoint_connection_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointProvisioningState": { + "type": "Enum", + "methods": {}, + "properties": { + "APPROVING": "APPROVING", + "DROPPING": "DROPPING", + "FAILED": "FAILED", + "READY": "READY", + "REJECTING": "REJECTING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateLinkResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkResourceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkResourceProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_id": { + "attr_type": null + }, + "required_members": { + "attr_type": null + }, + "required_zone_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkServiceConnectionStateActionsRequire": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateLinkServiceConnectionStateProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "status": { + "default": null, + "param_type": "keyword_only" + }, + "description": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": "status" + }, + "description": { + "attr_type": "description" + }, + "actions_required": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkServiceConnectionStateStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "APPROVED": "APPROVED", + "DISCONNECTED": "DISCONNECTED", + "PENDING": "PENDING", + "REJECTED": "REJECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ProvisioningState": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "CREATED": "CREATED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ProxyResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ProxyResourceWithWritableName": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryCheck": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query": { + "attr_type": null + }, + "expected_result": { + "attr_type": null + }, + "column_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricInterval": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "metrics": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "interval_start_time": { + "attr_type": null + }, + "interval_type": { + "attr_type": null + }, + "execution_count": { + "attr_type": null + }, + "metrics": { + "attr_type": "metrics" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "display_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "min": { + "attr_type": null + }, + "max": { + "attr_type": null + }, + "avg": { + "attr_type": null + }, + "sum": { + "attr_type": null + }, + "stdev": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricUnitType": { + "type": "Enum", + "methods": {}, + "properties": { + "COUNT": "COUNT", + "KB": "KB", + "MICROSECONDS": "MICROSECONDS", + "PERCENTAGE": "PERCENTAGE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "QueryStatistics": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "intervals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "query_id": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "intervals": { + "attr_type": "intervals" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryStatisticsProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "intervals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "query_id": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "intervals": { + "attr_type": "intervals" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryTimeGrainType": { + "type": "Enum", + "methods": {}, + "properties": { + "P1_D": "P1_D", + "PT1_H": "PT1_H", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReadOnlyEndpointFailoverPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReadScaleCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "max_number_of_replicas": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReadWriteEndpointFailoverPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTOMATIC": "AUTOMATIC", + "MANUAL": "MANUAL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedAction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "recommendation_reason": { + "attr_type": null + }, + "valid_since": { + "attr_type": null + }, + "last_refresh": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "is_executable_action": { + "attr_type": null + }, + "is_revertable_action": { + "attr_type": null + }, + "is_archived_action": { + "attr_type": null + }, + "execute_action_start_time": { + "attr_type": null + }, + "execute_action_duration": { + "attr_type": null + }, + "revert_action_start_time": { + "attr_type": null + }, + "revert_action_duration": { + "attr_type": null + }, + "execute_action_initiated_by": { + "attr_type": null + }, + "execute_action_initiated_time": { + "attr_type": null + }, + "revert_action_initiated_by": { + "attr_type": null + }, + "revert_action_initiated_time": { + "attr_type": null + }, + "score": { + "attr_type": null + }, + "implementation_details": { + "attr_type": null + }, + "error_details": { + "attr_type": null + }, + "estimated_impact": { + "attr_type": null + }, + "observed_impact": { + "attr_type": null + }, + "time_series": { + "attr_type": null + }, + "linked_objects": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "recommendation_reason": { + "attr_type": null + }, + "valid_since": { + "attr_type": null + }, + "last_refresh": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "is_executable_action": { + "attr_type": null + }, + "is_revertable_action": { + "attr_type": null + }, + "is_archived_action": { + "attr_type": null + }, + "execute_action_start_time": { + "attr_type": null + }, + "execute_action_duration": { + "attr_type": null + }, + "revert_action_start_time": { + "attr_type": null + }, + "revert_action_duration": { + "attr_type": null + }, + "execute_action_initiated_by": { + "attr_type": null + }, + "execute_action_initiated_time": { + "attr_type": null + }, + "revert_action_initiated_by": { + "attr_type": null + }, + "revert_action_initiated_time": { + "attr_type": null + }, + "score": { + "attr_type": null + }, + "implementation_details": { + "attr_type": null + }, + "error_details": { + "attr_type": null + }, + "estimated_impact": { + "attr_type": null + }, + "observed_impact": { + "attr_type": null + }, + "time_series": { + "attr_type": null + }, + "linked_objects": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionCurrentState": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "ERROR": "ERROR", + "EXECUTING": "EXECUTING", + "EXPIRED": "EXPIRED", + "IGNORED": "IGNORED", + "MONITORING": "MONITORING", + "PENDING": "PENDING", + "PENDING_REVERT": "PENDING_REVERT", + "RESOLVED": "RESOLVED", + "REVERTED": "REVERTED", + "REVERTING": "REVERTING", + "REVERT_CANCELLED": "REVERT_CANCELLED", + "SUCCESS": "SUCCESS", + "VERIFYING": "VERIFYING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedActionErrorInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error_code": { + "attr_type": null + }, + "is_retryable": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionImpactRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "dimension_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "absolute_value": { + "attr_type": null + }, + "change_value_absolute": { + "attr_type": null + }, + "change_value_relative": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionImplementationInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "method": { + "attr_type": null + }, + "script": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionInitiatedBy": { + "type": "Enum", + "methods": {}, + "properties": { + "SYSTEM": "SYSTEM", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedActionMetricInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "metric_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "time_grain": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionStateInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "current_value": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "current_value": { + "attr_type": "current_value" + }, + "action_initiated_by": { + "attr_type": null + }, + "last_modified": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedSensitivityLabelUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "op": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "table": { + "default": "none", + "param_type": "keyword_only" + }, + "column": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "op": { + "attr_type": "op" + }, + "schema": { + "attr_type": "schema" + }, + "table": { + "attr_type": "table" + }, + "column": { + "attr_type": "column" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedSensitivityLabelUpdateKind": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLE": "DISABLE", + "ENABLE": "ENABLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedSensitivityLabelUpdateList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operations": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operations": { + "attr_type": "operations" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "edition": { + "attr_type": null + }, + "service_level_objective": { + "attr_type": null + }, + "elastic_pool_name": { + "attr_type": null + }, + "last_available_backup_date": { + "attr_type": null + }, + "keys": { + "attr_type": "keys" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "last_available_backup_date": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RefreshExternalGovernanceStatusOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RefreshExternalGovernanceStatusOperationResultMI": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "managed_instance_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Remediation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": null + }, + "scripts": { + "attr_type": null + }, + "automated": { + "attr_type": null + }, + "portal_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicaConnectedState": { + "type": "Enum", + "methods": {}, + "properties": { + "CONNECTED": "CONNECTED", + "DISCONNECTED": "DISCONNECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicaSynchronizationHealth": { + "type": "Enum", + "methods": {}, + "properties": { + "HEALTHY": "HEALTHY", + "NOT_HEALTHY": "NOT_HEALTHY", + "PARTIALLY_HEALTHY": "PARTIALLY_HEALTHY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicaType": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "READABLE_SECONDARY": "READABLE_SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationLink": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "partner_server": { + "attr_type": null + }, + "partner_database": { + "attr_type": null + }, + "partner_database_id": { + "attr_type": null + }, + "partner_location": { + "attr_type": null + }, + "role": { + "attr_type": null + }, + "partner_role": { + "attr_type": null + }, + "replication_mode": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "is_termination_allowed": { + "attr_type": null + }, + "link_type": { + "attr_type": "link_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationLinkListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationLinkType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "NAMED": "NAMED", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationLinkUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "link_type": { + "attr_type": "link_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "ASYNC": "ASYNC", + "SYNC": "SYNC", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "NON_READABLE_SECONDARY": "NON_READABLE_SECONDARY", + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "SOURCE": "SOURCE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationState": { + "type": "Enum", + "methods": {}, + "properties": { + "CATCH_UP": "CATCH_UP", + "PENDING": "PENDING", + "SEEDING": "SEEDING", + "SUSPENDED": "SUSPENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Resource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "principal_id": { + "attr_type": null + }, + "type": { + "attr_type": "type" + }, + "tenant_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceWithWritableName": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "database_name": { + "attr_type": null + }, + "max_size_bytes": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "deletion_date": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "keys": { + "attr_type": "keys" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "deletion_date": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestoreDetailsName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RestorePoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "restore_point_type": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "restore_point_creation_date": { + "attr_type": null + }, + "restore_point_label": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorePointListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorePointType": { + "type": "Enum", + "methods": {}, + "properties": { + "CONTINUOUS": "CONTINUOUS", + "DISCRETE": "DISCRETE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RoleChangeType": { + "type": "Enum", + "methods": {}, + "properties": { + "FORCED": "FORCED", + "PLANNED": "PLANNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleSeverity": { + "type": "Enum", + "methods": {}, + "properties": { + "HIGH": "HIGH", + "INFORMATIONAL": "INFORMATIONAL", + "LOW": "LOW", + "MEDIUM": "MEDIUM", + "OBSOLETE": "OBSOLETE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "FINDING": "FINDING", + "INTERNAL_ERROR": "INTERNAL_ERROR", + "NON_FINDING": "NON_FINDING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASELINE_EXPECTED": "BASELINE_EXPECTED", + "BINARY": "BINARY", + "NEGATIVE_LIST": "NEGATIVE_LIST", + "POSITIVE_LIST": "POSITIVE_LIST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SQLVulnerabilityAssessmentScanListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SampleName": { + "type": "Enum", + "methods": {}, + "properties": { + "ADVENTURE_WORKS_LT": "ADVENTURE_WORKS_LT", + "WIDE_WORLD_IMPORTERS_FULL": "WIDE_WORLD_IMPORTERS_FULL", + "WIDE_WORLD_IMPORTERS_STD": "WIDE_WORLD_IMPORTERS_STD", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ScheduleItem": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_day": { + "default": null, + "param_type": "keyword_only" + }, + "start_time": { + "default": null, + "param_type": "keyword_only" + }, + "stop_day": { + "default": null, + "param_type": "keyword_only" + }, + "stop_time": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_day": { + "attr_type": "start_day" + }, + "start_time": { + "attr_type": "start_time" + }, + "stop_day": { + "attr_type": "stop_day" + }, + "stop_time": { + "attr_type": "stop_time" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecondaryInstanceType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecondaryType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "NAMED": "NAMED", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyNameAutoGenerated": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "NEW": "NEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertsPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityEvent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "event_time": { + "attr_type": null + }, + "security_event_type": { + "attr_type": null + }, + "subscription": { + "attr_type": null + }, + "server": { + "attr_type": null + }, + "database": { + "attr_type": null + }, + "client_ip": { + "attr_type": null + }, + "application_name": { + "attr_type": null + }, + "principal_name": { + "attr_type": null + }, + "security_event_sql_injection_additional_properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventCollection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventSqlInjectionAdditionalProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "threat_id": { + "attr_type": null + }, + "statement": { + "attr_type": null + }, + "statement_highlight_offset": { + "attr_type": null + }, + "statement_highlight_length": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_INJECTION_EXPLOIT": "SQL_INJECTION_EXPLOIT", + "SQL_INJECTION_VULNERABILITY": "SQL_INJECTION_VULNERABILITY", + "UNDEFINED": "UNDEFINED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityEventsFilterParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "event_time": { + "default": "none", + "param_type": "keyword_only" + }, + "show_server_records": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "event_time": { + "attr_type": "event_time" + }, + "show_server_records": { + "attr_type": "show_server_records" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SeedingModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTOMATIC": "AUTOMATIC", + "MANUAL": "MANUAL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabel": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "label_name": { + "default": "none", + "param_type": "keyword_only" + }, + "label_id": { + "default": "none", + "param_type": "keyword_only" + }, + "information_type": { + "default": "none", + "param_type": "keyword_only" + }, + "information_type_id": { + "default": "none", + "param_type": "keyword_only" + }, + "rank": { + "default": "none", + "param_type": "keyword_only" + }, + "client_classification_source": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_by": { + "attr_type": null + }, + "schema_name": { + "attr_type": null + }, + "table_name": { + "attr_type": null + }, + "column_name": { + "attr_type": null + }, + "label_name": { + "attr_type": "label_name" + }, + "label_id": { + "attr_type": "label_id" + }, + "information_type": { + "attr_type": "information_type" + }, + "information_type_id": { + "attr_type": "information_type_id" + }, + "is_disabled": { + "attr_type": null + }, + "rank": { + "attr_type": "rank" + }, + "client_classification_source": { + "attr_type": "client_classification_source" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelRank": { + "type": "Enum", + "methods": {}, + "properties": { + "CRITICAL": "CRITICAL", + "HIGH": "HIGH", + "LOW": "LOW", + "MEDIUM": "MEDIUM", + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelSource": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "RECOMMENDED": "RECOMMENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "op": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "table": { + "default": "none", + "param_type": "keyword_only" + }, + "column": { + "default": "none", + "param_type": "keyword_only" + }, + "sensitivity_label": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "op": { + "attr_type": "op" + }, + "schema": { + "attr_type": "schema" + }, + "table": { + "attr_type": "table" + }, + "column": { + "attr_type": "column" + }, + "sensitivity_label": { + "attr_type": "sensitivity_label" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelUpdateKind": { + "type": "Enum", + "methods": {}, + "properties": { + "REMOVE": "REMOVE", + "SET": "SET", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelUpdateList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operations": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operations": { + "attr_type": "operations" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Server": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "public_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "restrict_outbound_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "is_i_pv6_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "kind": { + "attr_type": null + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "version": { + "attr_type": "version" + }, + "state": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "public_network_access": { + "attr_type": "public_network_access" + }, + "workspace_feature": { + "attr_type": null + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "restrict_outbound_network_access": { + "attr_type": "restrict_outbound_network_access" + }, + "is_i_pv6_enabled": { + "attr_type": "is_i_pv6_enabled" + }, + "external_governance_status": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAutomaticTuning": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "options": { + "attr_type": "options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAzureADAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAzureADOnlyAuthentication": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_devops_audit_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_devops_audit_enabled": { + "attr_type": "is_devops_audit_enabled" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_configuration_option_value": { + "attr_type": "server_configuration_option_value" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOptionName": { + "type": "Enum", + "methods": {}, + "properties": { + "ALLOW_POLYBASE_EXPORT": "ALLOW_POLYBASE_EXPORT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerConnectionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "connection_type": { + "attr_type": "connection_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConnectionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConnectionType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "PROXY": "PROXY", + "REDIRECT": "REDIRECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "NORMAL": "NORMAL", + "RESTORE": "RESTORE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerDevOpsAuditSettingsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDevOpsAuditingSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAlias": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_dns_record": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAliasAcquisition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "old_server_dns_alias_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "old_server_dns_alias_id": { + "attr_type": "old_server_dns_alias_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAliasListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerExternalAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "principal_type": { + "attr_type": "principal_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_id": { + "attr_type": "server_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "uri": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": "uri" + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": null + }, + "key_version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKeyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_KEY_VAULT": "AZURE_KEY_VAULT", + "SERVICE_MANAGED": "SERVICE_MANAGED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerNetworkAccessFlag": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerPrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerPublicNetworkAccessFlag": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "SECURED_BY_PERIMETER": "SECURED_BY_PERIMETER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "public_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "public_blob": { + "attr_type": "public_blob" + }, + "thumbprint": { + "attr_type": null + }, + "certificate_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustCertificatesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_members": { + "default": "none", + "param_type": "keyword_only" + }, + "trust_scopes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_members": { + "attr_type": "group_members" + }, + "trust_scopes": { + "attr_type": "trust_scopes" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroupPropertiesTrustScopesItem": { + "type": "Enum", + "methods": {}, + "properties": { + "GLOBAL_TRANSACTIONS": "GLOBAL_TRANSACTIONS", + "SERVICE_BROKER": "SERVICE_BROKER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "public_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "restrict_outbound_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "is_i_pv6_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "version": { + "attr_type": "version" + }, + "state": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "public_network_access": { + "attr_type": "public_network_access" + }, + "workspace_feature": { + "attr_type": null + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "restrict_outbound_network_access": { + "attr_type": "restrict_outbound_network_access" + }, + "is_i_pv6_enabled": { + "attr_type": "is_i_pv6_enabled" + }, + "external_governance_status": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "supported_elastic_pool_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerWorkspaceFeature": { + "type": "Enum", + "methods": {}, + "properties": { + "CONNECTED": "CONNECTED", + "DISCONNECTED": "DISCONNECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServiceObjectiveCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "supported_max_sizes": { + "attr_type": null + }, + "performance_level": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_auto_pause_delay": { + "attr_type": null + }, + "supported_min_capacities": { + "attr_type": null + }, + "compute_model": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "supported_zones": { + "attr_type": null + }, + "supported_free_limit_exhaustion_behaviors": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServicePrincipal": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "tenant_id": { + "attr_type": null + }, + "type": { + "attr_type": "type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServicePrincipalType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SetLegalHoldImmutability": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ShortTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Sku": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": null, + "param_type": "keyword_only" + }, + "tier": { + "default": "none", + "param_type": "keyword_only" + }, + "size": { + "default": "none", + "param_type": "keyword_only" + }, + "family": { + "default": "none", + "param_type": "keyword_only" + }, + "capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "tier": { + "attr_type": "tier" + }, + "size": { + "attr_type": "size" + }, + "family": { + "attr_type": "family" + }, + "capacity": { + "attr_type": "capacity" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlAgentConfiguration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlAgentConfigurationPropertiesState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SqlVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SqlVulnerabilityAssessmentScanError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "scan_id": { + "attr_type": null + }, + "trigger_type": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "errors": { + "attr_type": null + }, + "server": { + "attr_type": null + }, + "database": { + "attr_type": null + }, + "sql_version": { + "attr_type": null + }, + "high_severity_failed_rules_count": { + "attr_type": null + }, + "medium_severity_failed_rules_count": { + "attr_type": null + }, + "low_severity_failed_rules_count": { + "attr_type": null + }, + "total_passed_rules_count": { + "attr_type": null + }, + "total_failed_rules_count": { + "attr_type": null + }, + "total_rules_count": { + "attr_type": null + }, + "is_baseline_applied": { + "attr_type": null + }, + "last_scan_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanRecordListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "rule_id": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "is_trimmed": { + "attr_type": null + }, + "query_results": { + "attr_type": null + }, + "remediation": { + "attr_type": null + }, + "baseline_adjusted_result": { + "attr_type": null + }, + "rule_metadata": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StartStopManagedInstanceSchedule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "default": "str", + "param_type": "keyword_only" + }, + "time_zone_id": { + "default": "str", + "param_type": "keyword_only" + }, + "schedule_list": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "description": { + "attr_type": "description" + }, + "time_zone_id": { + "attr_type": "time_zone_id" + }, + "schedule_list": { + "attr_type": "schedule_list" + }, + "next_run_action": { + "attr_type": null + }, + "next_execution_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StartStopManagedInstanceScheduleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StartStopScheduleName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StorageCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StorageCapabilityStorageAccountType": { + "type": "Enum", + "methods": {}, + "properties": { + "GRS": "GRS", + "GZRS": "GZRS", + "LRS": "LRS", + "ZRS": "ZRS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StorageKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "SHARED_ACCESS_KEY": "SHARED_ACCESS_KEY", + "STORAGE_ACCESS_KEY": "STORAGE_ACCESS_KEY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SubscriptionUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SubscriptionUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspace": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workspaces": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "workspaces": { + "attr_type": "workspaces" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspaceInfoProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workspace_id": { + "default": "none", + "param_type": "keyword_only" + }, + "link_connection_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "workspace_id": { + "attr_type": "workspace_id" + }, + "link_connection_name": { + "attr_type": "link_connection_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspaceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name_properties_name": { + "attr_type": null + }, + "sync_database_id": { + "attr_type": "sync_database_id" + }, + "last_alive_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "is_up_to_date": { + "attr_type": null + }, + "expiry_time": { + "attr_type": null + }, + "version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentKeyProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sync_agent_key": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentLinkedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_type": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "user_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentLinkedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentState": { + "type": "Enum", + "methods": {}, + "properties": { + "NEVER_CONNECTED": "NEVER_CONNECTED", + "OFFLINE": "OFFLINE", + "ONLINE": "ONLINE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncConflictResolutionPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "HUB_WIN": "HUB_WIN", + "MEMBER_WIN": "MEMBER_WIN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncDatabaseIdListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncDatabaseIdProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncDirection": { + "type": "Enum", + "methods": {}, + "properties": { + "BIDIRECTIONAL": "BIDIRECTIONAL", + "ONE_WAY_HUB_TO_MEMBER": "ONE_WAY_HUB_TO_MEMBER", + "ONE_WAY_MEMBER_TO_HUB": "ONE_WAY_MEMBER_TO_HUB", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncFullSchemaProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tables": { + "attr_type": null + }, + "last_update_time": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaPropertiesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "columns": { + "attr_type": null + }, + "error_id": { + "attr_type": null + }, + "has_error": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "quoted_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaTableColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "data_size": { + "attr_type": null + }, + "data_type": { + "attr_type": null + }, + "error_id": { + "attr_type": null + }, + "has_error": { + "attr_type": null + }, + "is_primary_key": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "quoted_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "interval": { + "default": "none", + "param_type": "keyword_only" + }, + "conflict_resolution_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "hub_database_user_name": { + "default": "none", + "param_type": "keyword_only" + }, + "hub_database_password": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "enable_conflict_logging": { + "default": "none", + "param_type": "keyword_only" + }, + "conflict_logging_retention_in_days": { + "default": "none", + "param_type": "keyword_only" + }, + "use_private_link_connection": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "interval": { + "attr_type": "interval" + }, + "last_sync_time": { + "attr_type": null + }, + "conflict_resolution_policy": { + "attr_type": "conflict_resolution_policy" + }, + "sync_database_id": { + "attr_type": "sync_database_id" + }, + "hub_database_user_name": { + "attr_type": "hub_database_user_name" + }, + "hub_database_password": { + "attr_type": "hub_database_password" + }, + "sync_state": { + "attr_type": null + }, + "schema": { + "attr_type": "schema" + }, + "enable_conflict_logging": { + "attr_type": "enable_conflict_logging" + }, + "conflict_logging_retention_in_days": { + "attr_type": "conflict_logging_retention_in_days" + }, + "use_private_link_connection": { + "attr_type": "use_private_link_connection" + }, + "private_endpoint_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "timestamp": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "source": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "tracing_id": { + "attr_type": null + }, + "operation_status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogType": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "ERROR": "ERROR", + "SUCCESS": "SUCCESS", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncGroupSchema": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tables": { + "default": "none", + "param_type": "keyword_only" + }, + "master_sync_member_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tables": { + "attr_type": "tables" + }, + "master_sync_member_name": { + "attr_type": "master_sync_member_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupSchemaTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "columns": { + "default": "none", + "param_type": "keyword_only" + }, + "quoted_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "columns": { + "attr_type": "columns" + }, + "quoted_name": { + "attr_type": "quoted_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupSchemaTableColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "quoted_name": { + "default": "none", + "param_type": "keyword_only" + }, + "data_size": { + "default": "none", + "param_type": "keyword_only" + }, + "data_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "quoted_name": { + "attr_type": "quoted_name" + }, + "data_size": { + "attr_type": "data_size" + }, + "data_type": { + "attr_type": "data_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupState": { + "type": "Enum", + "methods": {}, + "properties": { + "ERROR": "ERROR", + "GOOD": "GOOD", + "NOT_READY": "NOT_READY", + "PROGRESSING": "PROGRESSING", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncGroupsType": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "ERROR": "ERROR", + "SUCCESS": "SUCCESS", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncMember": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_type": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_agent_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_member_azure_database_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "use_private_link_connection": { + "default": "none", + "param_type": "keyword_only" + }, + "server_name": { + "default": "none", + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "user_name": { + "default": "none", + "param_type": "keyword_only" + }, + "password": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_direction": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_type": { + "attr_type": "database_type" + }, + "sync_agent_id": { + "attr_type": "sync_agent_id" + }, + "sql_server_database_id": { + "attr_type": "sql_server_database_id" + }, + "sync_member_azure_database_resource_id": { + "attr_type": "sync_member_azure_database_resource_id" + }, + "use_private_link_connection": { + "attr_type": "use_private_link_connection" + }, + "private_endpoint_name": { + "attr_type": null + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "user_name": { + "attr_type": "user_name" + }, + "password": { + "attr_type": "password" + }, + "sync_direction": { + "attr_type": "sync_direction" + }, + "sync_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncMemberDbType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_SQL_DATABASE": "AZURE_SQL_DATABASE", + "SQL_SERVER_DATABASE": "SQL_SERVER_DATABASE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncMemberListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncMemberState": { + "type": "Enum", + "methods": {}, + "properties": { + "DE_PROVISIONED": "DE_PROVISIONED", + "DE_PROVISIONING": "DE_PROVISIONING", + "DE_PROVISION_FAILED": "DE_PROVISION_FAILED", + "DISABLED_BACKUP_RESTORE": "DISABLED_BACKUP_RESTORE", + "DISABLED_TOMBSTONE_CLEANUP": "DISABLED_TOMBSTONE_CLEANUP", + "PROVISIONED": "PROVISIONED", + "PROVISIONING": "PROVISIONING", + "PROVISION_FAILED": "PROVISION_FAILED", + "REPROVISIONING": "REPROVISIONING", + "REPROVISION_FAILED": "REPROVISION_FAILED", + "SYNC_CANCELLED": "SYNC_CANCELLED", + "SYNC_CANCELLING": "SYNC_CANCELLING", + "SYNC_FAILED": "SYNC_FAILED", + "SYNC_IN_PROGRESS": "SYNC_IN_PROGRESS", + "SYNC_SUCCEEDED": "SYNC_SUCCEEDED", + "SYNC_SUCCEEDED_WITH_WARNINGS": "SYNC_SUCCEEDED_WITH_WARNINGS", + "UN_PROVISIONED": "UN_PROVISIONED", + "UN_REPROVISIONED": "UN_REPROVISIONED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SystemData": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "created_by": { + "default": "none", + "param_type": "keyword_only" + }, + "created_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "created_at": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_at": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "created_by": { + "attr_type": "created_by" + }, + "created_by_type": { + "attr_type": "created_by_type" + }, + "created_at": { + "attr_type": "created_at" + }, + "last_modified_by": { + "attr_type": "last_modified_by" + }, + "last_modified_by_type": { + "attr_type": "last_modified_by_type" + }, + "last_modified_at": { + "attr_type": "last_modified_at" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TableTemporalType": { + "type": "Enum", + "methods": {}, + "properties": { + "HISTORY_TABLE": "HISTORY_TABLE", + "NON_TEMPORAL_TABLE": "NON_TEMPORAL_TABLE", + "SYSTEM_VERSIONED_TEMPORAL_TABLE": "SYSTEM_VERSIONED_TEMPORAL_TABLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TdeCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "cert_password": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_blob": { + "attr_type": "private_blob" + }, + "cert_password": { + "attr_type": "cert_password" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TimeBasedImmutability": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TimeBasedImmutabilityMode": { + "type": "Enum", + "methods": {}, + "properties": { + "LOCKED": "LOCKED", + "UNLOCKED": "UNLOCKED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TimeZone": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_zone_id": { + "attr_type": null + }, + "display_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TimeZoneListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TopQueries": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "queries": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "number_of_queries": { + "attr_type": null + }, + "aggregation_function": { + "attr_type": null + }, + "observation_metric": { + "attr_type": null + }, + "interval_type": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "queries": { + "attr_type": "queries" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TopQueriesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TrackedResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TransparentDataEncryptionName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TransparentDataEncryptionScanState": { + "type": "Enum", + "methods": {}, + "properties": { + "ABORTED": "ABORTED", + "COMPLETED": "COMPLETED", + "NONE": "NONE", + "RESUME": "RESUME", + "RUNNING": "RUNNING", + "SUSPEND": "SUSPEND", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TransparentDataEncryptionState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "UpdateLongTermRetentionBackupParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpdateVirtualClusterDnsServersOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "family": { + "default": "none", + "param_type": "keyword_only" + }, + "tier": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "family": { + "attr_type": "family" + }, + "tier": { + "attr_type": "tier" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationStepWithEstimatesAndDuration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "step_end_time": { + "default": "none", + "param_type": "keyword_only" + }, + "time_elapsed": { + "default": "none", + "param_type": "keyword_only" + }, + "order": { + "default": "none", + "param_type": "keyword_only" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "status": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "step_start_time": { + "attr_type": "step_start_time" + }, + "step_end_time": { + "attr_type": "step_end_time" + }, + "time_elapsed": { + "attr_type": "time_elapsed" + }, + "order": { + "attr_type": "order" + }, + "name": { + "attr_type": "name" + }, + "status": { + "attr_type": "status" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "COMPLETED": "COMPLETED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "NOT_STARTED": "NOT_STARTED", + "SLOWED_DOWN": "SLOWED_DOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Usage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "requested_limit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UserIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VaRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "rule_id": { + "attr_type": null + }, + "severity": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "rule_type": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "rationale": { + "attr_type": null + }, + "query_check": { + "attr_type": null + }, + "benchmark_references": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualCluster": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "subnet_id": { + "attr_type": null + }, + "version": { + "attr_type": "version" + }, + "child_resources": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualClusterListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualClusterUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "subnet_id": { + "attr_type": null + }, + "version": { + "attr_type": "version" + }, + "child_resources": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "ignore_missing_vnet_service_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "virtual_network_subnet_id": { + "attr_type": "virtual_network_subnet_id" + }, + "ignore_missing_vnet_service_endpoint": { + "attr_type": "ignore_missing_vnet_service_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRuleState": { + "type": "Enum", + "methods": {}, + "properties": { + "DELETING": "DELETING", + "FAILED": "FAILED", + "INITIALIZING": "INITIALIZING", + "IN_PROGRESS": "IN_PROGRESS", + "READY": "READY", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentPolicyBaselineName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "MASTER": "MASTER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentRecurringScansProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "email_subscription_admins": { + "default": "bool", + "param_type": "keyword_only" + }, + "emails": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_enabled": { + "attr_type": "is_enabled" + }, + "email_subscription_admins": { + "attr_type": "email_subscription_admins" + }, + "emails": { + "attr_type": "emails" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "scan_id": { + "attr_type": null + }, + "trigger_type": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "errors": { + "attr_type": null + }, + "storage_container_path": { + "attr_type": null + }, + "number_of_failed_security_checks": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanRecordListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanState": { + "type": "Enum", + "methods": {}, + "properties": { + "FAILED": "FAILED", + "FAILED_TO_RUN": "FAILED_TO_RUN", + "IN_PROGRESS": "IN_PROGRESS", + "PASSED": "PASSED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentScanTriggerType": { + "type": "Enum", + "methods": {}, + "properties": { + "ON_DEMAND": "ON_DEMAND", + "RECURRING": "RECURRING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "WorkloadClassifier": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "member_name": { + "default": "none", + "param_type": "keyword_only" + }, + "label": { + "default": "none", + "param_type": "keyword_only" + }, + "context": { + "default": "none", + "param_type": "keyword_only" + }, + "start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "end_time": { + "default": "none", + "param_type": "keyword_only" + }, + "importance": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "member_name": { + "attr_type": "member_name" + }, + "label": { + "attr_type": "label" + }, + "context": { + "attr_type": "context" + }, + "start_time": { + "attr_type": "start_time" + }, + "end_time": { + "attr_type": "end_time" + }, + "importance": { + "attr_type": "importance" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadClassifierListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "min_resource_percent": { + "default": "none", + "param_type": "keyword_only" + }, + "max_resource_percent": { + "default": "none", + "param_type": "keyword_only" + }, + "min_resource_percent_per_request": { + "default": "none", + "param_type": "keyword_only" + }, + "max_resource_percent_per_request": { + "default": "none", + "param_type": "keyword_only" + }, + "importance": { + "default": "none", + "param_type": "keyword_only" + }, + "query_execution_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_resource_percent": { + "attr_type": "min_resource_percent" + }, + "max_resource_percent": { + "attr_type": "max_resource_percent" + }, + "min_resource_percent_per_request": { + "attr_type": "min_resource_percent_per_request" + }, + "max_resource_percent_per_request": { + "attr_type": "max_resource_percent_per_request" + }, + "importance": { + "attr_type": "importance" + }, + "query_execution_timeout": { + "attr_type": "query_execution_timeout" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ZonePinningCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "availability_zone": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.aio": { + "class_nodes": { + "SqlManagementClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "backup_short_term_retention_policies": { + "attr_type": "BackupShortTermRetentionPoliciesOperations" + }, + "server_blob_auditing_policies": { + "attr_type": "ServerBlobAuditingPoliciesOperations" + }, + "database_blob_auditing_policies": { + "attr_type": "DatabaseBlobAuditingPoliciesOperations" + }, + "extended_database_blob_auditing_policies": { + "attr_type": "ExtendedDatabaseBlobAuditingPoliciesOperations" + }, + "extended_server_blob_auditing_policies": { + "attr_type": "ExtendedServerBlobAuditingPoliciesOperations" + }, + "database_advanced_threat_protection_settings": { + "attr_type": "DatabaseAdvancedThreatProtectionSettingsOperations" + }, + "database_advisors": { + "attr_type": "DatabaseAdvisorsOperations" + }, + "database_automatic_tuning": { + "attr_type": "DatabaseAutomaticTuningOperations" + }, + "database_columns": { + "attr_type": "DatabaseColumnsOperations" + }, + "database_encryption_protectors": { + "attr_type": "DatabaseEncryptionProtectorsOperations" + }, + "database_extensions": { + "attr_type": "DatabaseExtensionsOperations" + }, + "database_operations": { + "attr_type": "DatabaseOperationsOperations" + }, + "database_recommended_actions": { + "attr_type": "DatabaseRecommendedActionsOperations" + }, + "databases": { + "attr_type": "DatabasesOperations" + }, + "database_schemas": { + "attr_type": "DatabaseSchemasOperations" + }, + "database_security_alert_policies": { + "attr_type": "DatabaseSecurityAlertPoliciesOperations" + }, + "database_sql_vulnerability_assessment_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentBaselinesOperations" + }, + "database_sql_vulnerability_assessment_execute_scan": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations" + }, + "database_sql_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_sql_vulnerability_assessment_scan_result": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScanResultOperations" + }, + "database_sql_vulnerability_assessment_scans": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScansOperations" + }, + "database_sql_vulnerability_assessments_settings": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentsSettingsOperations" + }, + "database_tables": { + "attr_type": "DatabaseTablesOperations" + }, + "database_usages": { + "attr_type": "DatabaseUsagesOperations" + }, + "database_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_vulnerability_assessments": { + "attr_type": "DatabaseVulnerabilityAssessmentsOperations" + }, + "database_vulnerability_assessment_scans": { + "attr_type": "DatabaseVulnerabilityAssessmentScansOperations" + }, + "data_masking_policies": { + "attr_type": "DataMaskingPoliciesOperations" + }, + "data_masking_rules": { + "attr_type": "DataMaskingRulesOperations" + }, + "data_warehouse_user_activities": { + "attr_type": "DataWarehouseUserActivitiesOperations" + }, + "deleted_servers": { + "attr_type": "DeletedServersOperations" + }, + "distributed_availability_groups": { + "attr_type": "DistributedAvailabilityGroupsOperations" + }, + "elastic_pool_operations": { + "attr_type": "ElasticPoolOperationsOperations" + }, + "elastic_pools": { + "attr_type": "ElasticPoolsOperations" + }, + "encryption_protectors": { + "attr_type": "EncryptionProtectorsOperations" + }, + "endpoint_certificates": { + "attr_type": "EndpointCertificatesOperations" + }, + "failover_groups": { + "attr_type": "FailoverGroupsOperations" + }, + "firewall_rules": { + "attr_type": "FirewallRulesOperations" + }, + "geo_backup_policies": { + "attr_type": "GeoBackupPoliciesOperations" + }, + "instance_failover_groups": { + "attr_type": "InstanceFailoverGroupsOperations" + }, + "instance_pool_operations": { + "attr_type": "InstancePoolOperationsOperations" + }, + "instance_pools": { + "attr_type": "InstancePoolsOperations" + }, + "ipv6_firewall_rules": { + "attr_type": "IPv6FirewallRulesOperations" + }, + "job_agents": { + "attr_type": "JobAgentsOperations" + }, + "job_credentials": { + "attr_type": "JobCredentialsOperations" + }, + "job_executions": { + "attr_type": "JobExecutionsOperations" + }, + "job_private_endpoints": { + "attr_type": "JobPrivateEndpointsOperations" + }, + "jobs": { + "attr_type": "JobsOperations" + }, + "job_step_executions": { + "attr_type": "JobStepExecutionsOperations" + }, + "job_steps": { + "attr_type": "JobStepsOperations" + }, + "job_target_executions": { + "attr_type": "JobTargetExecutionsOperations" + }, + "job_target_groups": { + "attr_type": "JobTargetGroupsOperations" + }, + "job_versions": { + "attr_type": "JobVersionsOperations" + }, + "ledger_digest_uploads": { + "attr_type": "LedgerDigestUploadsOperations" + }, + "capabilities": { + "attr_type": "CapabilitiesOperations" + }, + "long_term_retention_backups": { + "attr_type": "LongTermRetentionBackupsOperations" + }, + "long_term_retention_managed_instance_backups": { + "attr_type": "LongTermRetentionManagedInstanceBackupsOperations" + }, + "long_term_retention_policies": { + "attr_type": "LongTermRetentionPoliciesOperations" + }, + "maintenance_window_options": { + "attr_type": "MaintenanceWindowOptionsOperations" + }, + "maintenance_windows": { + "attr_type": "MaintenanceWindowsOperations" + }, + "managed_backup_short_term_retention_policies": { + "attr_type": "ManagedBackupShortTermRetentionPoliciesOperations" + }, + "managed_database_advanced_threat_protection_settings": { + "attr_type": "ManagedDatabaseAdvancedThreatProtectionSettingsOperations" + }, + "managed_database_columns": { + "attr_type": "ManagedDatabaseColumnsOperations" + }, + "managed_database_move_operations": { + "attr_type": "ManagedDatabaseMoveOperationsOperations" + }, + "managed_database_queries": { + "attr_type": "ManagedDatabaseQueriesOperations" + }, + "managed_database_restore_details": { + "attr_type": "ManagedDatabaseRestoreDetailsOperations" + }, + "managed_databases": { + "attr_type": "ManagedDatabasesOperations" + }, + "managed_database_schemas": { + "attr_type": "ManagedDatabaseSchemasOperations" + }, + "managed_database_security_alert_policies": { + "attr_type": "ManagedDatabaseSecurityAlertPoliciesOperations" + }, + "managed_database_security_events": { + "attr_type": "ManagedDatabaseSecurityEventsOperations" + }, + "managed_database_sensitivity_labels": { + "attr_type": "ManagedDatabaseSensitivityLabelsOperations" + }, + "managed_database_recommended_sensitivity_labels": { + "attr_type": "ManagedDatabaseRecommendedSensitivityLabelsOperations" + }, + "managed_database_tables": { + "attr_type": "ManagedDatabaseTablesOperations" + }, + "managed_database_transparent_data_encryption": { + "attr_type": "ManagedDatabaseTransparentDataEncryptionOperations" + }, + "managed_database_vulnerability_assessment_rule_baselines": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "managed_database_vulnerability_assessments": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentsOperations" + }, + "managed_database_vulnerability_assessment_scans": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentScansOperations" + }, + "managed_instance_administrators": { + "attr_type": "ManagedInstanceAdministratorsOperations" + }, + "managed_instance_advanced_threat_protection_settings": { + "attr_type": "ManagedInstanceAdvancedThreatProtectionSettingsOperations" + }, + "managed_instance_azure_ad_only_authentications": { + "attr_type": "ManagedInstanceAzureADOnlyAuthenticationsOperations" + }, + "managed_instance_dtcs": { + "attr_type": "ManagedInstanceDtcsOperations" + }, + "managed_instance_encryption_protectors": { + "attr_type": "ManagedInstanceEncryptionProtectorsOperations" + }, + "managed_instance_keys": { + "attr_type": "ManagedInstanceKeysOperations" + }, + "managed_instance_long_term_retention_policies": { + "attr_type": "ManagedInstanceLongTermRetentionPoliciesOperations" + }, + "managed_instance_operations": { + "attr_type": "ManagedInstanceOperationsOperations" + }, + "managed_instance_private_endpoint_connections": { + "attr_type": "ManagedInstancePrivateEndpointConnectionsOperations" + }, + "managed_instance_private_link_resources": { + "attr_type": "ManagedInstancePrivateLinkResourcesOperations" + }, + "managed_instances": { + "attr_type": "ManagedInstancesOperations" + }, + "managed_instance_tde_certificates": { + "attr_type": "ManagedInstanceTdeCertificatesOperations" + }, + "managed_instance_vulnerability_assessments": { + "attr_type": "ManagedInstanceVulnerabilityAssessmentsOperations" + }, + "managed_ledger_digest_uploads": { + "attr_type": "ManagedLedgerDigestUploadsOperations" + }, + "managed_restorable_dropped_database_backup_short_term_retention_policies": { + "attr_type": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations" + }, + "managed_server_dns_aliases": { + "attr_type": "ManagedServerDnsAliasesOperations" + }, + "managed_server_security_alert_policies": { + "attr_type": "ManagedServerSecurityAlertPoliciesOperations" + }, + "network_security_perimeter_configurations": { + "attr_type": "NetworkSecurityPerimeterConfigurationsOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "outbound_firewall_rules": { + "attr_type": "OutboundFirewallRulesOperations" + }, + "private_endpoint_connections": { + "attr_type": "PrivateEndpointConnectionsOperations" + }, + "private_link_resources": { + "attr_type": "PrivateLinkResourcesOperations" + }, + "recoverable_databases": { + "attr_type": "RecoverableDatabasesOperations" + }, + "recoverable_managed_databases": { + "attr_type": "RecoverableManagedDatabasesOperations" + }, + "replication_links": { + "attr_type": "ReplicationLinksOperations" + }, + "restorable_dropped_databases": { + "attr_type": "RestorableDroppedDatabasesOperations" + }, + "restorable_dropped_managed_databases": { + "attr_type": "RestorableDroppedManagedDatabasesOperations" + }, + "restore_points": { + "attr_type": "RestorePointsOperations" + }, + "sensitivity_labels": { + "attr_type": "SensitivityLabelsOperations" + }, + "recommended_sensitivity_labels": { + "attr_type": "RecommendedSensitivityLabelsOperations" + }, + "server_advanced_threat_protection_settings": { + "attr_type": "ServerAdvancedThreatProtectionSettingsOperations" + }, + "server_advisors": { + "attr_type": "ServerAdvisorsOperations" + }, + "server_automatic_tuning": { + "attr_type": "ServerAutomaticTuningOperations" + }, + "server_azure_ad_administrators": { + "attr_type": "ServerAzureADAdministratorsOperations" + }, + "server_azure_ad_only_authentications": { + "attr_type": "ServerAzureADOnlyAuthenticationsOperations" + }, + "server_configuration_options": { + "attr_type": "ServerConfigurationOptionsOperations" + }, + "server_connection_policies": { + "attr_type": "ServerConnectionPoliciesOperations" + }, + "server_dev_ops_audit_settings": { + "attr_type": "ServerDevOpsAuditSettingsOperations" + }, + "server_dns_aliases": { + "attr_type": "ServerDnsAliasesOperations" + }, + "server_keys": { + "attr_type": "ServerKeysOperations" + }, + "server_operations": { + "attr_type": "ServerOperationsOperations" + }, + "servers": { + "attr_type": "ServersOperations" + }, + "server_security_alert_policies": { + "attr_type": "ServerSecurityAlertPoliciesOperations" + }, + "server_trust_certificates": { + "attr_type": "ServerTrustCertificatesOperations" + }, + "server_trust_groups": { + "attr_type": "ServerTrustGroupsOperations" + }, + "server_usages": { + "attr_type": "ServerUsagesOperations" + }, + "server_vulnerability_assessments": { + "attr_type": "ServerVulnerabilityAssessmentsOperations" + }, + "sql_agent": { + "attr_type": "SqlAgentOperations" + }, + "sql_vulnerability_assessment_baseline": { + "attr_type": "SqlVulnerabilityAssessmentBaselineOperations" + }, + "sql_vulnerability_assessment_baselines": { + "attr_type": "SqlVulnerabilityAssessmentBaselinesOperations" + }, + "sql_vulnerability_assessment_execute_scan": { + "attr_type": "SqlVulnerabilityAssessmentExecuteScanOperations" + }, + "sql_vulnerability_assessment_rule_baseline": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselineOperations" + }, + "sql_vulnerability_assessment_rule_baselines": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "sql_vulnerability_assessment_scan_result": { + "attr_type": "SqlVulnerabilityAssessmentScanResultOperations" + }, + "sql_vulnerability_assessment_scans": { + "attr_type": "SqlVulnerabilityAssessmentScansOperations" + }, + "sql_vulnerability_assessments_settings": { + "attr_type": "SqlVulnerabilityAssessmentsSettingsOperations" + }, + "sql_vulnerability_assessments": { + "attr_type": "SqlVulnerabilityAssessmentsOperations" + }, + "start_stop_managed_instance_schedules": { + "attr_type": "StartStopManagedInstanceSchedulesOperations" + }, + "subscription_usages": { + "attr_type": "SubscriptionUsagesOperations" + }, + "synapse_link_workspaces": { + "attr_type": "SynapseLinkWorkspacesOperations" + }, + "sync_agents": { + "attr_type": "SyncAgentsOperations" + }, + "sync_groups": { + "attr_type": "SyncGroupsOperations" + }, + "sync_members": { + "attr_type": "SyncMembersOperations" + }, + "tde_certificates": { + "attr_type": "TdeCertificatesOperations" + }, + "time_zones": { + "attr_type": "TimeZonesOperations" + }, + "transparent_data_encryptions": { + "attr_type": "TransparentDataEncryptionsOperations" + }, + "usages": { + "attr_type": "UsagesOperations" + }, + "virtual_clusters": { + "attr_type": "VirtualClustersOperations" + }, + "virtual_network_rules": { + "attr_type": "VirtualNetworkRulesOperations" + }, + "workload_classifiers": { + "attr_type": "WorkloadClassifiersOperations" + }, + "workload_groups": { + "attr_type": "WorkloadGroupsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.aio.operations": { + "class_nodes": { + "BackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "CapabilitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "include": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataWarehouseUserActivitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_warehouse_user_activity_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_revert": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseExtensionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseExtensions", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseRecommendedActionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database_advisor": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedActionAutoGenerated", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Database", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExportDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_import_method": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportExistingDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_pause": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_upgrade_data_warehouse": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "rename": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ResourceMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DeletedServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_recover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DistributedAvailabilityGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupsFailoverRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_set_role": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupSetRole", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "EncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EndpointCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "endpoint_type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedDatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedDatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_try_planned_before_forced_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroupUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "replace": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRuleList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "GeoBackupPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "GeoBackupPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "IPv6FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IPv6FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstanceFailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstanceFailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgentUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobCredentialsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobCredential", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobPrivateEndpointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobPrivateEndpoint", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobStep", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_step": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobTargetGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobVersionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Job", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_change_access_tier": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_change_access_tier_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_copy_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_lock_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_lock_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_set_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_set_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionManagedInstanceBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_options_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "MaintenanceWindows", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseMoveOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseQueriesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_query": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseRecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseRestoreDetailsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_details_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseTransparentDataEncryptionOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_cancel_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_complete_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_complete_restore": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CompleteDatabaseRestoreDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabase", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_start_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseStartMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceDtcsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceDtc", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceEncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceLongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceLongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstancePrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceTdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedInstanceVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstance", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_start": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_stop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_validate_azure_key_vault_encryption_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "number_of_queries": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "databases": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "aggregation_function": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "observation_metric": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_outbound_network_dependencies_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedLedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedLedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_restorable_dropped_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasCreation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "NetworkSecurityPerimeterConfigurationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reconcile": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "OutboundFirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "PrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "RecoverableDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecoverableManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recoverable_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ReplicationLinksOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLink", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLinkUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorePointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CreateDatabaseRestorePointDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAzureADAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConfigurationOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConfigurationOption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConnectionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConnectionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDevOpsAuditSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDevOpsAuditingSettings", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Server", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_import_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportNewDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_name_availability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckNameAvailabilityRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlAgentOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlAgentConfiguration", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "StartStopManagedInstanceSchedulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "StartStopManagedInstanceSchedule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SubscriptionUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "usage_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SynapseLinkWorkspacesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "generate_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_linked_databases": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_hub_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "cancel_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_hub_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_logs": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "continuation_token_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_sync_database_ids": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "trigger_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SyncMembersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_member_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sync_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_member_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "TimeZonesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_zone_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TransparentDataEncryptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LogicalDatabaseTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_suspend": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "UsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand_children": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualClustersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualCluster", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualClusterUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update_dns_servers": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualNetworkRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualNetworkRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadClassifiersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadClassifier", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_workload_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + } +} \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py index 791adee8ea39..9e14c1a5ea38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py index d0ba60ce7eb1..12ff054d36e8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py index b0ef4ad6a635..5955fb352087 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py index 1a0117389d91..4fdb375a6988 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py index 41ab912e67f6..c0101891a4d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py index a2ae8c43f5b4..4887fc865326 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py index 26fb5e5bcff4..3f754d4ea3a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py index 04cb08f8e76e..5a0c679ce067 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py index 5594595098c2..643a2f49c9a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/CancelDatabaseOperation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelDatabaseOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py index 6aa0732410d6..25927debd268 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelElasticPoolOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py index 8ad9c350eadb..42bc0e241b3a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py @@ -40,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py index 19a392bb13e7..b5f5fda54f39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelManagedInstanceOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py b/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py index 72167567fd8c..c04e805a55d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ChangeLongTermRetentionBackupAccessTier.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ChangeLongTermRetentionBackupAccessTier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py index 864dc7aa1207..2407f4e04316 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerAlreadyExists.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py index 70da6917a40d..32ffca67e681 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/CheckNameAvailabilityServerAvailable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerAvailable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py index 2859e100d078..239517aef24b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/CheckNameAvailabilityServerInvalid.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerInvalid.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py index e1ac702eaf19..6c5a2e4c7a7c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py @@ -40,6 +40,7 @@ def main(): column_name="myColumn", parameters={ "properties": { + "clientClassificationSource": "Native", "informationType": "PhoneNumber", "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py index e2b7125df46a..938b1aee2941 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py index 60c4a72b93ef..1ac64c2465c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py index d2699ecfe62e..75ca5a95a8b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnsListByDatabaseMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py index 7cc748a21a4c..2fb4b329c2ca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnsListByDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py index 5614b6719370..539384b02a80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py index a360ef91c475..792bca0aba56 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseCopyMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseCopyMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py index e95bf02f5a6e..cfab8b4787d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseDefaultEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py index 2278321c6f79..a07bd919b419 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.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/CreateDatabaseDefaultMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py index 9f6f7220ef6b..c6573fb098ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py new file mode 100644 index 000000000000..aaf7cf6acf6f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py @@ -0,0 +1,64 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.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.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {} + }, + }, + "location": "southeastasia", + "properties": { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "Default", + "encryptionProtector": "https://your-key-vault-name.vault.azure.net/yourKey", + "keys": { + "https://your-key-vault-name.vault.azure.net/yourKey": {}, + "https://your-key-vault-name.vault.azure.net/yourKey2": {}, + }, + "maxSizeBytes": 1073741824, + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultModeWithVersionlessKeysAndVersionlessEncryptionProtector.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py index d4407f9c2ce1..10ae330e8631 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseLedger.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseLedger.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py index 1739a761cdb9..a5dfd710d9c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py index 5fec663c86a9..86c20f16c07c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py index 7de9c4feb2ed..210c15153346 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.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/CreateDatabaseNamedReplica.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseNamedReplica.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py index 730ba06e0516..f7318da41e81 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabasePITRMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabasePITRMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py index b28a160c75e7..ec8e635d0ace 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.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/CreateDatabaseSecondaryMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseSecondaryMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py index ed7b806890cc..099080c1a046 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.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/CreateDatabaseStandbyMode.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseStandbyMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py index 7fa358ea67a1..b3c5c18added 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseVBSEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py index ee1ac2f2e006..7f7baaf56d45 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDatabaseWithAvailabilityZone.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py new file mode 100644 index 000000000000..1d93caa83eeb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py @@ -0,0 +1,61 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 create_database_with_encryption_protector_auto_rotation.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.databases.begin_create_or_update( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/Default-SQL-SouthEastAsia/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi": {} + }, + }, + "location": "southeastasia", + "properties": { + "collation": "SQL_Latin1_General_CP1_CI_AS", + "createMode": "Default", + "encryptionProtector": "https://your-key-vault-name.vault.azure.net/yourKey/yourKeyVersion", + "encryptionProtectorAutoRotation": True, + "maxSizeBytes": 1073741824, + }, + "sku": {"name": "S0", "tier": "Standard"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseWithEncryptionProtectorAutoRotation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py index b10c2e643d65..76a4ed4e17e9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionPITR.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionPITR.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py index e1a97e872416..52cbea519655 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRecovery.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionRecovery.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py index d19571e8b205..abffe0c65ef3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateDwDatabaseCrossSubscriptionRestore.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py index 2952ffe7b57e..b3f29c82d826 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateElasticPoolWithAvailabilityZone.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateElasticPoolWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py index 75d227e6b2c0..d92404fb2f70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py index 0ad797435e38..7d8d7ee545d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/CreateManagedDatabaseLedger.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateManagedDatabaseLedger.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py index f43eceddbd0a..e1fdc46c809e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py index 98cffd87a431..8b5baafebb14 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateInstancePoolMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateInstancePoolMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py index 072ee5bed2ec..5db9278ad304 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateInstancePoolMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateInstancePoolMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py index 37f37ba277ca..0c266ac139fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py new file mode 100644 index 000000000000..7239a60c0ec8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 create_or_update_job_agent_with_identity.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.job_agents.begin_create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + }, + "location": "southeastasia", + "properties": { + "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1" + }, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgentWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py new file mode 100644 index 000000000000..26d828b9f3d3 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py @@ -0,0 +1,51 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 create_or_update_job_agent_with_sku.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.job_agents.begin_create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + parameters={ + "location": "southeastasia", + "properties": { + "databaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1" + }, + "sku": {"name": "JA400"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgentWithSku.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py index c2824c8ad589..144f9bdfce39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py index 42ff8b44119a..9ecff6f693e0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py index 473e5a694583..85d10db6b557 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py new file mode 100644 index 000000000000..de1cdaec3b76 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py @@ -0,0 +1,59 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 create_or_update_job_min.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.jobs.create_or_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + job_name="job1", + parameters={ + "description": "", + "id": "str", + "name": "str", + "schedule": { + "enabled": bool, + "endTime": "9999-12-31T03:59:59-08:00", + "interval": "str", + "startTime": "0001-01-01T16:00:00-08:00", + "type": "Once", + }, + "type": "str", + "version": 0, + }, + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py index 44a1d290bb3a..328d63a11906 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/CreateOrUpdateJobPrivateEndpoint.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py index a67def32a025..c7bed9231d36 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobStepMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py index 3399bd8ee67c..f1b91f0f9342 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py @@ -40,7 +40,6 @@ def main(): parameters={ "properties": { "action": {"value": "select 1"}, - "credential": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0", "targetGroup": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup0", } }, @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobStepMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py index 456d9a6cf259..62f32a26c4ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobTargetGroupMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py index 07e13637acfd..9622e5c5dfac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobTargetGroupMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py index 83c8ee379ad4..8c13253479de 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py @@ -42,6 +42,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateMaintenanceWindows.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py index 2468c56546a7..a9d6524e7c4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadClassifierMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py index 8646e029ad49..78a64eb33323 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadClassifierMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py index c3252f220c5b..1e0cab96af47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadGroupMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py index a980a2d11865..d8ff300de107 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadGroupMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py index 5b202589adce..32c15fc288f6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateVCoreDatabaseByServiceObjective.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py index 887681b22680..5f3c78df4a42 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/CreateVCoreDatabaseBySkuNameCapacity.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateVCoreDatabaseBySkuNameCapacity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py index 0cabf573bae6..4338de5a6fa8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py @@ -35,11 +35,12 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", parameters={"properties": {"dataMaskingState": "Enabled", "exemptPrincipals": "testuser;"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py index 4a6d76ba9388..080675e76795 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py @@ -35,11 +35,12 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", parameters={"properties": {"dataMaskingState": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py index 8f68212383e6..f419de64fe0d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py @@ -35,10 +35,11 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py index a4c82c46c0a7..67e0574331a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py @@ -35,6 +35,7 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", data_masking_rule_name="rule1", parameters={ "properties": { @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py index ed1b4f3a9f6e..f7068671643e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py @@ -35,6 +35,7 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", data_masking_rule_name="rule1", parameters={ "properties": { @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py index a467ab625d23..0addb3ac0d52 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py @@ -35,6 +35,7 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", data_masking_rule_name="rule1", parameters={ "properties": { @@ -50,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateNumber.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateNumber.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py index 2e7305aa24a9..4a8752210357 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py @@ -35,6 +35,7 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", data_masking_rule_name="rule1", parameters={ "properties": { @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateText.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateText.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py similarity index 90% rename from sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py index 7aba3aef2948..27f7eea3e6c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python data_masking_rule_list.py + python data_masking_rule_list_by_database.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, @@ -35,11 +35,12 @@ def main(): resource_group_name="sqlcrudtest-6852", server_name="sqlcrudtest-2080", database_name="sqlcrudtest-331", + data_masking_policy_name="Default", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py index 461efb4b1f80..bd895b76695b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataWarehouseRestorePointsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py index 1a3a9ece5b4e..65dfea720386 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DataWarehouseRestorePointsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataWarehouseRestorePointsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py index ee55a2bf8be5..78a296a992af 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py index 01586043ce03..0cc9a946e543 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py index bb1cfc0c311b..e936d509a839 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py index 6ac5b8bfb4d6..5dcd420a2a41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py index 22de1121b07c..e846ea54a141 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py index 7c9e5c365f96..a909d3ee4d6e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py index 887abf079231..f920f09a196b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py index 1e890a1fdcbd..5f8d150dbcf5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py index 23735b90287e..61786958244a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py index da5d4d53fd15..92362b3786b6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py index 3a5231272025..0bba129933b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py index 96de5e4bdb73..008784bac735 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAzureMonitorAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py index 3d695ff928bf..a37b36e90284 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py index e8b7d51a8ac7..04feea9a6569 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py index e7dcb84e2445..ce01d1119356 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py index 9cfb513efd91..f632898aa3cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseColumnGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py index 630a5db0f311..1ab1ee3fa104 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseColumnListByTable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py index 4fc7690e0d3a..4b5ee5528ff5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevalidate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseEncryptionProtectorRevalidate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py index a94ca33330ec..2396d43dec92 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/DatabaseEncryptionProtectorRevert.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseEncryptionProtectorRevert.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py index bbcb4462292a..a234ea489b03 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseExtendedAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py deleted file mode 100644 index 71672c41d213..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_list_with_filter.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 database_metrics_list_with_filter.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.databases.list_metrics( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - database_name="3481", - filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py index 1fd0d22aba35..bb417162066d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py index 099ea54a5009..d3748127adf2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py index cc21269ce128..a617f45661ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionListExpand.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionListExpand.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py index 56f591bffff6..b4e9a7e5c54a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py index a60a52bce31b..c4e8b091c4d4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py index 9aea0ff80a8e..881fa386e3c8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py index 58b1a91ff767..673a0e447a8a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py index a9a7ca46ea99..67d6dff2151d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsPost.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py index ca72a06cf2da..fb36a97d0c23 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSchemaGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py index 63884f7e6f1d..96b1b4b882f6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSchemaListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py index 18ac5535099f..070b36ecf38e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py @@ -35,7 +35,7 @@ def main(): resource_group_name="securityalert-4799", server_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", parameters={ "properties": { "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py index 5001395a51ba..30b0e45e2c2d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py @@ -35,12 +35,12 @@ def main(): resource_group_name="securityalert-4799", server_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", parameters={"properties": {"state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py index 9772ce9e1b60..e769b829003c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py @@ -35,11 +35,11 @@ def main(): resource_group_name="securityalert-6852", server_name="securityalert-2080", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py index c45d70e50e33..215bceaae731 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py index 843897e5e088..826412301918 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py index f2436f1c6fba..3517466acecd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py index b75c899f53a4..3aa64fa602b3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index 0eb8e8538cd2..7977422d1fc4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py index ea1f2f047ec9..edb8abff1a3d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py index b557eb124c27..9bb2f6eda378 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py index 76df9b8871f6..e18bab380d39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py index cec78fcb2cff..15a36404b464 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py index 0068cba22f8e..1b1d6cffe023 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py index af04cfaec03e..a5e86faf456a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index e84a3f19e2d7..9d0ebd9a22d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py index ac8b31a9e71b..2e2d8c01d298 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScan.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py index 9d140945cc29..ad7960e28389 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py index ac8b2d313553..7b6932a3e9c8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py index a9112d3a7f64..bb167473743b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py index 50ccd54fe107..d9769afed6d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseTableGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py index 51b0c5a57a2e..ddce9b9e3435 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseTableListBySchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py index 0319dcbfd973..16561122696d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py index 0f6996730f5e..7272c7af7572 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py index 13db446ede02..f3d32d2a4242 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py index 73b9834b4f2b..747d089e0a1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py index 6fa801dea4ad..340f497169a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py index 81f8a75652fb..3eeaf8d6b231 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py index 0196a1deb50a..357084d61faa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py index 7ccdc9328bbd..eaab234ea798 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py index 2e85a08094b4..2fb2880e22af 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py index d99f67b7867b..aa6c18f188ff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanExport.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py index 5c2d0f2ca829..e1b569d89437 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py index 95f36145fc27..46965b25fc52 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py index 09bdbcce03f1..e8af3fe4c4a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py index b3c024eb6510..ab1d4f3dccb6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/DeleteDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py index bd94a689a6d8..94620e563a9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/DeleteInstancePool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py index 6a250abaa0bc..f8913c103425 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py index 164644de7cca..072c73a274fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py index 576f9887e8c6..e8e59a0e503e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py index f116ac28be01..54ec50ffb70b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/DeleteJobPrivateEndpoint.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py index 4ba4f008ba58..24a1bd96f7ca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py index e240ea12fd81..31c3cdf63867 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobTargetGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py index fdc8e86b0474..8495808e150b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteWorkloadClassifier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py index 2c8f3635f984..a125477e22d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteWorkloadGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py index b996f92d7e9e..b5a87347483f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py index d87028a82fbf..8c0394be1045 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py index 4c1c967049d7..f92e8058fa94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py index cdc3b4c1def4..4a1533ee9e86 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerRecover.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/distributed_availability_groups_create_max.py index afd72b5f1554..b34b496f4d65 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py @@ -50,6 +50,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsCreateMax.json if __name__ == "__main__": main() 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_min.py index b7c67eed1ce3..c6450ffcad55 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_min.py @@ -47,6 +47,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsCreateMin.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 91c4f2e8e57e..2ee8e2bdf02c 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 @@ -38,6 +38,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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsDelete.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/distributed_availability_groups_failover.py index 7a3c9cbf1e2a..ba2b3e53fc76 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py @@ -40,6 +40,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsFailover.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 4e3e617e4863..a8847917f08f 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 adf01b5bbec7..02bb431c93d0 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsListByInstance.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/distributed_availability_groups_set_role.py index afb0eb28dff3..12f78dce2516 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py @@ -40,6 +40,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsSetRole.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 d5f3dfc3d622..663a9b43fbed 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 @@ -40,6 +40,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/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py index 9c57ac9084e1..156f2317f732 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py index 4b60c88dd804..73e0cf0ff410 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py new file mode 100644 index 000000000000..bac7668eaec0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py @@ -0,0 +1,53 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 elastic_pool_create_or_update_serverless_properties.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.elastic_pools.begin_create_or_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "location": "Japan East", + "properties": { + "autoPauseDelay": 60, + "minCapacity": 0.5, + "perDatabaseSettings": {"autoPauseDelay": 80, "maxCapacity": 2, "minCapacity": 0}, + }, + "sku": {"capacity": 2, "name": "GP_S_Gen5_2", "tier": "GeneralPurpose"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateServerlessProperties.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py index 08f45b3bf272..5d5a66420810 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py index 8844ee102083..7d9a69d44bf7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py index ecd174701476..63a72c072cc5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py deleted file mode 100644 index a40b712eee23..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_database_activity_list.py +++ /dev/null @@ -1,45 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 elastic_pool_database_activity_list.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="9d4e2ad0-e20b-4464-9219-353bded52513", - ) - - response = client.elastic_pool_database_activities.list_by_elastic_pool( - resource_group_name="sqlcrudtest-4673", - server_name="sqlcrudtest-603", - elastic_pool_name="7537", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py index d1efb3e59dd3..aba8e4ab4cf3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py index f49584586019..5b793a22653a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py index 715e7f746035..d58876610bd4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolGetWithPreferredEnclaveType.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGetWithPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py index c9c01a12df23..5ce84a1c1194 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py deleted file mode 100644 index 644b4901eff5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_list_with_filter.py +++ /dev/null @@ -1,46 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 elastic_pool_metrics_list_with_filter.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = SqlManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", - ) - - response = client.elastic_pools.list_metrics( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - elastic_pool_name="3481", - filter="name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json -if __name__ == "__main__": - main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py index a16ba9635630..81e196240a70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py index e6c6aa418c73..8ae60b6eba87 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py new file mode 100644 index 000000000000..59c926f8d36a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py @@ -0,0 +1,58 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 elastic_pool_update_min.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.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "autoPauseDelay": 0, + "availabilityZone": "str", + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + "zoneRedundant": bool, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateMin.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py index 0f48c9b8761f..8180be2538f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py new file mode 100644 index 000000000000..681ac1234f3c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 elastic_pool_update_serverless_properties.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.elastic_pools.begin_update( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + parameters={ + "properties": { + "autoPauseDelay": 60, + "minCapacity": 0.5, + "perDatabaseSettings": {"autoPauseDelay": 80, "maxCapacity": 2, "minCapacity": 0}, + }, + "sku": {"capacity": 2, "name": "GP_S_Gen5_2", "tier": "GeneralPurpose"}, + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateServerlessProperties.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py index e61f1e2c7792..fc629b4b5c64 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py index 2c0f83c1053f..ad54c3b6b8a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ElasticPoolUpdateWithVBSPreferredEnclaveType.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateWithVBSPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py index 8f98206bb5ff..814ae1d59230 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateKeyVault.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py new file mode 100644 index 000000000000..70aa2646255a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py @@ -0,0 +1,51 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 encryption_protector_create_or_update_key_vault_with_versionless_key.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.encryption_protectors.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + encryption_protector_name="current", + parameters={ + "properties": { + "autoRotationEnabled": False, + "serverKeyName": "someVault_someKey", + "serverKeyType": "AzureKeyVault", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateKeyVaultWithVersionlessKey.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py index ce3739784e9e..260fdd46cf12 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py index 02fa901f566d..e67506cd42b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py index 147725e669ab..a8d6ed811897 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python server_communication_link_list.py + python encryption_protector_get_with_versionless_key.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, @@ -31,14 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_communication_links.list_by_server( + response = client.encryption_protectors.get( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", + encryption_protector_name="current", ) - for item in response: - print(item) + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorGetWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py index c6ad629e33ae..338deecef5b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py index cbba73a58a39..313d1edf8e71 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorRevalidate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py index fd45e42f20b6..09fac71b97d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EndpointCertificatesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py index 025e04363765..6466eb57bb6c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EndpointCertificatesListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py index 361d470ba1f9..4584cd712f56 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ExportDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py new file mode 100644 index 000000000000..8d14375f3363 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 export_database_using_database_extensions.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="0ca8cd24-0b47-4ad5-bc7e-d70e35c44adf", + ) + + response = client.database_extensions.begin_create_or_update( + resource_group_name="rg_d1ef9eae-044d-4710-ba59-b82e84ad3157", + server_name="srv_9243d320-ac4e-4f97-8e06-b1167dae5f4c", + database_name="db_7fe424c8-23cf-4ac3-bdc3-e21f424bdb68", + extension_name="Export", + parameters={ + "properties": { + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "operationMode": "Export", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseUsingDatabaseExtensions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py new file mode 100644 index 000000000000..e85ed81e3125 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py @@ -0,0 +1,55 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 export_database_using_database_extensions_with_managed_identity.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="0ca8cd24-0b47-4ad5-bc7e-d70e35c44adf", + ) + + response = client.database_extensions.begin_create_or_update( + resource_group_name="rg_d1ef9eae-044d-4710-ba59-b82e84ad3157", + server_name="srv_9243d320-ac4e-4f97-8e06-b1167dae5f4c", + database_name="db_7fe424c8-23cf-4ac3-bdc3-e21f424bdb68", + extension_name="Export", + parameters={ + "properties": { + "administratorLogin": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "authenticationType": "ManagedIdentity", + "operationMode": "Export", + "storageKey": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "storageKeyType": "ManagedIdentity", + "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseUsingDatabaseExtensionsWithManagedIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py new file mode 100644 index 000000000000..23324b721cfb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py @@ -0,0 +1,51 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 export_database_with_managed_identity.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.databases.begin_export( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "authenticationType": "ManagedIdentity", + "storageKey": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "storageKeyType": "ManagedIdentity", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseWithManagedIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py index 3e03220a6d14..07681a1e3fcc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ExportDatabaseWithNetworkIsolation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py index 5c6cfe7b2328..6f01c70289ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py index 929baecbb6ed..ccf9652884fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py @@ -57,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py index c07e51bb85e2..08cbfc577e7b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py index 063b87c30288..7ceeae3146c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py index 3b74c2984d0f..0d9cded720b2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py index 4844e8a0c59a..10af521cfeeb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py index db776bf03847..df5018fdb561 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py index 3577b926a3e4..783fad25643a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/FailoverDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py index 857bf8704ad1..69fe0b46c98b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/FailoverElasticPool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverElasticPool.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 54db9ca1974f..9fab257bde09 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 @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 index df16232df257..a3639112631f 100644 --- 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 @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupCreateOrUpdateStandbySecondary.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 10577ce97461..b279a48c8c5d 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 @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 a02190009002..4ab908bff7b1 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 baee3caed2c5..d591d8da21d2 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 8c896e433859..79d286b7c741 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 72751e1ca51b..9b16cf6dc607 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 0d036f7b87d5..63053c767e3c 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 @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupTryPlannedBeforeForcedFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 154d44230a6c..69435c772528 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 @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py index 7ebeca17278f..2462755b32a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/FailoverGroupUpdateStandbySecondary.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 be7c84583ea3..266fa6964124 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 @@ -37,6 +37,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/SQL/stable/2025-01-01/examples/FailoverManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py index 4542dd1b222f..598ea00ba9c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py index 471d3d68d896..1ec41e71dfaa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py index af0dc0606980..7bce1c896468 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py index bca63a1a4485..635ade3599df 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py index a28847a147c7..f425b3492f18 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleReplace.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py index 508009d16b9a..9e9a591c27bb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py index c08ad34e381a..d163c36c7813 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py index 547debb1c16d..c8f5b84b0901 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py index 1767d6b8dbc7..b9ceeb6a790b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py @@ -31,7 +31,7 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.geo_backup_policies.list_by_database( + response = client.geo_backup_policies.list( resource_group_name="sqlcrudtest-4799", server_name="sqlcrudtest-5961", database_name="testdw", @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py index c432c86cf328..9cba9d2522f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDataWarehouseUserActivities.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py index a79d5832e6be..e68a85273e6e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py index 8a5f2909df25..ddc05024ff0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseUsages.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py index 1bfbbbefe7ab..c29d1d019ef6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetDatabaseWithAvailabilityZone.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py index 6dd2608a487c..b410efdd1d5b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetElasticPoolWithAvailabilityZone.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py new file mode 100644 index 000000000000..9b47f437a0d6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 get_elastic_pool_with_serverless_properties.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.elastic_pools.get( + resource_group_name="sqlcrudtest-2369", + server_name="sqlcrudtest-8069", + elastic_pool_name="sqlcrudtest-8102", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithServerlessProperties.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py index c85a9e4d128a..494c5c599706 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetInstancePool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py new file mode 100644 index 000000000000..577e6c27295e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 get_instance_pool_operation.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.instance_pool_operations.get( + resource_group_name="resource-group", + instance_pool_name="test-instance-pool", + operation_id="c218773b-203f-4c7a-b174-6bd71fe20f72", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetInstancePoolOperation.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py index f488e5284114..5a9dcf38c5fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py index 98f05593eaee..dc182e27d1ff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py index 2047cd06a548..f3b2242d9ac2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py index 15d53776ee0d..729bc29790a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py index 0beeea101c48..d6c2492d1c47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecutionStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py index 3887418d1329..6c971082f949 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecutionTarget.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py index 3d1c97d322b5..aa060bb87fcb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/GetJobPrivateEndpoint.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py index adad6725650d..ed95acc80fb6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobStepByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py index 56fdf4d8fcb5..f870e790cd2f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobStepByVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py index 5f3ce119b4e4..daaff152c7b6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobTargetGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py index 0e3c718a736c..b2a0fd11bf32 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py index 8534da39a20d..f6ca3c8c15d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetListManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py index 3799afc9a677..0c7ea9448957 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py index 87a0fe307146..e32c51919bdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetMaintenanceWindowOptions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py index dc3072cfd2b3..2212c9513222 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetMaintenanceWindows.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py index c2212c116de7..e24ef093b5e3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedInstanceOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py index 16d3c8e0525b..aa1d48e2afd0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py index f8b87ba9d5a9..7ccb89e6d649 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py index c67aefd63248..3bfec38901d4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRecoverableManagedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py index 5a35f36fd021..7314215e3eaf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py index 2484cd2b03dd..8a2bd735565f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py index 661c3b257304..95f39dd280ff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedManagedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py index 97effda95bbe..55f402bec959 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py index e11c2cd13430..8754756e2c69 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py index ed3e9bb646f6..769fcf71179f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseDefaultEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py index 9ded92f389b2..4ad01341d570 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseVBSEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py index 627dd5f578c4..a4faa0a24d07 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/GetVCoreDatabaseWithExpandEqualsKeys.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py new file mode 100644 index 000000000000..b0be4aa03bb2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 get_vcore_database_with_expand_equals_keys_with_versionless_keys.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.databases.get( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseWithExpandEqualsKeysWithVersionlessKeys.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py index ccd7d7ff56f5..267d206fa854 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadClassifier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py index 1a32f1b30c3d..6c6142a60fe2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadClassifierList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py index 44f84c19dd6a..54451e5b706b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py index f6fcdd53ce65..4737ebf33877 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py index 82f1bbc11c08..25a6051dec7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py index 7f577a2d333f..a5d68308dcb0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py index 29785bfaa01d..21b712b298a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py index 2af80c1bed93..952bc4d4b5ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ImportDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py new file mode 100644 index 000000000000..b640426a71f2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py @@ -0,0 +1,56 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 import_database_using_database_extensions.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="17ca4d13-bf7d-4c33-a60e-b87a2820a325", + ) + + response = client.database_extensions.begin_create_or_update( + resource_group_name="rg_062866bf-c4f4-41f9-abf0-b59132ca7924", + server_name="srv_2d6be2d2-26c8-4930-8fb6-82a5e95e0e82", + database_name="db_2a47e946-e414-4c00-94ac-ed886bb78302", + extension_name="Import", + parameters={ + "properties": { + "administratorLogin": "login", + "administratorLoginPassword": "password", + "authenticationType": "Sql", + "operationMode": "Import", + "storageKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", + "storageKeyType": "StorageAccessKey", + "storageUri": "https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml", + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseUsingDatabaseExtensions.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py new file mode 100644 index 000000000000..4cf9c71108df --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py @@ -0,0 +1,51 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 import_database_with_managed_identity.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.databases.begin_import_method( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + database_name="testdb", + parameters={ + "administratorLogin": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "authenticationType": "ManagedIdentity", + "storageKey": "/subscriptions/00000000-1111-2222-3333-444444444444/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName", + "storageKeyType": "ManagedIdentity", + "storageUri": "https://test.blob.core.windows.net/test.bacpac", + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseWithManagedIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py index a4719f0e5466..beaa302b2971 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ImportDatabaseWithNetworkIsolation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py index 076aefe40493..62afcf3c3f49 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ImportNewDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py index bdb7d5e4d8e4..23071d3c512f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ImportNewDatabaseWithManagedIdentity.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabaseWithManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py index 5f7906b80f51..a5d3717d1c08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py index c97e416b889b..6466a4b62790 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InaccessibleManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py index bbf8c88550e6..7d6eb9816546 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py index 4cf1cc7fe784..43025fea6b77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py index b19706cacb02..2973e56cec97 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py index 7f98463ad510..10841706ba11 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_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-05-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py index 4250fef21f13..05785ba81deb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py index d13015e81508..c1b83fc0fe8c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/InstanceFailoverGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py index 484f297756ce..de8a6d977647 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py index 104efb97ea6e..b8c6bf3f7e55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py index a5d7063c5402..465968c1535b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py index ac97fce384cb..47c7e1f583d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py index 9cfa46cfdf12..86261d98a90e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/IPv6FirewallRuleUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py index 199b305ff4e6..8142ef3108c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py index 93cc125ca515..2eeb7383c648 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py index c0bdc9097245..39b5046019ce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py index 755d67111002..24a9768a369d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py index 375090374186..f16a06184b34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDataWarehouseUserActivities.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py index a2897141006e..f37c051560ca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py index cbc750639421..79f6eb620720 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py @@ -32,7 +32,7 @@ def main(): ) response = client.database_operations.list_by_database( - resource_group_name="Default-SQL-SouthEastAsia", + resource_group_name="sqlcrudtestgroup", server_name="testsvr", database_name="testdb", ) @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ListDatabaseOperations.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabaseOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py index 1ee043f82ce6..729478eb9d04 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py @@ -32,7 +32,7 @@ def main(): ) response = client.databases.list_by_elastic_pool( - resource_group_name="Default-SQL-SouthEastAsia", + resource_group_name="sqlcrudtestgroup", server_name="testsvr", elastic_pool_name="pool1", ) @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListDatabasesByElasticPool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabasesByElasticPool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py index 3c7af0062ecb..aff1827be35a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListElasticPoolOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py index 7188cf23a304..410422f625a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python service_objective_list.py + python list_instance_pool_operations.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, @@ -31,14 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.service_objectives.list_by_server( - resource_group_name="group1", - server_name="sqlcrudtest", + response = client.instance_pool_operations.list_by_instance_pool( + resource_group_name="resource-group", + instance_pool_name="test-instance-pool", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py new file mode 100644 index 000000000000..f0dbdb76c164 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 list_instance_pool_operations_empty.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.instance_pool_operations.list_by_instance_pool( + resource_group_name="resource-group", + instance_pool_name="test-instance-pool", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolOperationsEmpty.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py index 91b8e8f71756..e295c72d2d80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsage.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolUsage.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py index 13c28ac488dc..dfb77479dd46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolUsageExpanded.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py index f9a2aff8d70a..d6e4d3bc7f89 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.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/ListInstancePoolsByResourceGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolsByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py index bab058f3352e..dce7b5c46e40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListInstancePoolsBySubscriptionId.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolsBySubscriptionId.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py index 808a40456003..c9684d4654d0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobAgentsByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py index 29739a91f50d..4fdc5e08e6d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobCredentialsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py index 254d6dd79ccc..6af754cc73a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionSteps.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py index 5aacb01fdb2e..5e918ec53d3f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionTargetsByExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py index 3232ea32143f..5d0e4d50ad25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py @@ -43,6 +43,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionTargetsByStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py index e4dff8b0c502..80d5cd1e3d4d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py index 98bc94520758..54d542546a2b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByAgentWithFilter.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py index 3662600c0cdb..7ec2a94c97be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py index d96a71033c67..a19664e79185 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ListJobPrivateEndpointsByAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobPrivateEndpointsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py index 20ff382cc411..4b8319c00cea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobStepsByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py index 03c44d3acc04..bc567b2856a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobStepsByVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py index 4c72dad751b4..7e3832cbd438 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobTargetGroups.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py index fe2d5048acfa..cd9cf4f1a99d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobVersions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py index 1b8a491769ef..daee34f8220c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py index 686cc8c2ce9e..a9001786cc05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListManagedInstanceOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py new file mode 100644 index 000000000000..80a40146126e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py @@ -0,0 +1,41 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 list_operations.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="SUBSCRIPTION_ID", + ) + + response = client.operations.list() + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListOperations.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 c770cee183e3..9345ceb12d7a 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/examples/ListOutboundNetworkDependenciesByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py index b5dde3942442..a3f35485b781 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListRecoverableManagedDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py index 28c216a13cec..e441a284cb18 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ListRestorableDroppedDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListRestorableDroppedDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py index 58a5310e7c85..5b121bc07f07 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListServerOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py index 1d1f49e5a40a..b8e69660f174 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListShortTermRetentionPoliciesByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py index ba51eae32583..45ad9f0de003 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py index 818a17715e20..2aeafe2f0760 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreDatabasesEnclaveTypeByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreDatabasesEnclaveTypeByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py index 4fe507f460c9..8214c976eb03 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreInaccessibleDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py index ba88682bd935..6f68f717818f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LocationCapabilityListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py index 229d09d8977a..d8e976621a03 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LockTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LockTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py index 4ce55a3b4031..b27f29fd2e91 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupCopy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupCopy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py index d7bfd7f6581e..a65a3afc8421 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py index 2ae282a6d90b..0896cacec82b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py index 946dcb1429e9..877bb5af8cbc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py index 621308087284..3e1ed0520912 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py index 8566ee33fc40..bf1f3feb880c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py index a1c724a0ba7d..6b3d3e4166c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionBackupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py index faf48a5771cf..8571f48fe62d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py index f3e0b091a227..71392ff30ea1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionPolicyGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py index cc76b1253a7a..dab8e9534455 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py index 5ab0e4039ea3..7c665ca91dc1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedColumnsListByDatabaseMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py index 66eb541a40a7..1b03e192bd88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedColumnsListByDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py index 954e826dc5a5..052f74aaa39e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py index 4dfe8b344dc7..d73bdd450a67 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py index 30df2ef367a7..c7190b29d3d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py index cd368c22ec90..0862d789e600 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py index f03e01162c02..729f5b4fc7f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py @@ -41,6 +41,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCancelMove.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCancelMove.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py index 3cb120cc90af..f4ce12235156 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py index 4eb3bb234e9e..4597a89bbca0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnListByTable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py index 644186152a32..e2fc8f690f01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py @@ -40,6 +40,7 @@ def main(): column_name="myColumn", parameters={ "properties": { + "clientClassificationSource": "Native", "informationType": "PhoneNumber", "informationTypeId": "d22fa6e9-5ee4-3bde-4c2b-a409604c4646", "labelId": "bf91e08c-f4f0-478a-b016-25164b2a65ff", @@ -51,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py index d05e2362f992..7c7530ba0423 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py index fe76c7cc88c2..14ed1dffa3f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py index 158dd985a2ad..215047c617c9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCompleteExternalRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py index a5b7ecefe6a8..fa4ec72f93d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py @@ -41,6 +41,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCompleteMove.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCompleteMove.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py index 4978af86154b..506d9da441a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py index 391e0a10d0b1..dc94af96f5ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py index 8ba446ee9b32..07b02beb7e33 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py index ddcfbe5c5f2d..fc39dcd699cd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreatePointInTimeRestore.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreatePointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py index 608245363417..b407f0abefb8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRecovery.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRecovery.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py index 883ca3e47bca..9ffd0100e8d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreExternalBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py index 21d2feafd019..ecfc1d240773 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py index 96d61f0268f7..a169e75207aa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseCreateRestoreLtrBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreLtrBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py index 4d1c7b64cb56..e273db8c9a20 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py index 6114bf045578..1bbe9a99281b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py index c6f0e79963ba..7009c7f07cf1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseListByManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py index 5f85ac3399f0..c333636472f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py index 8798b84e88ed..2e67ee9341c2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py index 458cd5db5225..dafa8c09efe9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListLastOperations.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultListLastOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py index 716a7ae2dad5..8d94fa525c8c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseMoveOperationResultListMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultListMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py index f6f8f981b065..fa7e7dcdef75 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py index 07e8e77854e8..f07c5dd51263 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py new file mode 100644 index 000000000000..3a9064519d93 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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_database_reevaluate_inaccessible_database_state.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_databases.begin_reevaluate_inaccessible_database_state( + resource_group_name="Test1", + managed_instance_name="managedInstance", + database_name="managedDatabase", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseReevaluateInaccessibleDatabaseState.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py index 1a426155c29e..cf09445c460b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedDatabaseRestoreDetails.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRestoreDetails.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py index 7053b4db7175..418a13882981 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSchemaGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py index 29e1c54f7bc0..1114ad5ad1ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSchemaListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py index 279fd5976d65..78f7596a01a0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py @@ -35,7 +35,7 @@ def main(): resource_group_name="securityalert-4799", managed_instance_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", parameters={ "properties": { "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py index c9f9cf806564..3fa2e45d892d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py @@ -35,12 +35,12 @@ def main(): resource_group_name="securityalert-4799", managed_instance_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", parameters={"properties": {"state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py index 7d912db218d1..98458e0b22b7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py @@ -35,11 +35,11 @@ def main(): resource_group_name="securityalert-6852", managed_instance_name="securityalert-2080", database_name="testdb", - security_alert_policy_name="Default", + security_alert_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py index e0ca8da5bd48..6117a368ffdf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py index 645defb7df76..cc510630f93d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityEventsGetMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py index 3da7ff513de8..ea2357d90353 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityEventsGetMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py index 469bdcbf3bdf..f9092f2c52c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py @@ -75,6 +75,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py index a285260d5882..1549b4f7a79b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_metrics_definitions_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python elastic_pool_metrics_definitions_list.py + python managed_database_sensitivity_labels_list_by_database.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, @@ -31,15 +31,15 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.elastic_pools.list_metric_definitions( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - elastic_pool_name="3481", + response = client.managed_database_sensitivity_labels.list_by_database( + resource_group_name="myRG", + managed_instance_name="myManagedInstanceName", + database_name="myDatabase", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py index 85493f7c5a0f..e0b4302f4c3c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py index dadd0d08c62b..1a48482d1cd8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py index de7084e18371..2b91bb91c846 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py @@ -45,6 +45,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py index 3cb893ef0f6f..82025217723a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseStartMoveMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py index eb98741bc7b2..3d810ea8b6ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py @@ -41,6 +41,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseStartMoveMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseStartMoveMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py index 00ec94420dfa..79b741db61dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseTableGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py index 4f777e57d589..2d20fbe8e17d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseTableListBySchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py index cc93ae56ac60..d374a0a51b9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py index 9ccbf3e93136..9baa4fa695c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedDatabaseUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py index 8b872a7846c2..3790410f0d47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py index 57c961dbd8de..9b73b3d8375e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py index 90223e5fe93f..859bd50cf83c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py index f7e859fd5058..826e34860fc1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py index fd8b06ca2683..7eab08d74d09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py index 496adf5b2d8b..db8689c63c55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py index f5903db08590..35c7503456cb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py index 8b39a97fb085..03d9bf5ebc57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py index 5030894326f7..ec00baa73cb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py index e281b7aa276b..48cb92b1b282 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py index 768894c75cce..704f26ff9e53 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py index 32c1a008d8ad..31e07a4f93d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py new file mode 100644 index 000000000000..386a86990de7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py @@ -0,0 +1,43 @@ +# pylint: disable=line-too-long,useless-suppression +# 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_instanc_validate_azure_key_vault_encryption_key.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", + ) + + client.managed_instances.begin_validate_azure_key_vault_encryption_key( + resource_group_name="testrg", + managed_instance_name="testinstance", + parameters={"tdeKeyUri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"}, + ).result() + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancValidateAzureKeyVaultEncryptionKey.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py index e1b759595f8e..5326fc416e2b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py index e5b32e3b7575..c30ebfa19ac5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py index 605eb192dced..50aedf19ca5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py index a5f92249c08a..668ac24ed837 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py index 26ffcfb57efa..e25dbae77faa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py index cd584af95a5a..3f32e4acc1a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py index 369deb823efc..a9b2e1878b0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py index eaea7ee85adb..7d042213a875 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_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/ManagedInstanceAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py index 001a99d2cc8c..3492f45b52b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.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/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py index ec56b20bde22..06428606fa65 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py index 9ae5e033c081..3a0c99ac1cad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py index 1e444a6a5616..fec0f76b4817 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py index a4ef75fd6099..a61139957d36 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthListByInstance.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 712129b1310a..466b2ba25278 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 @@ -46,6 +46,7 @@ def main(): "sid": "00000011-1111-2222-2222-123456789111", "tenantId": "00000011-1111-2222-2222-123456789111", }, + "authenticationMetadata": "AzureAD", "collation": "SQL_Latin1_General_CP1_CI_AS", "databaseFormat": "AlwaysUpToDate", "dnsZonePartner": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance", @@ -57,6 +58,7 @@ def main(): "proxyOverride": "Redirect", "publicDataEndpointEnabled": False, "requestedBackupStorageRedundancy": "Geo", + "requestedLogicalAvailabilityZone": "1", "servicePrincipal": {"type": "SystemAssigned"}, "storageSizeInGB": 1024, "subnetId": "/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", @@ -70,6 +72,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/SQL/stable/2025-01-01/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 f991f27a7622..98153e1246c1 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 @@ -50,6 +50,6 @@ def main(): 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/SQL/stable/2025-01-01/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 12e5efbc3410..e5ce5874c697 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 @@ -37,6 +37,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/SQL/stable/2025-01-01/examples/ManagedInstanceDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py index 8027409deced..7895321a0891 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py index fa3341d57292..1a13418150ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py index 1361d537e6ce..1707f4d5990f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateEnableDtc.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcUpdateEnableDtc.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py index d47c69875dfa..6f5baefa296e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/ManagedInstanceDtcUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py index 81e7a1bf8235..ac6092a66b29 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py index 0387a68d82c3..0cc07c5426f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py index 4c49f267e4b0..4b065b37dd3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py index 00c9f76f1c50..8a71de05f06c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py index 1c2e287ed2f7..6a754951e1c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorRevalidate.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 e7e522eb7796..769f6c614323 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 @@ -38,6 +38,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/SQL/stable/2025-01-01/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 index fa187f26ac06..f8cb520e835f 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceGetWhileUpdating.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 0dbbca011961..7d1e2e12f7e8 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 @@ -38,6 +38,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/SQL/stable/2025-01-01/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py index 6bcab42c8ec4..3fe90dd106a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py index 522d510a988e..34867c71b596 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py index d1fab5e4058c..a16cc7ede8d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py index 11bf61d166bd..e1abc78072de 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyList.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 86d4f0a55a61..466b32ce2a13 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 @@ -36,6 +36,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/SQL/stable/2025-01-01/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 ef5c862fcd74..3efe5fc9dc05 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 8a122415d93a..0762ff7ecf2f 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 9455050d1000..6ba0e3b0bbda 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 @@ -38,6 +38,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/SQL/stable/2025-01-01/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 2645f596ffe4..c636c7945d6b 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 @@ -38,6 +38,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/SQL/stable/2025-01-01/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 79762a547595..f052075da9e9 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 @@ -36,6 +36,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/SQL/stable/2025-01-01/examples/ManagedInstanceListWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py index db63ebd088ff..a62ea3c7fc34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py @@ -35,10 +35,10 @@ def main(): location_name="japaneast", managed_instance_name="testInstance", database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000;Hot", ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py index 2b8288fd30a0..68db848eeb91 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py @@ -35,11 +35,11 @@ def main(): location_name="japaneast", managed_instance_name="testInstance", database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000;Archive", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py index 4764bc825aa7..7eb2de8d0a75 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py index 78cb545388f8..b34a2e0a1f1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py index dc1d35ae180f..bfe34d2f4248 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py index b90eecf5235c..4af0de53c44e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_metrics_definitions_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python database_metrics_definitions_list.py + python managed_instance_long_term_retention_backup_list_by_location_max.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, @@ -31,15 +31,13 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.databases.list_metric_definitions( - resource_group_name="sqlcrudtest-6730", - server_name="sqlcrudtest-9007", - database_name="3481", + response = client.long_term_retention_managed_instance_backups.list_by_location( + location_name="japaneast", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByLocationMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py index 28710b4480db..946832d58757 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py @@ -38,6 +38,7 @@ def main(): policy_name="default", parameters={ "properties": { + "backupStorageAccessTier": "Hot", "monthlyRetention": "P1Y", "weekOfYear": 5, "weeklyRetention": "P1M", @@ -48,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py new file mode 100644 index 000000000000..e431573ea189 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +# 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_long_term_retention_policy_delete.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_instance_long_term_retention_policies.begin_delete( + resource_group_name="testResourceGroup", + managed_instance_name="testInstance", + database_name="testDatabase", + policy_name="default", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyDelete.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py index b5d6325ab984..57e3f37e3adf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py index eb93103bee01..51110ca03f02 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py index 0df3c50c0767..65aef39bd65c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py index ae29e204df6f..358f2a9a1177 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py index 06d1f9405c22..dc01de16389f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py index e65363f37d00..b8fde645ca5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py index 605031ad7f25..8055dbc7f9f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py index 71976dcd7604..de5129b4867e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py index 04935ad2e2e9..add24eb69e1c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py index 2397f502d9c1..6bfc292afcb0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py index 18b9c2ff16e1..5f5e96d7fd08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsListMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py index 8219c6f9c101..1c914808370c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsListMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsListMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py new file mode 100644 index 000000000000..367004897b5a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py @@ -0,0 +1,42 @@ +# pylint: disable=line-too-long,useless-suppression +# 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_reevaluate_inaccessible_database_state.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", + ) + + client.managed_instances.begin_reevaluate_inaccessible_database_state( + resource_group_name="testrg", + managed_instance_name="testinstance", + ).result() + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceReevaluateInaccessibleDatabaseState.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 index 956c4be19714..eacf2b15b01d 100644 --- 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 @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ManagedInstanceRefreshExternalGovernanceStatus.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 e0eafd95fb4f..e047d9b6cc73 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 @@ -43,6 +43,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/ManagedInstanceRemoveMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py index 1658f06dc6ab..344961f31374 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTdeCertificate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py index 6cac37e53e67..436bf7ceefb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTimeZoneGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py index 89e81b3367a3..a206ebb0b3c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTimeZoneListByLocation.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 25073abc64b2..2e271a576054 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 d7679e15e05b..008ecd8dbe7a 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 550cb7a303f6..2047f909ae27 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/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 bbe59b545c84..95fd98556643 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 @@ -48,6 +48,7 @@ def main(): "proxyOverride": "Redirect", "publicDataEndpointEnabled": False, "requestedBackupStorageRedundancy": "Geo", + "requestedLogicalAvailabilityZone": "1", "storageSizeInGB": 448, "vCores": 8, }, @@ -58,6 +59,6 @@ def main(): 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/SQL/stable/2025-01-01/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 f6cd0563681c..0ed032755f76 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 @@ -39,6 +39,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/SQL/stable/2025-01-01/examples/ManagedInstanceUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py index 0d4fd56c6fa8..b4c3b32463a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py index 89d9b42a043b..aa1f0e67bcc9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py index 974c2270e8a2..8bd5152b6af7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py index ebc895a24ffc..e1bc423218f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py index df7724b49614..8d8f7e47aacf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py index dc5ff6cd320e..2140aba0e673 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py index 2ccd188acee4..24633e58d794 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsDisable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py index 904691ae041e..8918fbade384 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsEnable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py index 099b114f21fa..3de7de741506 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py index 48365a7f6e53..446af77afc81 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ManagedLedgerDigestUploadsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py index 30341c9197b1..046ecb1aca7b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasAcquire.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasAcquire.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py new file mode 100644 index 000000000000..5fb35c2690f8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +# 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_server_dns_alias_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, + 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_server_dns_aliases.begin_create_or_update( + resource_group_name="Default", + managed_instance_name="dns-mi", + dns_alias_name="dns-alias-mi", + parameters={"createDnsRecord": True}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasCreateOrUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py index 2560cf08a721..e894f0135041 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py index 6587a52e7dea..9b6cd180ecb3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py index ab7eaa5b4527..84952d7fa17d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ManagedServerDnsAliasList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py index 309be7e9bb63..adb67d231f77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py index aa0e0a4cea85..58693528b585 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py index e9005141849d..8c150339b14b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py index 7d826d6ec9bb..837a5ad6fc9f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py index 6fb80e8ae590..6772bc7e3812 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py index 332a408993a1..28cb74771b67 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py index 977413f9c1a3..e782f86e793c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py new file mode 100644 index 000000000000..101ea7e204a8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 network_security_perimeter_configurations_get.py + + Before run the sample, please set the values of the client ID, tenant ID and client secret + of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, + AZURE_CLIENT_SECRET. For more info about how to get the value, please see: + https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal +""" + + +def main(): + client = SqlManagementClient( + credential=DefaultAzureCredential(), + subscription_id="00000000-1111-2222-3333-444444444444", + ) + + response = client.network_security_perimeter_configurations.get( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-7398", + nsp_config_name="00000001-2222-3333-4444-111144444444.assoc1", + ) + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsGet.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py index 7aa1b4bd5110..d818176231dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_activity_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python elastic_pool_activity_list.py + python network_security_perimeter_configurations_list_by_server.py Before run the sample, please set the values of the client ID, tenant ID and client secret of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, @@ -31,15 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.elastic_pool_activities.list_by_elastic_pool( - resource_group_name="sqlcrudtest-4291", - server_name="sqlcrudtest-6574", - elastic_pool_name="8749", + response = client.network_security_perimeter_configurations.list_by_server( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-7398", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py rename to sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py index 608a6aad2b25..9497aa301739 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python server_communication_link_create_or_update.py + python network_security_perimeter_configurations_reconcile.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, @@ -31,15 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_communication_links.begin_create_or_update( + response = client.network_security_perimeter_configurations.begin_reconcile( resource_group_name="sqlcrudtest-7398", - server_name="sqlcrudtest-4645", - communication_link_name="link1", - parameters={"properties": {"partnerServer": "sqldcrudtest-test"}}, + server_name="sqlcrudtest-7398", + nsp_config_name="00000001-2222-3333-4444-111144444444.assoc1", ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsReconcile.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py rename to sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py index 3f7ae29165f2..546c847596fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python server_communication_link_delete.py + python outbound_firewall_rule_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, @@ -31,13 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - client.server_communication_links.delete( + response = client.outbound_firewall_rules.begin_create_or_update( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", - communication_link_name="link1", - ) + outbound_rule_fqdn="server.database.windows.net", + ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py index bcfb83ee5e08..03cf6936a63f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py index 4b38b5ec3fa3..afe8f2e4a04b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py index 69c69c94b8a6..741f5feb3502 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py index 689058242d77..4f541b3a6964 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchDatabaseDefaultEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py index 71e5fbad0a19..03b1a5058a34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchDatabaseVBSEnclave.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py index c6fcb23619aa..80666ffe1d3d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/PatchInstancePool.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py index 3a97cdfc4ce5..75ce9fe4c9a9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py index 570ff1d49a64..babccd48d3d0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py index 69ed59856a1e..65e00da71bd6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py index 39443333fd61..0c01e0c83843 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py index 1cda04b7b17b..c133772b3b94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/PauseDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PauseDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py index 6d20e9a43e8d..2634508eef07 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py index 1837fde62b26..6734ea54a480 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py index 507ebf609872..ed9d0916d9f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py index 3179618e59c7..620958a51e9e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/PrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py index 0c2a4fb459e3..b5d4ffcfc7e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py index fb05b20ea2d4..8f61dc062094 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py index 2c0750c2126a..303c42457ad1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecommendedColumnSensitivityLabelDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py index be8742477051..94609a201acc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecommendedColumnSensitivityLabelEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py index 6143d2f349e0..f887595f9df4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py index 8cf44e9ca8f9..f64ff51641dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseGetWithExpandEqualsKeys.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseGetWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py index 6be7dfe7e2ad..780eda1d829a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/RecoverableDatabaseList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py index 21a6a8e0f015..30f2e1dd7870 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/RefreshExternalGovernanceStatus.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RefreshExternalGovernanceStatus.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py index 485349d78266..e09c52379f5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/RemoveLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RemoveLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py index 6315e30ff213..17b473d42670 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/RemoveTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RemoveTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py index f2d0e97a18a9..2b769c4b01a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/RenameDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RenameDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py index 302687c97e8e..507013660853 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 f80115b46d6e..004dbe804077 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 @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 9ed800d1b3fa..8f94a1b2e943 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 9e1b89781e53..16436ded25ea 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 f5f20c3020d5..3d5d61592b1f 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 @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 ef91ddff7741..76e16b72725a 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 @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/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 94b57649017e..e642a5402e94 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 @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py index 4d07b8161eb4..557046c84065 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-05-01-preview/examples/ReplicationLinkUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py index b142e5ee433c..3212a481b701 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedChangeLongTermRetentionBackupAccessTier.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedChangeLongTermRetentionBackupAccessTier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py index 8508b10c5a2b..42de21cb9122 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLockTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLockTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py index 7378eca9b04c..2eb1f452e993 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py index d9eb4e7f91c8..0309fbe3db3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py index cebf8c260720..67c9daef490c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py index 1f02c72e5568..6f71ed28baaa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py index eeaf35311ca0..bdd3a61d5701 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py index 4a8e4059e86e..81ed5383c068 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py index 1187df030115..fb51e4ac9ad3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py index 385b30e3dc19..999518b9f68a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py @@ -36,10 +36,10 @@ def main(): location_name="japaneast", managed_instance_name="testInstance", database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000;Archive", ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py index 8fd4dae8f049..ebcfbb0b1507 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py @@ -36,11 +36,11 @@ def main(): location_name="japaneast", managed_instance_name="testInstance", database_name="testDatabase", - backup_name="55555555-6666-7777-8888-999999999999;131637960820000000", + backup_name="55555555-6666-7777-8888-999999999999;131637960820000000;Archive", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py index ebb6fba6a51d..3c643f80bd9e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py index 3fc108a8b7e1..d718bdcac9ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py index d23278349508..67161200e3ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py new file mode 100644 index 000000000000..37fdb910c228 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.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.long_term_retention_managed_instance_backups.list_by_resource_group_location( + resource_group_name="testResourceGroup", + location_name="japaneast", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocationMax.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py index 4d3bfb985ef7..0b2bcf99da21 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedRemoveLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedRemoveLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py index a67791d665a2..54d893eb4c93 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedRemoveTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedRemoveTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py index 3feca581c909..971331af84ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ResourceGroupBasedSetLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedSetLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py index 2e22af35bb96..02b7e148be35 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py index 739830dd4ab9..554db8b13b6a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/ResumeDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResumeDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py new file mode 100644 index 000000000000..16614334185a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 resume_transparent_data_encryption_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, + 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.transparent_data_encryptions.begin_resume( + resource_group_name="securitytde-42-rg", + server_name="securitytde-42", + database_name="testdb", + tde_name="current", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResumeTransparentDataEncryptionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py index 401e078e3bea..140e73cfbb65 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py @@ -77,6 +77,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsCurrentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py new file mode 100644 index 000000000000..d19d6fc64cac --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 sensitivity_labels_list_by_database.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.sensitivity_labels.list_by_database( + resource_group_name="myRG", + server_name="myServer", + database_name="myDatabase", + ) + for item in response: + print(item) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabase.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py index 53d35aed040a..fb5298703e20 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py index 7e6f07363522..84c45aea8e99 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py index 449963e79c62..adcfc995aac8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py @@ -45,6 +45,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsRecommendedUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py index b2a34d592b79..3045e68d1e2f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py index 12c7e8121718..eeacaccea22c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py index bdfb1e4afcc8..4eddc823ba12 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py index 5ba7b3d24d82..fd51e8db4211 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py index b08375ad081f..00f2fe417eff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py index bc7f0f348e48..e0c788632982 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py index b778addaa39b..bd56e7305286 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py index dad6ca4c8552..31823b585cd5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py index f6d687777b9c..e9fc348691ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py index b535eebad2a0..5a2e64266b94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py index 55d0e3a14d48..5cecc88b85c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py index aa7f906f20bf..e38a21d9cd41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py index b7bfc37d0dea..80039573d20d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py index 43e3e0e96e9a..99046ce13f6c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py index 5035e580ade1..80196f816cdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py index df4be4a2073d..356fc78398e9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py index 84683da826f1..70e8212892c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/ServerConfigurationOptionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py index 9b698143e685..8429587ff8b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py index 382c2c087db4..0617487a568c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py index 717001f69e78..7566b94776b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py index ba630bd34589..555e7f18ba0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -57,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py index 2d65553b5c9f..dd1fa9dd9ab9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py index cf5019dd64c3..3e0fcbfb07a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py index a26ccc8a7667..5a475597de90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-02-01-preview/examples/ServerDevOpsAuditCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py index 8b90e1faad87..112a3a45e7b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_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/ServerDevOpsAuditGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py index c6e974cf18f1..8509b04da4cc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.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/ServerDevOpsAuditList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py index e4017bc1546d..44311b7d5d0a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasAcquire.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py index 3470e4070290..3a16cf7f33dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py index c15492ca7da8..980d46b61cdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py index a56ebc40ffb6..6b332f8083d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py index fc08cca3bd89..55be60d86fe0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py index 59e425e9a958..06aecbb1ca5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerExtendedAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py index 2f9016e93ff2..8c10da0752c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py index 68807ca5258c..f0feedc69d9c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerGetWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerGetWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py index e18ae5088f41..f89328390645 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py new file mode 100644 index 000000000000..ca8c8b205f1f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py @@ -0,0 +1,47 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 server_key_create_or_update_with_versionless_key.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.server_keys.begin_create_or_update( + resource_group_name="sqlcrudtest-7398", + server_name="sqlcrudtest-4645", + key_name="someVault_someKey", + parameters={ + "properties": {"serverKeyType": "AzureKeyVault", "uri": "https://someVault.vault.azure.net/keys/someKey"} + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyCreateOrUpdateWithVersionlessKey.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py index dfd6709d69e1..6d0e584da7c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py index 27a1706095e1..e9f828b5f44c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py index a50d1ac72ba7..311ad2ade618 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_communication_link_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python server_communication_link_get.py + python server_key_get_with_versionless_key.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, @@ -31,14 +31,14 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.server_communication_links.get( + response = client.server_keys.get( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", - communication_link_name="link1", + key_name="someVault_someKey", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyGetWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py index ec15d350da6e..01cf173f74fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py index fb8948711bb9..784013a2d232 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py index 161c3fc936eb..bbe0925be269 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerListByResourceGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py index 8630a8dd9bf7..6170be5deffc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py index 3b9cca85c7f5..8cd1cd3aa203 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerListWithExpandEqualsAdministrators.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py index 598d893e4b6b..ae84c8a33ca2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerRecommendedActionListExpand.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerRecommendedActionListExpand.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py index a3dd9e30e0cb..2a99d89b2ef4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py index d2ae5f33ae87..81b749e921fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py index cb3fa3c9979a..05f36336f638 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py index 26b6490f58c2..9f6a3f7cc146 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py index 32410bed87d4..fe58d1f3672d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py index bf7d6113edc8..562635e8031d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py index c593dd2f64e5..66b0ac6f5cf5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py index d5d43da485e3..922f9d8ba59d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py index 8846a44f1feb..75e9949663a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py index 5d71ed79eb42..948fbdb9265c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py index 83a24522d42c..a176046311a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py index 7dafa8da2fdb..6b243ad2b7a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py index 7f140d70e268..cf5d97953c80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py index 8d3431a639d8..0b15fd4bc849 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/ServerUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py similarity index 93% rename from sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py rename to sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py index ba08dc783411..cd436e75cd93 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_metrics_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python server_usage_metrics_list.py + python server_usage_list.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, @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerUsageList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py index 08d439d994aa..9dc6efc9be57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py index 021ca20aff29..d6379fdd502c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py index fdd11a45fb82..1f0d9cc6458f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py index 257c697d5405..462aadec7503 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py index 06cb8d920e5b..5e8c9f5aa55e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py index 35180060caa5..6bcbf6ed0f19 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py index d710c47e3d1a..7b6f1c73a1be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2024-11-01-preview/examples/SetLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SetLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py index df6afcf72911..569c55a76c53 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlAgentConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py index d0b7e530ade6..82f7cd620918 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlAgentConfigurationPut.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py index bbc977c79f23..3d8a9a727211 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlTdeCertificateCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py index ac7708bc7c44..5b276febfd9b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineAdd.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py index 349c05c0a53f..e9ee38875763 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py index 9aa6b79a1d83..11447e8d2592 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index 9e6e5ffa12ef..b619139b299e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py index 1e4ce0d36a42..abcbff5dca20 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py index c169959c6b2e..64e9e329b810 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py index 64d6f029acc6..2fef93b36e0b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py index c6590b3a3c28..3d2c6ea57164 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py index cca08c7e9310..0128f2057ebe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py index 65339950d35d..1733b2dc5859 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py index e0b318aec5f1..15568c1a6129 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py @@ -40,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py index 6d62cba52224..f3337cfb2e16 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index eda5f2a7f4eb..bc9b9823790a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py index 2013c1e0490f..ca939a16f0ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScan.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py index 0fbf7b94bd19..3bb3ead802a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py index f49ac6c97de6..feaedcfbdf02 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py index b353528824dc..9bc1a292751a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-11-01-preview/examples/SqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScansResults.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 b2a4138b872d..648caf9dc21f 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 @@ -38,6 +38,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/StartManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py index 6ffda84b01eb..ce00eda23496 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMax.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py index 409aef2d3886..7f7bea3138df 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleCreateOrUpdateMin.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py index 0caeed29673d..5313e5ad47a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py index 27b9d0e0e240..4391b924abef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py index e681656c1e6a..e8a5920ed9ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/StartStopManagedInstanceScheduleList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleList.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 a1f6704a5fcb..c6a3f63d4ef0 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 @@ -38,6 +38,6 @@ def main(): 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/SQL/stable/2025-01-01/examples/StopManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py index 7f6ae9bc39dd..2e938be32a3c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SubscriptionUsageGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py index e9cb093c354f..e1ba1ec3cb70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SubscriptionUsageListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py new file mode 100644 index 000000000000..8ee96775033c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py @@ -0,0 +1,45 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 suspend_transparent_data_encryption_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, + 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.transparent_data_encryptions.begin_suspend( + resource_group_name="securitytde-42-rg", + server_name="securitytde-42", + database_name="testdb", + tde_name="current", + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SuspendTransparentDataEncryptionUpdate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py index ff818ca53e33..7bbc4d027f01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/SynapseLinkWorkspaceListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SynapseLinkWorkspaceListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py index dc6e6202d6ff..a347a70278a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py index 72833de2ff89..889e2f2c2ffe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py index 261ac60ccc34..15dba8102803 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py index 8e7b3ba86f3a..09cbb321449a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py index d030bbda983f..b7a295bfb173 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGetLinkedDatabases.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py index 248432dedef7..f9fc5816fc4c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py index 7fe22c3fff5c..9af72439794d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py index f310b79da3ac..ce6994403636 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupCancelSync.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py index 87d6d9b343ac..6dc36ea2aca6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py index e42baee5ffa7..9557beb15087 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py index 8739c08064ba..2a8c0e9a779c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py index b7b5318adccd..395405a80e8e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetHubSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py index 1d4be7791030..21b81e6a7f4a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py @@ -44,6 +44,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetLog.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py index adba896d2f18..e394f6feecd8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetSyncDatabaseId.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetSyncDatabaseId.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py index 5fd0b55249c0..0c71cca6ecb2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py index 8610bdc3b5e8..c58112feb577 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupPatch.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py index 5c09f1896f88..17be978204c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupRefreshHubSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py index c9670fbcf004..bda0dd7f65e4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupTriggerSync.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py index ca05f375c381..517ca2546b3e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py index d7b46798a800..8865bb1716d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py index 4ba770e721db..007d8bd27a2e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py index dc91e71e9e5a..dcf787dc0967 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py @@ -1,4 +1,3 @@ -# pylint: disable=line-too-long,useless-suppression # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py index 42b270342b3c..8102d7f339da 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberGetSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py index 5045b6be6ea0..a787d90598f3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberListBySyncGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py index 7c91763bb219..5049534601be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberPatch.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py index 3087e4b6cc25..39f6542a6018 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py @@ -40,6 +40,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberRefreshSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py index 1ff26e1ea328..d57b26bc8c30 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py index 5acf2f228c4b..f4273cba422a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py index 0368deea0614..fa4377ddba12 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py index 87b856e49e68..ca0051f96978 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py @@ -36,11 +36,11 @@ def main(): server_name="securitytde-42", database_name="testdb", tde_name="current", - parameters={"properties": {"state": "Enabled"}}, + parameters={"properties": {"scanState": "Suspend", "state": "Enabled"}}, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-08-01-preview/examples/TransparentDataEncryptionUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py index 5d8b545a7b4a..f8708ff0e7c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py index d99ff214ba8d..059b2052e699 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py index a6897b3167ce..52feb58d6127 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py new file mode 100644 index 000000000000..193c04a74483 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py @@ -0,0 +1,52 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 update_job_agent_with_identity.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.job_agents.begin_update( + resource_group_name="group1", + server_name="server1", + job_agent_name="agent1", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + } + }, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgentWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py rename to sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py index 498feb1ed805..8d63f4b1f797 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/service_objective_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py @@ -16,7 +16,7 @@ pip install azure-identity pip install azure-mgmt-sql # USAGE - python service_objective_get.py + python update_job_agent_with_sku.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, @@ -31,14 +31,15 @@ def main(): subscription_id="00000000-1111-2222-3333-444444444444", ) - response = client.service_objectives.get( + response = client.job_agents.begin_update( resource_group_name="group1", - server_name="sqlcrudtest", - service_objective_name="29dd7459-4a7c-4e56-be22-f0adda49440d", - ) + server_name="server1", + job_agent_name="agent1", + parameters={"sku": {"name": "JA200"}}, + ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgentWithSku.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py index f71cb3bfb4fd..dfc3702a8e05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py index f619452a846f..c7556c2eb873 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py index c21419c17e99..48d77c3db1c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py index 912370bd2768..1202003ce7be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/UpdateVirtualClusterDnsServers.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateVirtualClusterDnsServers.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py index 3bab6877c6a5..7c839e487840 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2023-02-01-preview/examples/UpgradeDataWarehouse.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpgradeDataWarehouse.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py new file mode 100644 index 000000000000..2c81842dd023 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py @@ -0,0 +1,44 @@ +# pylint: disable=line-too-long,useless-suppression +# 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 virtual_cluster_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, + 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.virtual_clusters.begin_create_or_update( + resource_group_name="testrg", + virtual_cluster_name="vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", + parameters={"location": "japaneast", "tags": {"key": "value"}}, + ).result() + print(response) + + +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterCreate.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py index 63e91bd9fd15..f775bb40bcd4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py @@ -28,7 +28,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="00000000-1111-2222-3333-444444444444", ) client.virtual_clusters.begin_delete( @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py index fe44d5ce3563..6531dcf4cf6d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py @@ -28,7 +28,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="00000000-1111-2222-3333-444444444444", ) response = client.virtual_clusters.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py index df05c3e5cd2d..a532343eaf93 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py @@ -28,7 +28,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="00000000-1111-2222-3333-444444444444b", ) response = client.virtual_clusters.list() @@ -36,6 +36,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py index aa8fae31b906..d9b82b88cfa7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py @@ -28,7 +28,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="00000000-1111-2222-3333-444444444444b", ) response = client.virtual_clusters.list_by_resource_group( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterListByResourceGroup.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py index b2836604b1c7..97861b51411b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py @@ -28,7 +28,7 @@ def main(): client = SqlManagementClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="00000000-1111-2222-3333-444444444444b", ) response = client.virtual_clusters.begin_update( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2022-05-01-preview/examples/VirtualClusterUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py index e8050533a084..cf448b924b15 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py index b57f7e299ac7..c56c1dc6a7fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py index eceabad0e356..f88454eb4167 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py index 5c519a46d1d7..ab9d8a5ee592 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json +# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py index ae214b8915f1..22e53017dd93 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementBackupShortTermRetentionPoliciesOperations(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_backup_short_term_retention_policies_get(self, resource_group): @@ -26,7 +39,7 @@ def test_backup_short_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +54,7 @@ def test_backup_short_term_retention_policies_begin_create_or_update(self, resou database_name="str", policy_name="str", parameters={"diffBackupIntervalInHours": 0, "id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -56,21 +69,8 @@ def test_backup_short_term_retention_policies_begin_update(self, resource_group) database_name="str", policy_name="str", parameters={"diffBackupIntervalInHours": 0, "id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2021-02-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py index 879946fb18f6..48761dc99421 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmt def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_backup_short_term_retention_policies_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_backup_short_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,7 +62,7 @@ async def test_backup_short_term_retention_policies_begin_create_or_update(self, "retentionDays": 0, "type": "str", }, - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -72,22 +85,9 @@ async def test_backup_short_term_retention_policies_begin_update(self, resource_ "retentionDays": 0, "type": "str", }, - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2021-02-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py index de068969cf9a..e7713c679950 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_capabilities_list_by_location(self, resource_group): response = self.client.capabilities.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py index 1198e207b8a3..be4691665ec1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_capabilities_list_by_location(self, resource_group): response = await self.client.capabilities.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py index 7e2dced7299e..c4a434848d19 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py @@ -18,6 +18,20 @@ class TestSqlManagementDataMaskingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_data_masking_policies_get(self, resource_group): + response = self.client.data_masking_policies.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + data_masking_policy_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_data_masking_policies_create_or_update(self, resource_group): @@ -25,6 +39,7 @@ def test_data_masking_policies_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", + data_masking_policy_name="str", parameters={ "applicationPrincipals": "str", "dataMaskingState": "str", @@ -36,22 +51,7 @@ def test_data_masking_policies_create_or_update(self, resource_group): "name": "str", "type": "str", }, - api_version="2014-04-01", - data_masking_policy_name="Default", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_data_masking_policies_get(self, resource_group): - response = self.client.data_masking_policies.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - data_masking_policy_name="Default", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py index a8d903618927..b635763e1c4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py @@ -19,6 +19,20 @@ class TestSqlManagementDataMaskingPoliciesOperationsAsync(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_data_masking_policies_get(self, resource_group): + response = await self.client.data_masking_policies.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + data_masking_policy_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_data_masking_policies_create_or_update(self, resource_group): @@ -26,6 +40,7 @@ async def test_data_masking_policies_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", + data_masking_policy_name="str", parameters={ "applicationPrincipals": "str", "dataMaskingState": "str", @@ -37,22 +52,7 @@ async def test_data_masking_policies_create_or_update(self, resource_group): "name": "str", "type": "str", }, - api_version="2014-04-01", - data_masking_policy_name="Default", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_data_masking_policies_get(self, resource_group): - response = await self.client.data_masking_policies.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - data_masking_policy_name="Default", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py index cdf058792a95..7a8b89340175 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py @@ -18,6 +18,20 @@ class TestSqlManagementDataMaskingRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_data_masking_rules_list_by_database(self, resource_group): + response = self.client.data_masking_rules.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + data_masking_policy_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_data_masking_rules_create_or_update(self, resource_group): @@ -25,6 +39,7 @@ def test_data_masking_rules_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", + data_masking_policy_name="str", data_masking_rule_name="str", parameters={ "aliasName": "str", @@ -44,23 +59,8 @@ def test_data_masking_rules_create_or_update(self, resource_group): "tableName": "str", "type": "str", }, - api_version="2014-04-01", - data_masking_policy_name="Default", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_data_masking_rules_list_by_database(self, resource_group): - response = self.client.data_masking_rules.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - data_masking_policy_name="Default", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py index 273d1ff9265e..972bb1724fa0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py @@ -19,6 +19,20 @@ class TestSqlManagementDataMaskingRulesOperationsAsync(AzureMgmtRecordedTestCase def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_data_masking_rules_list_by_database(self, resource_group): + response = self.client.data_masking_rules.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + data_masking_policy_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_data_masking_rules_create_or_update(self, resource_group): @@ -26,6 +40,7 @@ async def test_data_masking_rules_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", + data_masking_policy_name="str", data_masking_rule_name="str", parameters={ "aliasName": "str", @@ -45,23 +60,8 @@ async def test_data_masking_rules_create_or_update(self, resource_group): "tableName": "str", "type": "str", }, - api_version="2014-04-01", - data_masking_policy_name="Default", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_data_masking_rules_list_by_database(self, resource_group): - response = self.client.data_masking_rules.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - data_masking_policy_name="Default", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py index 8a61523a09f5..b4027509dd7b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py @@ -20,27 +20,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_data_warehouse_user_activities_get(self, resource_group): - response = self.client.data_warehouse_user_activities.get( + def test_data_warehouse_user_activities_list_by_database(self, resource_group): + response = self.client.data_warehouse_user_activities.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - data_warehouse_user_activity_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_data_warehouse_user_activities_list_by_database(self, resource_group): - response = self.client.data_warehouse_user_activities.list_by_database( + def test_data_warehouse_user_activities_get(self, resource_group): + response = self.client.data_warehouse_user_activities.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + data_warehouse_user_activity_name="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py index 009fcbf39780..a8c686cc5826 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py @@ -21,27 +21,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_data_warehouse_user_activities_get(self, resource_group): - response = await self.client.data_warehouse_user_activities.get( + async def test_data_warehouse_user_activities_list_by_database(self, resource_group): + response = self.client.data_warehouse_user_activities.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - data_warehouse_user_activity_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_data_warehouse_user_activities_list_by_database(self, resource_group): - response = self.client.data_warehouse_user_activities.list_by_database( + async def test_data_warehouse_user_activities_get(self, resource_group): + response = await self.client.data_warehouse_user_activities.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + data_warehouse_user_activity_name="str", + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py index 2e556e82353f..f52193841fd1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py @@ -25,7 +25,7 @@ def test_database_advanced_threat_protection_settings_list_by_database(self, res resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_advanced_threat_protection_settings_get(self, resource_group): server_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_database_advanced_threat_protection_settings_create_or_update(self, res }, "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py index 59bb4a0e1f6e..2f4931fe6ef6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py @@ -26,7 +26,7 @@ async def test_database_advanced_threat_protection_settings_list_by_database(sel resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_advanced_threat_protection_settings_get(self, resource_g server_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_database_advanced_threat_protection_settings_create_or_update(sel }, "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py index a5daefc268a9..60100bb3d52c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py @@ -25,7 +25,7 @@ def test_database_advisors_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_advisors_get(self, resource_group): server_name="str", database_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_database_advisors_update(self, resource_group): "recommendationsStatus": "str", "recommendedActions": [ { - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -76,7 +76,7 @@ def test_database_advisors_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -100,7 +100,7 @@ def test_database_advisors_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -125,7 +125,7 @@ def test_database_advisors_update(self, resource_group): ], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py index 72eeb0da9caf..db9aa80388d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py @@ -26,7 +26,7 @@ async def test_database_advisors_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_advisors_get(self, resource_group): server_name="str", database_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ async def test_database_advisors_update(self, resource_group): "recommendationsStatus": "str", "recommendedActions": [ { - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -77,7 +77,7 @@ async def test_database_advisors_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -101,7 +101,7 @@ async def test_database_advisors_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -126,7 +126,7 @@ async def test_database_advisors_update(self, resource_group): ], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py index d9f75487ec23..516f81b39cca 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py @@ -25,7 +25,7 @@ def test_database_automatic_tuning_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ def test_database_automatic_tuning_update(self, resource_group): "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py index a7c9b089f803..66109395e420 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py @@ -26,7 +26,7 @@ async def test_database_automatic_tuning_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +47,7 @@ async def test_database_automatic_tuning_update(self, resource_group): "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py index 23a14c2bd701..c0f53c9fd182 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py @@ -25,7 +25,7 @@ def test_database_blob_auditing_policies_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_blob_auditing_policies_get(self, resource_group): server_name="str", database_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_database_blob_auditing_policies_create_or_update(self, resource_group): "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py index 5b3936e093bf..dd7cf49c448f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py @@ -26,7 +26,7 @@ async def test_database_blob_auditing_policies_list_by_database(self, resource_g resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_blob_auditing_policies_get(self, resource_group): server_name="str", database_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_database_blob_auditing_policies_create_or_update(self, resource_g "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py index ca5b5c1eb465..fcc47b955da2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py @@ -25,7 +25,7 @@ def test_database_columns_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ def test_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_database_columns_get(self, resource_group): schema_name="str", table_name="str", column_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py index 399cf54217cd..06e22f4c4476 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py @@ -26,7 +26,7 @@ async def test_database_columns_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ async def test_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ async def test_database_columns_get(self, resource_group): schema_name="str", table_name="str", column_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py index efbadff67d1e..fd7221175062 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py @@ -26,7 +26,7 @@ def test_database_encryption_protectors_begin_revalidate(self, resource_group): server_name="str", database_name="str", encryption_protector_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -40,7 +40,7 @@ def test_database_encryption_protectors_begin_revert(self, resource_group): server_name="str", database_name="str", encryption_protector_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py index f8cce8ea0e76..c2f17aa38a46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py @@ -28,7 +28,7 @@ async def test_database_encryption_protectors_begin_revalidate(self, resource_gr server_name="str", database_name="str", encryption_protector_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -44,7 +44,7 @@ async def test_database_encryption_protectors_begin_revert(self, resource_group) server_name="str", database_name="str", encryption_protector_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py index 52da9774f0e4..5023ad28ee0b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementDatabaseExtensionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_extensions_list_by_database(self, resource_group): + response = self.client.database_extensions.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_database_extensions_get(self, resource_group): @@ -26,7 +39,7 @@ def test_database_extensions_get(self, resource_group): server_name="str", database_name="str", extension_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,29 +54,23 @@ def test_database_extensions_begin_create_or_update(self, resource_group): database_name="str", extension_name="str", parameters={ + "administratorLogin": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseEdition": "str", "id": "str", + "maxSizeBytes": "str", "name": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, "operationMode": "str", + "serviceObjectiveName": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", "type": "str", }, - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_extensions_list_by_database(self, resource_group): - response = self.client.database_extensions.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2021-02-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py index 5f26bdc65d8d..a6a2d44ffdf3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementDatabaseExtensionsOperationsAsync(AzureMgmtRecordedTestCa def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_extensions_list_by_database(self, resource_group): + response = self.client.database_extensions.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_database_extensions_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_database_extensions_get(self, resource_group): server_name="str", database_name="str", extension_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -43,30 +56,24 @@ async def test_database_extensions_begin_create_or_update(self, resource_group): database_name="str", extension_name="str", parameters={ + "administratorLogin": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseEdition": "str", "id": "str", + "maxSizeBytes": "str", "name": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, "operationMode": "str", + "serviceObjectiveName": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", "type": "str", }, - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_extensions_list_by_database(self, resource_group): - response = self.client.database_extensions.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2021-02-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py index 3641b50e5e2a..c89a13bb52a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py @@ -25,7 +25,7 @@ def test_database_operations_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_operations_cancel(self, resource_group): server_name="str", database_name="str", operation_id="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py index 224389b2aba3..170a24144be6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py @@ -26,7 +26,7 @@ async def test_database_operations_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_operations_cancel(self, resource_group): server_name="str", database_name="str", operation_id="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py index bb09d6c877d6..294d114e3354 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py @@ -26,7 +26,7 @@ def test_database_recommended_actions_list_by_database_advisor(self, resource_gr server_name="str", database_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_database_recommended_actions_get(self, resource_group): database_name="str", advisor_name="str", recommended_action_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_database_recommended_actions_update(self, resource_group): advisor_name="str", recommended_action_name="str", parameters={ - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -68,7 +68,7 @@ def test_database_recommended_actions_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -92,7 +92,7 @@ def test_database_recommended_actions_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -110,7 +110,7 @@ def test_database_recommended_actions_update(self, resource_group): "type": "str", "validSince": "2020-02-20 00:00:00", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py index 434572d8d510..4857d94fd480 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py @@ -27,7 +27,7 @@ async def test_database_recommended_actions_list_by_database_advisor(self, resou server_name="str", database_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_database_recommended_actions_get(self, resource_group): database_name="str", advisor_name="str", recommended_action_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,7 +58,7 @@ async def test_database_recommended_actions_update(self, resource_group): advisor_name="str", recommended_action_name="str", parameters={ - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -69,7 +69,7 @@ async def test_database_recommended_actions_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -93,7 +93,7 @@ async def test_database_recommended_actions_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -111,7 +111,7 @@ async def test_database_recommended_actions_update(self, resource_group): "type": "str", "validSince": "2020-02-20 00:00:00", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py index 39f8a49fe72f..ab4b76d06952 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py @@ -25,7 +25,7 @@ def test_database_schemas_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_schemas_get(self, resource_group): server_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py index ac410ac53b58..b0bb0a224bd6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py @@ -26,7 +26,7 @@ async def test_database_schemas_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_schemas_get(self, resource_group): server_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py index fd68d6743397..c27d1855adac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementDatabaseSecurityAlertPoliciesOperations(AzureMgmtRecorded def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_database_security_alert_policies_get(self, resource_group): @@ -26,7 +39,7 @@ def test_database_security_alert_policies_get(self, resource_group): server_name="str", database_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,21 +74,8 @@ def test_database_security_alert_policies_create_or_update(self, resource_group) }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py index c8efa1a22508..b8303ee792be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementDatabaseSecurityAlertPoliciesOperationsAsync(AzureMgmtRec def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_database_security_alert_policies_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_database_security_alert_policies_get(self, resource_group): server_name="str", database_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,21 +75,8 @@ async def test_database_security_alert_policies_create_or_update(self, resource_ }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py index 5ad43da961c1..915ae422c5ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py @@ -26,7 +26,7 @@ def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerabili server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_database_sql_vulnerability_assessment_baselines_get(self, resource_grou database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,7 +71,7 @@ def test_database_sql_vulnerability_assessment_baselines_create_or_update(self, }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py index 11cf3082f0a3..79d7efe68221 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py @@ -29,7 +29,7 @@ async def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulne server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_database_sql_vulnerability_assessment_baselines_get(self, resourc database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -74,7 +74,7 @@ async def test_database_sql_vulnerability_assessment_baselines_create_or_update( }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py index 3b0224fc7068..056165839df3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -26,7 +26,7 @@ def test_database_sql_vulnerability_assessment_execute_scan_begin_execute(self, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py index f6c7dc9de6a6..027f4cd978ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py @@ -28,7 +28,7 @@ async def test_database_sql_vulnerability_assessment_execute_scan_begin_execute( server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py index 9b52e9ff152d..6e25bb0096b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -27,7 +27,7 @@ def test_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline(s database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -43,7 +43,7 @@ def test_database_sql_vulnerability_assessment_rule_baselines_get(self, resource vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -74,7 +74,7 @@ def test_database_sql_vulnerability_assessment_rule_baselines_create_or_update(s }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -90,7 +90,7 @@ def test_database_sql_vulnerability_assessment_rule_baselines_delete(self, resou vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py index 3260f56f7877..e73a6250db52 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py @@ -28,7 +28,7 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_list_by_base database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_get(self, re vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -75,7 +75,7 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_create_or_up }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -91,7 +91,7 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_delete(self, vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py index de0e24f2280a..eb74cbf1bf26 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py @@ -27,7 +27,7 @@ def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(self, re database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -43,7 +43,7 @@ def test_database_sql_vulnerability_assessment_scan_result_get(self, resource_gr vulnerability_assessment_name="str", scan_id="str", scan_result_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py index f90b875408a9..862041ed5f87 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py @@ -28,7 +28,7 @@ async def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(se database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_database_sql_vulnerability_assessment_scan_result_get(self, resou vulnerability_assessment_name="str", scan_id="str", scan_result_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py index d601956edb45..64c04b595154 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py @@ -26,7 +26,7 @@ def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_a server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_database_sql_vulnerability_assessment_scans_get(self, resource_group): database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py index 89df33ee0946..8fdcf64102a0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py @@ -29,7 +29,7 @@ async def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerabi server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_database_sql_vulnerability_assessment_scans_get(self, resource_gr database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py index 871f257cb02e..81526b236ac7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py @@ -25,7 +25,7 @@ def test_database_sql_vulnerability_assessments_settings_list_by_database(self, resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_database_sql_vulnerability_assessments_settings_get(self, resource_grou server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py index be6fe9177cc0..242a7d5f92d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py @@ -26,7 +26,7 @@ async def test_database_sql_vulnerability_assessments_settings_list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_database_sql_vulnerability_assessments_settings_get(self, resourc server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py index 3da9345bab38..a26a4c23fa1c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py @@ -26,7 +26,7 @@ def test_database_tables_list_by_schema(self, resource_group): server_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_database_tables_get(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py index 5759f775ee31..e5946841be80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py @@ -27,7 +27,7 @@ async def test_database_tables_list_by_schema(self, resource_group): server_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_database_tables_get(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py index 2f4e877eddcf..2e1b2d1e86d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py @@ -25,7 +25,7 @@ def test_database_usages_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py index 8e0fa7c1bc7e..a3c28274d356 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py @@ -26,7 +26,7 @@ async def test_database_usages_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py index d4cbe9ee9dc3..fb183e31d79a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py @@ -28,7 +28,7 @@ def test_database_vulnerability_assessment_rule_baselines_get(self, resource_gro vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_database_vulnerability_assessment_rule_baselines_create_or_update(self, rule_id="str", baseline_name="str", parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ def test_database_vulnerability_assessment_rule_baselines_delete(self, resource_ vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py index 9a3394ad5ce9..f0d1bf5249be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py @@ -29,7 +29,7 @@ async def test_database_vulnerability_assessment_rule_baselines_get(self, resour vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_database_vulnerability_assessment_rule_baselines_create_or_update rule_id="str", baseline_name="str", parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ async def test_database_vulnerability_assessment_rule_baselines_delete(self, res vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py index 0e665adf2342..d7f795f0d947 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py @@ -20,43 +20,43 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.begin_initiate_scan( + def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result - + api_version="2025-01-01", + ) + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.list_by_database( + def test_database_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + scan_id="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.get( + def test_database_vulnerability_assessment_scans_export(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.export( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,15 +64,15 @@ def test_database_vulnerability_assessment_scans_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_export(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.export( + def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.begin_initiate_scan( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", - ) + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py index 4b4ba95c3e0a..107e0382fedf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py @@ -19,23 +19,6 @@ class TestSqlManagementDatabaseVulnerabilityAssessmentScansOperationsAsync(Azure def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): - response = await ( - await self.client.database_vulnerability_assessment_scans.begin_initiate_scan( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - vulnerability_assessment_name="str", - scan_id="str", - api_version="2020-11-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): @@ -44,7 +27,7 @@ async def test_database_vulnerability_assessment_scans_list_by_database(self, re server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -59,7 +42,7 @@ async def test_database_vulnerability_assessment_scans_get(self, resource_group) database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -74,8 +57,25 @@ async def test_database_vulnerability_assessment_scans_export(self, resource_gro database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): + response = await ( + await self.client.database_vulnerability_assessment_scans.begin_initiate_scan( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + vulnerability_assessment_name="str", + scan_id="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py index 75e310638948..ca3946ad9a74 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementDatabaseVulnerabilityAssessmentsOperations(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_database_vulnerability_assessments_get(self, resource_group): @@ -26,7 +39,7 @@ def test_database_vulnerability_assessments_get(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,7 +62,7 @@ def test_database_vulnerability_assessments_create_or_update(self, resource_grou "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -63,21 +76,8 @@ def test_database_vulnerability_assessments_delete(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py index 8beb05636893..48fa8ea31cdf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementDatabaseVulnerabilityAssessmentsOperationsAsync(AzureMgmt def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_database_vulnerability_assessments_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_database_vulnerability_assessments_get(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +63,7 @@ async def test_database_vulnerability_assessments_create_or_update(self, resourc "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,21 +77,8 @@ async def test_database_vulnerability_assessments_delete(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py index fe3764118818..3c5f860c8fa6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py @@ -18,40 +18,13 @@ class TestSqlManagementDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_list_metrics(self, resource_group): - response = self.client.databases.list_metrics( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - filter="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_list_metric_definitions(self, resource_group): - response = self.client.databases.list_metric_definitions( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_databases_list_by_server(self, resource_group): response = self.client.databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -64,7 +37,7 @@ def test_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -109,6 +82,7 @@ def test_databases_begin_create_or_update(self, resource_group): "keys": { "str": { "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", "subregion": "str", "thumbprint": "str", "type": "str", @@ -147,7 +121,7 @@ def test_databases_begin_create_or_update(self, resource_group): "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -160,7 +134,7 @@ def test_databases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -202,6 +176,7 @@ def test_databases_begin_update(self, resource_group): "keys": { "str": { "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", "subregion": "str", "thumbprint": "str", "type": "str", @@ -235,7 +210,7 @@ def test_databases_begin_update(self, resource_group): "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -250,14 +225,14 @@ def test_databases_begin_export(self, resource_group): database_name="str", parameters={ "administratorLogin": "str", - "administratorLoginPassword": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", + "administratorLoginPassword": "str", "authenticationType": "str", "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -270,7 +245,7 @@ def test_databases_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -285,14 +260,14 @@ def test_databases_begin_import_method(self, resource_group): database_name="str", parameters={ "administratorLogin": "str", - "administratorLoginPassword": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", + "administratorLoginPassword": "str", "authenticationType": "str", "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -306,7 +281,7 @@ def test_databases_rename(self, resource_group): server_name="str", database_name="str", parameters={"id": "str"}, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -319,7 +294,7 @@ def test_databases_begin_pause(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -332,7 +307,7 @@ def test_databases_begin_resume(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -345,7 +320,7 @@ def test_databases_begin_upgrade_data_warehouse(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -358,7 +333,7 @@ def test_databases_list_by_elastic_pool(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -370,7 +345,7 @@ def test_databases_list_inaccessible_by_server(self, resource_group): response = self.client.databases.list_inaccessible_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py index f805eb2bba91..870cd15853a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py @@ -19,40 +19,13 @@ class TestSqlManagementDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_list_metrics(self, resource_group): - response = self.client.databases.list_metrics( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - filter="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_list_metric_definitions(self, resource_group): - response = self.client.databases.list_metric_definitions( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_databases_list_by_server(self, resource_group): response = self.client.databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -65,7 +38,7 @@ async def test_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -111,6 +84,7 @@ async def test_databases_begin_create_or_update(self, resource_group): "keys": { "str": { "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", "subregion": "str", "thumbprint": "str", "type": "str", @@ -149,7 +123,7 @@ async def test_databases_begin_create_or_update(self, resource_group): "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -164,7 +138,7 @@ async def test_databases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -208,6 +182,7 @@ async def test_databases_begin_update(self, resource_group): "keys": { "str": { "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", "subregion": "str", "thumbprint": "str", "type": "str", @@ -241,7 +216,7 @@ async def test_databases_begin_update(self, resource_group): "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -258,14 +233,14 @@ async def test_databases_begin_export(self, resource_group): database_name="str", parameters={ "administratorLogin": "str", - "administratorLoginPassword": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", + "administratorLoginPassword": "str", "authenticationType": "str", "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -280,7 +255,7 @@ async def test_databases_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -297,14 +272,14 @@ async def test_databases_begin_import_method(self, resource_group): database_name="str", parameters={ "administratorLogin": "str", - "administratorLoginPassword": "str", "storageKey": "str", "storageKeyType": "str", "storageUri": "str", + "administratorLoginPassword": "str", "authenticationType": "str", "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, }, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -319,7 +294,7 @@ async def test_databases_rename(self, resource_group): server_name="str", database_name="str", parameters={"id": "str"}, - api_version="2023-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -333,7 +308,7 @@ async def test_databases_begin_pause(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -348,7 +323,7 @@ async def test_databases_begin_resume(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -363,7 +338,7 @@ async def test_databases_begin_upgrade_data_warehouse(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -377,7 +352,7 @@ async def test_databases_list_by_elastic_pool(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -389,7 +364,7 @@ async def test_databases_list_inaccessible_by_server(self, resource_group): response = self.client.databases.list_inaccessible_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py index 650c9a4be163..39e02c8eb8d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_deleted_servers_list(self, resource_group): response = self.client.deleted_servers.list( - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -30,24 +30,24 @@ def test_deleted_servers_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deleted_servers_get(self, resource_group): - response = self.client.deleted_servers.get( + def test_deleted_servers_list_by_location(self, resource_group): + response = self.client.deleted_servers.list_by_location( location_name="str", - deleted_server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deleted_servers_list_by_location(self, resource_group): - response = self.client.deleted_servers.list_by_location( + def test_deleted_servers_get(self, resource_group): + response = self.client.deleted_servers.get( location_name="str", - api_version="2020-11-01-preview", + deleted_server_name="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -57,7 +57,7 @@ def test_deleted_servers_begin_recover(self, resource_group): response = self.client.deleted_servers.begin_recover( location_name="str", deleted_server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py index e8e818cce32e..ae80c389a9d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_deleted_servers_list(self, resource_group): response = self.client.deleted_servers.list( - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -31,24 +31,24 @@ async def test_deleted_servers_list(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deleted_servers_get(self, resource_group): - response = await self.client.deleted_servers.get( + async def test_deleted_servers_list_by_location(self, resource_group): + response = self.client.deleted_servers.list_by_location( location_name="str", - deleted_server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deleted_servers_list_by_location(self, resource_group): - response = self.client.deleted_servers.list_by_location( + async def test_deleted_servers_get(self, resource_group): + response = await self.client.deleted_servers.get( location_name="str", - api_version="2020-11-01-preview", + deleted_server_name="str", + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -59,7 +59,7 @@ async def test_deleted_servers_begin_recover(self, resource_group): await self.client.deleted_servers.begin_recover( location_name="str", deleted_server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py index a38ce1604889..15e58f1cf72c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py @@ -24,7 +24,7 @@ def test_distributed_availability_groups_list_by_instance(self, resource_group): response = self.client.distributed_availability_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_distributed_availability_groups_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", distributed_availability_group_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -90,7 +90,7 @@ def test_distributed_availability_groups_begin_create_or_update(self, resource_g "seedingMode": "str", "type": "str", }, - api_version="2023-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -103,7 +103,7 @@ def test_distributed_availability_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", distributed_availability_group_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -156,7 +156,7 @@ def test_distributed_availability_groups_begin_update(self, resource_group): "seedingMode": "str", "type": "str", }, - api_version="2023-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -170,7 +170,7 @@ def test_distributed_availability_groups_begin_failover(self, resource_group): managed_instance_name="str", distributed_availability_group_name="str", parameters={"failoverType": "str"}, - api_version="2023-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -184,7 +184,7 @@ def test_distributed_availability_groups_begin_set_role(self, resource_group): managed_instance_name="str", distributed_availability_group_name="str", parameters={"instanceRole": "str", "roleChangeType": "str"}, - api_version="2023-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py index 9b02216b0f9b..e3cc5648c690 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py @@ -25,7 +25,7 @@ async def test_distributed_availability_groups_list_by_instance(self, resource_g response = self.client.distributed_availability_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_distributed_availability_groups_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", distributed_availability_group_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -92,7 +92,7 @@ async def test_distributed_availability_groups_begin_create_or_update(self, reso "seedingMode": "str", "type": "str", }, - api_version="2023-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -107,7 +107,7 @@ async def test_distributed_availability_groups_begin_delete(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", distributed_availability_group_name="str", - api_version="2023-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -162,7 +162,7 @@ async def test_distributed_availability_groups_begin_update(self, resource_group "seedingMode": "str", "type": "str", }, - api_version="2023-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -178,7 +178,7 @@ async def test_distributed_availability_groups_begin_failover(self, resource_gro managed_instance_name="str", distributed_availability_group_name="str", parameters={"failoverType": "str"}, - api_version="2023-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -194,7 +194,7 @@ async def test_distributed_availability_groups_begin_set_role(self, resource_gro managed_instance_name="str", distributed_availability_group_name="str", parameters={"instanceRole": "str", "roleChangeType": "str"}, - api_version="2023-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py index 56d318171acb..b2d7ff66dce3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py @@ -20,27 +20,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_elastic_pool_operations_cancel(self, resource_group): - response = self.client.elastic_pool_operations.cancel( + def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group): + response = self.client.elastic_pool_operations.list_by_elastic_pool( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_operations.list_by_elastic_pool( + def test_elastic_pool_operations_cancel(self, resource_group): + response = self.client.elastic_pool_operations.cancel( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2020-11-01-preview", + operation_id="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py index 30d04a6b2e17..bf0c7d3aef66 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py @@ -21,27 +21,27 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_elastic_pool_operations_cancel(self, resource_group): - response = await self.client.elastic_pool_operations.cancel( + async def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group): + response = self.client.elastic_pool_operations.list_by_elastic_pool( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_operations.list_by_elastic_pool( + async def test_elastic_pool_operations_cancel(self, resource_group): + response = await self.client.elastic_pool_operations.cancel( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2020-11-01-preview", + operation_id="str", + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py index 653f5276fe17..4009558c5141 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py @@ -18,40 +18,13 @@ class TestSqlManagementElasticPoolsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_pools_list_metrics(self, resource_group): - response = self.client.elastic_pools.list_metrics( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - filter="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_pools_list_metric_definitions(self, resource_group): - response = self.client.elastic_pools.list_metric_definitions( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_elastic_pools_list_by_server(self, resource_group): response = self.client.elastic_pools.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -64,7 +37,7 @@ def test_elastic_pools_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -79,6 +52,7 @@ def test_elastic_pools_begin_create_or_update(self, resource_group): elastic_pool_name="str", parameters={ "location": "str", + "autoPauseDelay": 0, "availabilityZone": "str", "creationDate": "2020-02-20 00:00:00", "highAvailabilityReplicaCount": 0, @@ -89,7 +63,7 @@ def test_elastic_pools_begin_create_or_update(self, resource_group): "maxSizeBytes": 0, "minCapacity": 0.0, "name": "str", - "perDatabaseSettings": {"maxCapacity": 0.0, "minCapacity": 0.0}, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, "preferredEnclaveType": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "state": "str", @@ -97,7 +71,7 @@ def test_elastic_pools_begin_create_or_update(self, resource_group): "type": "str", "zoneRedundant": bool, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -110,7 +84,7 @@ def test_elastic_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,19 +98,20 @@ def test_elastic_pools_begin_update(self, resource_group): server_name="str", elastic_pool_name="str", parameters={ + "autoPauseDelay": 0, "availabilityZone": "str", "highAvailabilityReplicaCount": 0, "licenseType": "str", "maintenanceConfigurationId": "str", "maxSizeBytes": 0, "minCapacity": 0.0, - "perDatabaseSettings": {"maxCapacity": 0.0, "minCapacity": 0.0}, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, "preferredEnclaveType": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, "zoneRedundant": bool, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -149,7 +124,7 @@ def test_elastic_pools_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py index 6cc514565826..37077ea6effa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py @@ -19,40 +19,13 @@ class TestSqlManagementElasticPoolsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_pools_list_metrics(self, resource_group): - response = self.client.elastic_pools.list_metrics( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - filter="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_pools_list_metric_definitions(self, resource_group): - response = self.client.elastic_pools.list_metric_definitions( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_elastic_pools_list_by_server(self, resource_group): response = self.client.elastic_pools.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -65,7 +38,7 @@ async def test_elastic_pools_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,6 +54,7 @@ async def test_elastic_pools_begin_create_or_update(self, resource_group): elastic_pool_name="str", parameters={ "location": "str", + "autoPauseDelay": 0, "availabilityZone": "str", "creationDate": "2020-02-20 00:00:00", "highAvailabilityReplicaCount": 0, @@ -91,7 +65,7 @@ async def test_elastic_pools_begin_create_or_update(self, resource_group): "maxSizeBytes": 0, "minCapacity": 0.0, "name": "str", - "perDatabaseSettings": {"maxCapacity": 0.0, "minCapacity": 0.0}, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, "preferredEnclaveType": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "state": "str", @@ -99,7 +73,7 @@ async def test_elastic_pools_begin_create_or_update(self, resource_group): "type": "str", "zoneRedundant": bool, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -114,7 +88,7 @@ async def test_elastic_pools_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -130,19 +104,20 @@ async def test_elastic_pools_begin_update(self, resource_group): server_name="str", elastic_pool_name="str", parameters={ + "autoPauseDelay": 0, "availabilityZone": "str", "highAvailabilityReplicaCount": 0, "licenseType": "str", "maintenanceConfigurationId": "str", "maxSizeBytes": 0, "minCapacity": 0.0, - "perDatabaseSettings": {"maxCapacity": 0.0, "minCapacity": 0.0}, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, "preferredEnclaveType": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, "zoneRedundant": bool, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -157,7 +132,7 @@ async def test_elastic_pools_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py index f046fcb9aabe..92562b373f8f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py @@ -24,7 +24,7 @@ def test_encryption_protectors_list_by_server(self, resource_group): response = self.client.encryption_protectors.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,6 +53,7 @@ def test_encryption_protectors_begin_create_or_update(self, resource_group): parameters={ "autoRotationEnabled": bool, "id": "str", + "keyVersion": "str", "kind": "str", "location": "str", "name": "str", @@ -63,7 +64,7 @@ def test_encryption_protectors_begin_create_or_update(self, resource_group): "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,7 +77,7 @@ def test_encryption_protectors_begin_revalidate(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py index 84ea0fb47e39..8d29a7bdd5a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py @@ -25,7 +25,7 @@ async def test_encryption_protectors_list_by_server(self, resource_group): response = self.client.encryption_protectors.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,6 +55,7 @@ async def test_encryption_protectors_begin_create_or_update(self, resource_group parameters={ "autoRotationEnabled": bool, "id": "str", + "keyVersion": "str", "kind": "str", "location": "str", "name": "str", @@ -65,7 +66,7 @@ async def test_encryption_protectors_begin_create_or_update(self, resource_group "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +81,7 @@ async def test_encryption_protectors_begin_revalidate(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py index 2a6f5f84f722..a07e320e6fd7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py @@ -24,7 +24,7 @@ def test_endpoint_certificates_list_by_instance(self, resource_group): response = self.client.endpoint_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_endpoint_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", endpoint_type="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py index 1a261d1575d7..78eae88b8150 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py @@ -25,7 +25,7 @@ async def test_endpoint_certificates_list_by_instance(self, resource_group): response = self.client.endpoint_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_endpoint_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", endpoint_type="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py index bc31039d0575..41fc99f2b7a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py @@ -25,7 +25,7 @@ def test_extended_database_blob_auditing_policies_list_by_database(self, resourc resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_extended_database_blob_auditing_policies_get(self, resource_group): server_name="str", database_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_extended_database_blob_auditing_policies_create_or_update(self, resourc "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py index 3d924937a6de..3445a7cb0f35 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py @@ -26,7 +26,7 @@ async def test_extended_database_blob_auditing_policies_list_by_database(self, r resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_extended_database_blob_auditing_policies_get(self, resource_group server_name="str", database_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_extended_database_blob_auditing_policies_create_or_update(self, r "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py index 58ac5c7cdb21..86c62de45260 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py @@ -24,7 +24,7 @@ def test_extended_server_blob_auditing_policies_list_by_server(self, resource_gr response = self.client.extended_server_blob_auditing_policies.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_extended_server_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ def test_extended_server_blob_auditing_policies_begin_create_or_update(self, res "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py index ea516883ea68..ae7bbdff3bb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py @@ -25,7 +25,7 @@ async def test_extended_server_blob_auditing_policies_list_by_server(self, resou response = self.client.extended_server_blob_auditing_policies.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_extended_server_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_extended_server_blob_auditing_policies_begin_create_or_update(sel "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py index 3c119e0a5967..f35b5e5fb76d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py @@ -24,7 +24,7 @@ def test_failover_groups_list_by_server(self, resource_group): response = self.client.failover_groups.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_failover_groups_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,7 +77,7 @@ def test_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -98,7 +98,7 @@ def test_failover_groups_begin_update(self, resource_group): "secondaryType": "str", "tags": {"str": "str"}, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -111,7 +111,7 @@ def test_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,7 +124,7 @@ def test_failover_groups_begin_force_failover_allow_data_loss(self, resource_gro resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -137,7 +137,7 @@ def test_failover_groups_begin_try_planned_before_forced_failover(self, resource resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py index a020ba4596c0..4c932fec7bf3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py @@ -25,7 +25,7 @@ async def test_failover_groups_list_by_server(self, resource_group): response = self.client.failover_groups.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ async def test_failover_groups_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -81,7 +81,7 @@ async def test_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +104,7 @@ async def test_failover_groups_begin_update(self, resource_group): "secondaryType": "str", "tags": {"str": "str"}, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -119,7 +119,7 @@ async def test_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -134,7 +134,7 @@ async def test_failover_groups_begin_force_failover_allow_data_loss(self, resour resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -149,7 +149,7 @@ async def test_failover_groups_begin_try_planned_before_forced_failover(self, re resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py index 4ecc6b5bd186..1e93cff2c54e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py @@ -20,26 +20,26 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_get(self, resource_group): - response = self.client.firewall_rules.get( + def test_firewall_rules_list_by_server(self, resource_group): + response = self.client.firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_create_or_update(self, resource_group): - response = self.client.firewall_rules.create_or_update( + def test_firewall_rules_replace(self, resource_group): + response = self.client.firewall_rules.replace( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, - api_version="2020-11-01-preview", + parameters={ + "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] + }, + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,12 +47,12 @@ def test_firewall_rules_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_delete(self, resource_group): - response = self.client.firewall_rules.delete( + def test_firewall_rules_get(self, resource_group): + response = self.client.firewall_rules.get( resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,26 +60,26 @@ def test_firewall_rules_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_list_by_server(self, resource_group): - response = self.client.firewall_rules.list_by_server( + def test_firewall_rules_create_or_update(self, resource_group): + response = self.client.firewall_rules.create_or_update( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + firewall_rule_name="str", + parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_replace(self, resource_group): - response = self.client.firewall_rules.replace( + def test_firewall_rules_delete(self, resource_group): + response = self.client.firewall_rules.delete( resource_group_name=resource_group.name, server_name="str", - parameters={ - "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] - }, - api_version="2020-11-01-preview", + firewall_rule_name="str", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py index 58464eb5a173..079423ed4cdb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py @@ -21,26 +21,26 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_get(self, resource_group): - response = await self.client.firewall_rules.get( + async def test_firewall_rules_list_by_server(self, resource_group): + response = self.client.firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_create_or_update(self, resource_group): - response = await self.client.firewall_rules.create_or_update( + async def test_firewall_rules_replace(self, resource_group): + response = await self.client.firewall_rules.replace( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, - api_version="2020-11-01-preview", + parameters={ + "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] + }, + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,12 +48,12 @@ async def test_firewall_rules_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_delete(self, resource_group): - response = await self.client.firewall_rules.delete( + async def test_firewall_rules_get(self, resource_group): + response = await self.client.firewall_rules.get( resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,26 +61,26 @@ async def test_firewall_rules_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_list_by_server(self, resource_group): - response = self.client.firewall_rules.list_by_server( + async def test_firewall_rules_create_or_update(self, resource_group): + response = await self.client.firewall_rules.create_or_update( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + firewall_rule_name="str", + parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_replace(self, resource_group): - response = await self.client.firewall_rules.replace( + async def test_firewall_rules_delete(self, resource_group): + response = await self.client.firewall_rules.delete( resource_group_name=resource_group.name, server_name="str", - parameters={ - "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] - }, - api_version="2020-11-01-preview", + firewall_rule_name="str", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py index c9fa70c8ab8a..8fe8d492078e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py @@ -20,24 +20,14 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_geo_backup_policies_create_or_update(self, resource_group): - response = self.client.geo_backup_policies.create_or_update( + def test_geo_backup_policies_list(self, resource_group): + response = self.client.geo_backup_policies.list( resource_group_name=resource_group.name, server_name="str", database_name="str", - geo_backup_policy_name="str", - parameters={ - "state": "str", - "id": "str", - "kind": "str", - "location": "str", - "name": "str", - "storageType": "str", - "type": "str", - }, - api_version="2014-04-01", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -49,7 +39,7 @@ def test_geo_backup_policies_get(self, resource_group): server_name="str", database_name="str", geo_backup_policy_name="str", - api_version="2014-04-01", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,13 +47,23 @@ def test_geo_backup_policies_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_geo_backup_policies_list_by_database(self, resource_group): - response = self.client.geo_backup_policies.list_by_database( + def test_geo_backup_policies_create_or_update(self, resource_group): + response = self.client.geo_backup_policies.create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2014-04-01", + geo_backup_policy_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "state": "str", + "storageType": "str", + "type": "str", + }, + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py index 2e5689b7de1d..f468cdb4eb0b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py @@ -21,24 +21,14 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_geo_backup_policies_create_or_update(self, resource_group): - response = await self.client.geo_backup_policies.create_or_update( + async def test_geo_backup_policies_list(self, resource_group): + response = self.client.geo_backup_policies.list( resource_group_name=resource_group.name, server_name="str", database_name="str", - geo_backup_policy_name="str", - parameters={ - "state": "str", - "id": "str", - "kind": "str", - "location": "str", - "name": "str", - "storageType": "str", - "type": "str", - }, - api_version="2014-04-01", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -50,7 +40,7 @@ async def test_geo_backup_policies_get(self, resource_group): server_name="str", database_name="str", geo_backup_policy_name="str", - api_version="2014-04-01", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,13 +48,23 @@ async def test_geo_backup_policies_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_geo_backup_policies_list_by_database(self, resource_group): - response = self.client.geo_backup_policies.list_by_database( + async def test_geo_backup_policies_create_or_update(self, resource_group): + response = await self.client.geo_backup_policies.create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2014-04-01", + geo_backup_policy_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "state": "str", + "storageType": "str", + "type": "str", + }, + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py index 7f340e10b873..d3ffc0918007 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py @@ -24,7 +24,7 @@ def test_instance_failover_groups_list_by_location(self, resource_group): response = self.client.instance_failover_groups.list_by_location( resource_group_name=resource_group.name, location_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_instance_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ def test_instance_failover_groups_begin_create_or_update(self, resource_group): "secondaryType": "str", "type": "str", }, - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,7 +75,7 @@ def test_instance_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -88,7 +88,7 @@ def test_instance_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -101,7 +101,7 @@ def test_instance_failover_groups_begin_force_failover_allow_data_loss(self, res resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py index c90ff8d192f7..f398fd71f2fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py @@ -25,7 +25,7 @@ async def test_instance_failover_groups_list_by_location(self, resource_group): response = self.client.instance_failover_groups.list_by_location( resource_group_name=resource_group.name, location_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_instance_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ async def test_instance_failover_groups_begin_create_or_update(self, resource_gr "secondaryType": "str", "type": "str", }, - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -79,7 +79,7 @@ async def test_instance_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -94,7 +94,7 @@ async def test_instance_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -109,7 +109,7 @@ async def test_instance_failover_groups_begin_force_failover_allow_data_loss(sel resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py index 617aa17ea5d0..357be7edfe2d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py @@ -24,7 +24,7 @@ def test_instance_pool_operations_list_by_instance_pool(self, resource_group): response = self.client.instance_pool_operations.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_instance_pool_operations_get(self, resource_group): resource_group_name=resource_group.name, instance_pool_name="str", operation_id="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py index 5aa0ad5a2e08..5d7127f2b81a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py @@ -25,7 +25,7 @@ async def test_instance_pool_operations_list_by_instance_pool(self, resource_gro response = self.client.instance_pool_operations.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_instance_pool_operations_get(self, resource_group): resource_group_name=resource_group.name, instance_pool_name="str", operation_id="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py index e035b9e2b2fd..0ed96de8cf5f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_instance_pools_list(self, resource_group): response = self.client.instance_pools.list( - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_instance_pools_list(self, resource_group): def test_instance_pools_list_by_resource_group(self, resource_group): response = self.client.instance_pools.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_instance_pools_get(self, resource_group): response = self.client.instance_pools.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ def test_instance_pools_begin_create_or_update(self, resource_group): "type": "str", "vCores": 0, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,7 +82,7 @@ def test_instance_pools_begin_delete(self, resource_group): response = self.client.instance_pools.begin_delete( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -103,7 +103,7 @@ def test_instance_pools_begin_update(self, resource_group): "tags": {"str": "str"}, "vCores": 0, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py index e9a85fb61e1f..62a045a1286c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_instance_pools_list(self, resource_group): response = self.client.instance_pools.list( - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_instance_pools_list(self, resource_group): async def test_instance_pools_list_by_resource_group(self, resource_group): response = self.client.instance_pools.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_instance_pools_get(self, resource_group): response = await self.client.instance_pools.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,7 +72,7 @@ async def test_instance_pools_begin_create_or_update(self, resource_group): "type": "str", "vCores": 0, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -86,7 +86,7 @@ async def test_instance_pools_begin_delete(self, resource_group): await self.client.instance_pools.begin_delete( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -109,7 +109,7 @@ async def test_instance_pools_begin_update(self, resource_group): "tags": {"str": "str"}, "vCores": 0, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py index 881ca95d82fa..77cc0cb88bcc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py @@ -24,7 +24,7 @@ def test_ipv6_firewall_rules_list_by_server(self, resource_group): response = self.client.ipv6_firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_ipv6_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_ipv6_firewall_rules_create_or_update(self, resource_group): server_name="str", firewall_rule_name="str", parameters={"endIPv6Address": "str", "id": "str", "name": "str", "startIPv6Address": "str", "type": "str"}, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_ipv6_firewall_rules_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py index 7a104d6f4dd8..181479dd7928 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py @@ -25,7 +25,7 @@ async def test_ipv6_firewall_rules_list_by_server(self, resource_group): response = self.client.ipv6_firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_ipv6_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_ipv6_firewall_rules_create_or_update(self, resource_group): server_name="str", firewall_rule_name="str", parameters={"endIPv6Address": "str", "id": "str", "name": "str", "startIPv6Address": "str", "type": "str"}, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ async def test_ipv6_firewall_rules_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py index 0f5ec1b75b3a..bcbe9fbf5ac2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py @@ -24,7 +24,7 @@ def test_job_agents_list_by_server(self, resource_group): response = self.client.job_agents.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_job_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,13 +54,18 @@ def test_job_agents_begin_create_or_update(self, resource_group): "location": "str", "databaseId": "str", "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "state": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -73,7 +78,7 @@ def test_job_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,8 +91,16 @@ def test_job_agents_begin_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2020-11-01-preview", + parameters={ + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py index bc54ee605a51..90af19174c12 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py @@ -25,7 +25,7 @@ async def test_job_agents_list_by_server(self, resource_group): response = self.client.job_agents.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_job_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,13 +56,18 @@ async def test_job_agents_begin_create_or_update(self, resource_group): "location": "str", "databaseId": "str", "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "state": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -77,7 +82,7 @@ async def test_job_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -92,8 +97,16 @@ async def test_job_agents_begin_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - parameters={"tags": {"str": "str"}}, - api_version="2020-11-01-preview", + parameters={ + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py index f33e1eaa8dc0..b3ffec41a4ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py @@ -25,7 +25,7 @@ def test_job_credentials_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_job_credentials_get(self, resource_group): server_name="str", job_agent_name="str", credential_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ def test_job_credentials_create_or_update(self, resource_group): job_agent_name="str", credential_name="str", parameters={"id": "str", "name": "str", "password": "str", "type": "str", "username": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_job_credentials_delete(self, resource_group): server_name="str", job_agent_name="str", credential_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py index 5dbd338ebcbd..9ca0f9af9e85 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py @@ -26,7 +26,7 @@ async def test_job_credentials_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_job_credentials_get(self, resource_group): server_name="str", job_agent_name="str", credential_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,7 +55,7 @@ async def test_job_credentials_create_or_update(self, resource_group): job_agent_name="str", credential_name="str", parameters={"id": "str", "name": "str", "password": "str", "type": "str", "username": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_job_credentials_delete(self, resource_group): server_name="str", job_agent_name="str", credential_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py index 79cd8188c71c..aa8e8bb52a9c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py @@ -25,7 +25,7 @@ def test_job_executions_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,57 +33,58 @@ def test_job_executions_list_by_agent(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_cancel(self, resource_group): - response = self.client.job_executions.cancel( + def test_job_executions_list_by_job(self, resource_group): + response = self.client.job_executions.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_begin_create(self, resource_group): - response = self.client.job_executions.begin_create( + def test_job_executions_get(self, resource_group): + response = self.client.job_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result + job_execution_id="str", + api_version="2025-01-01", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_list_by_job(self, resource_group): - response = self.client.job_executions.list_by_job( + def test_job_executions_begin_create_or_update(self, resource_group): + response = self.client.job_executions.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] + job_execution_id="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_get(self, resource_group): - response = self.client.job_executions.get( + def test_job_executions_cancel(self, resource_group): + response = self.client.job_executions.cancel( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -91,14 +92,13 @@ def test_job_executions_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_begin_create_or_update(self, resource_group): - response = self.client.job_executions.begin_create_or_update( + def test_job_executions_begin_create(self, resource_group): + response = self.client.job_executions.begin_create( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py index 0bd8a0627996..ab14deb148dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py @@ -26,7 +26,7 @@ async def test_job_executions_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,14 +34,28 @@ async def test_job_executions_list_by_agent(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_executions_cancel(self, resource_group): - response = await self.client.job_executions.cancel( + async def test_job_executions_list_by_job(self, resource_group): + response = self.client.job_executions.list_by_job( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_executions_get(self, resource_group): + response = await self.client.job_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,14 +63,15 @@ async def test_job_executions_cancel(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_executions_begin_create(self, resource_group): + async def test_job_executions_begin_create_or_update(self, resource_group): response = await ( - await self.client.job_executions.begin_create( + await self.client.job_executions.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + job_execution_id="str", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -65,28 +80,14 @@ async def test_job_executions_begin_create(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_executions_list_by_job(self, resource_group): - response = self.client.job_executions.list_by_job( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_executions_get(self, resource_group): - response = await self.client.job_executions.get( + async def test_job_executions_cancel(self, resource_group): + response = await self.client.job_executions.cancel( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -94,15 +95,14 @@ async def test_job_executions_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_executions_begin_create_or_update(self, resource_group): + async def test_job_executions_begin_create(self, resource_group): response = await ( - await self.client.job_executions.begin_create_or_update( + await self.client.job_executions.begin_create( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py index 4e1b6272194d..f2eba0db6430 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py @@ -25,7 +25,7 @@ def test_job_private_endpoints_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_job_private_endpoints_get(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,7 +60,7 @@ def test_job_private_endpoints_begin_create_or_update(self, resource_group): "targetServerAzureResourceId": "str", "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,7 +74,7 @@ def test_job_private_endpoints_begin_delete(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py index 5e8857c4192d..aed89ef15c84 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py @@ -26,7 +26,7 @@ async def test_job_private_endpoints_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_job_private_endpoints_get(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ async def test_job_private_endpoints_begin_create_or_update(self, resource_group "targetServerAzureResourceId": "str", "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +78,7 @@ async def test_job_private_endpoints_begin_delete(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py index d4c668a71735..554d3f1c46dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py @@ -27,7 +27,7 @@ def test_job_step_executions_list_by_job_execution(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -43,7 +43,7 @@ def test_job_step_executions_get(self, resource_group): job_name="str", job_execution_id="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py index 5eae04256e5f..c99a378945b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py @@ -28,7 +28,7 @@ async def test_job_step_executions_list_by_job_execution(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_job_step_executions_get(self, resource_group): job_name="str", job_execution_id="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py index b11054b20b36..eb887005dac0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py @@ -18,37 +18,6 @@ class TestSqlManagementJobStepsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_steps_list_by_version(self, resource_group): - response = self.client.job_steps.list_by_version( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - job_version=0, - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_steps_get_by_version(self, resource_group): - response = self.client.job_steps.get_by_version( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - job_version=0, - step_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_job_steps_list_by_job(self, resource_group): @@ -57,7 +26,7 @@ def test_job_steps_list_by_job(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -72,7 +41,7 @@ def test_job_steps_get(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -100,10 +69,10 @@ def test_job_steps_create_or_update(self, resource_group): "id": "str", "name": "str", "output": { - "credential": "str", "databaseName": "str", "serverName": "str", "tableName": "str", + "credential": "str", "resourceGroupName": "str", "schemaName": "dbo", "subscriptionId": "str", @@ -113,7 +82,7 @@ def test_job_steps_create_or_update(self, resource_group): "targetGroup": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -128,7 +97,38 @@ def test_job_steps_delete(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_steps_list_by_version(self, resource_group): + response = self.client.job_steps.list_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_steps_get_by_version(self, resource_group): + response = self.client.job_steps.get_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + step_name="str", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py index 982064a9c7b9..c44c0bf28037 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py @@ -19,37 +19,6 @@ class TestSqlManagementJobStepsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_steps_list_by_version(self, resource_group): - response = self.client.job_steps.list_by_version( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - job_version=0, - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_steps_get_by_version(self, resource_group): - response = await self.client.job_steps.get_by_version( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - job_version=0, - step_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_job_steps_list_by_job(self, resource_group): @@ -58,7 +27,7 @@ async def test_job_steps_list_by_job(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -73,7 +42,7 @@ async def test_job_steps_get(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -101,10 +70,10 @@ async def test_job_steps_create_or_update(self, resource_group): "id": "str", "name": "str", "output": { - "credential": "str", "databaseName": "str", "serverName": "str", "tableName": "str", + "credential": "str", "resourceGroupName": "str", "schemaName": "dbo", "subscriptionId": "str", @@ -114,7 +83,7 @@ async def test_job_steps_create_or_update(self, resource_group): "targetGroup": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -129,7 +98,38 @@ async def test_job_steps_delete(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_steps_list_by_version(self, resource_group): + response = self.client.job_steps.list_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_steps_get_by_version(self, resource_group): + response = await self.client.job_steps.get_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + step_name="str", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py index 9d24d373f218..b195eeb9aa90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py @@ -20,14 +20,15 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_target_executions_list_by_job_execution(self, resource_group): - response = self.client.job_target_executions.list_by_job_execution( + def test_job_target_executions_list_by_step(self, resource_group): + response = self.client.job_target_executions.list_by_step( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + step_name="str", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -35,33 +36,32 @@ def test_job_target_executions_list_by_job_execution(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_target_executions_list_by_step(self, resource_group): - response = self.client.job_target_executions.list_by_step( + def test_job_target_executions_get(self, resource_group): + response = self.client.job_target_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - api_version="2020-11-01-preview", + target_id="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_target_executions_get(self, resource_group): - response = self.client.job_target_executions.get( + def test_job_target_executions_list_by_job_execution(self, resource_group): + response = self.client.job_target_executions.list_by_job_execution( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - step_name="str", - target_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py index 4c79a338dfa3..c1d5a62d0579 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py @@ -21,14 +21,15 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_target_executions_list_by_job_execution(self, resource_group): - response = self.client.job_target_executions.list_by_job_execution( + async def test_job_target_executions_list_by_step(self, resource_group): + response = self.client.job_target_executions.list_by_step( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2020-11-01-preview", + step_name="str", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -36,33 +37,32 @@ async def test_job_target_executions_list_by_job_execution(self, resource_group) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_target_executions_list_by_step(self, resource_group): - response = self.client.job_target_executions.list_by_step( + async def test_job_target_executions_get(self, resource_group): + response = await self.client.job_target_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - api_version="2020-11-01-preview", + target_id="str", + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_target_executions_get(self, resource_group): - response = await self.client.job_target_executions.get( + async def test_job_target_executions_list_by_job_execution(self, resource_group): + response = self.client.job_target_executions.list_by_job_execution( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - step_name="str", - target_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py index 0e5c67afbe68..54cd9dda8d00 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py @@ -25,7 +25,7 @@ def test_job_target_groups_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_job_target_groups_get(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_job_target_groups_create_or_update(self, resource_group): "name": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -83,7 +83,7 @@ def test_job_target_groups_delete(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py index fdee974b4793..6250e925b256 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py @@ -26,7 +26,7 @@ async def test_job_target_groups_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_job_target_groups_get(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_job_target_groups_create_or_update(self, resource_group): "name": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -84,7 +84,7 @@ async def test_job_target_groups_delete(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py index 71becdd28580..687e69019231 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py @@ -26,7 +26,7 @@ def test_job_versions_list_by_job(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_job_versions_get(self, resource_group): job_agent_name="str", job_name="str", job_version=0, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py index 7f969279da7a..fe769d9ba337 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py @@ -27,7 +27,7 @@ async def test_job_versions_list_by_job(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_job_versions_get(self, resource_group): job_agent_name="str", job_name="str", job_version=0, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py index feb9ff0d48b7..029818e3b17a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py @@ -25,7 +25,7 @@ def test_jobs_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_jobs_get(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,15 +59,15 @@ def test_jobs_create_or_update(self, resource_group): "name": "str", "schedule": { "enabled": bool, - "endTime": "9999-12-31T11:59:59+00:00", + "endTime": "9999-12-31T03:59:59-08:00", "interval": "str", - "startTime": "0001-01-01T00:00:00+00:00", + "startTime": "0001-01-01T16:00:00-08:00", "type": "Once", }, "type": "str", "version": 0, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,7 +81,7 @@ def test_jobs_delete(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py index dcc56a7a60a1..92b4bdd5c228 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py @@ -26,7 +26,7 @@ async def test_jobs_list_by_agent(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_jobs_get(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,15 +60,15 @@ async def test_jobs_create_or_update(self, resource_group): "name": "str", "schedule": { "enabled": bool, - "endTime": "9999-12-31T11:59:59+00:00", + "endTime": "9999-12-31T03:59:59-08:00", "interval": "str", - "startTime": "0001-01-01T00:00:00+00:00", + "startTime": "0001-01-01T16:00:00-08:00", "type": "Once", }, "type": "str", "version": 0, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ async def test_jobs_delete(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py index fa433bae2b18..a5ad781bf108 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py @@ -20,43 +20,43 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_get(self, resource_group): - response = self.client.ledger_digest_uploads.get( + def test_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.ledger_digest_uploads.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - ledger_digest_uploads="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_begin_create_or_update(self, resource_group): - response = self.client.ledger_digest_uploads.begin_create_or_update( + def test_ledger_digest_uploads_get(self, resource_group): + response = self.client.ledger_digest_uploads.get( resource_group_name=resource_group.name, server_name="str", database_name="str", ledger_digest_uploads="str", - parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2021-02-01-preview", - ).result() # call '.result()' to poll until service return final result + api_version="2025-01-01", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.ledger_digest_uploads.list_by_database( + def test_ledger_digest_uploads_begin_create_or_update(self, resource_group): + response = self.client.ledger_digest_uploads.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2021-02-01-preview", - ) - result = [r for r in response] + ledger_digest_uploads="str", + parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @@ -68,7 +68,7 @@ def test_ledger_digest_uploads_begin_disable(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py index 2e467e98f33a..fbe2dd49f958 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementLedgerDigestUploadsOperationsAsync(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.ledger_digest_uploads.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_ledger_digest_uploads_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_ledger_digest_uploads_get(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -43,26 +56,13 @@ async def test_ledger_digest_uploads_begin_create_or_update(self, resource_group database_name="str", ledger_digest_uploads="str", parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.ledger_digest_uploads.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2021-02-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_ledger_digest_uploads_begin_disable(self, resource_group): @@ -72,7 +72,7 @@ async def test_ledger_digest_uploads_begin_disable(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py index 4716e5b4affb..7f2a8d1266a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_long_term_retention_backups_list_by_location(self, resource_group): response = self.client.long_term_retention_backups.list_by_location( location_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_long_term_retention_backups_list_by_server(self, resource_group): response = self.client.long_term_retention_backups.list_by_server( location_name="str", long_term_retention_server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -48,7 +48,7 @@ def test_long_term_retention_backups_list_by_database(self, resource_group): location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -62,7 +62,7 @@ def test_long_term_retention_backups_get(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,7 +76,7 @@ def test_long_term_retention_backups_begin_delete(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -91,7 +91,7 @@ def test_long_term_retention_backups_begin_change_access_tier(self, resource_gro long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -113,7 +113,7 @@ def test_long_term_retention_backups_begin_copy(self, resource_group): "targetServerResourceId": "str", "targetSubscriptionId": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -127,7 +127,7 @@ def test_long_term_retention_backups_begin_lock_time_based_immutability(self, re long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -141,7 +141,7 @@ def test_long_term_retention_backups_begin_remove_legal_hold_immutability(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -155,7 +155,7 @@ def test_long_term_retention_backups_begin_remove_time_based_immutability(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -169,7 +169,7 @@ def test_long_term_retention_backups_begin_set_legal_hold_immutability(self, res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -184,7 +184,7 @@ def test_long_term_retention_backups_begin_update(self, resource_group): long_term_retention_database_name="str", backup_name="str", parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -196,7 +196,7 @@ def test_long_term_retention_backups_list_by_resource_group_location(self, resou response = self.client.long_term_retention_backups.list_by_resource_group_location( resource_group_name=resource_group.name, location_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -209,7 +209,7 @@ def test_long_term_retention_backups_list_by_resource_group_server(self, resourc resource_group_name=resource_group.name, location_name="str", long_term_retention_server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -223,7 +223,7 @@ def test_long_term_retention_backups_list_by_resource_group_database(self, resou location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -238,7 +238,7 @@ def test_long_term_retention_backups_get_by_resource_group(self, resource_group) long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -253,7 +253,7 @@ def test_long_term_retention_backups_begin_delete_by_resource_group(self, resour long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -269,7 +269,7 @@ def test_long_term_retention_backups_begin_change_access_tier_by_resource_group( long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -292,7 +292,7 @@ def test_long_term_retention_backups_begin_copy_by_resource_group(self, resource "targetServerResourceId": "str", "targetSubscriptionId": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -307,7 +307,7 @@ def test_long_term_retention_backups_begin_lock_time_based_immutability_by_resou long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -322,7 +322,7 @@ def test_long_term_retention_backups_begin_remove_legal_hold_immutability_by_res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -337,7 +337,7 @@ def test_long_term_retention_backups_begin_remove_time_based_immutability_by_res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -352,7 +352,7 @@ def test_long_term_retention_backups_begin_set_legal_hold_immutability_by_resour long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -368,7 +368,7 @@ def test_long_term_retention_backups_begin_update_by_resource_group(self, resour long_term_retention_database_name="str", backup_name="str", parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py index 2b1a6be21192..11720e8f8996 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_long_term_retention_backups_list_by_location(self, resource_group): response = self.client.long_term_retention_backups.list_by_location( location_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_long_term_retention_backups_list_by_server(self, resource_group): response = self.client.long_term_retention_backups.list_by_server( location_name="str", long_term_retention_server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -49,7 +49,7 @@ async def test_long_term_retention_backups_list_by_database(self, resource_group location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -63,7 +63,7 @@ async def test_long_term_retention_backups_get(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -78,7 +78,7 @@ async def test_long_term_retention_backups_begin_delete(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -95,7 +95,7 @@ async def test_long_term_retention_backups_begin_change_access_tier(self, resour long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -119,7 +119,7 @@ async def test_long_term_retention_backups_begin_copy(self, resource_group): "targetServerResourceId": "str", "targetSubscriptionId": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -135,7 +135,7 @@ async def test_long_term_retention_backups_begin_lock_time_based_immutability(se long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -151,7 +151,7 @@ async def test_long_term_retention_backups_begin_remove_legal_hold_immutability( long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -167,7 +167,7 @@ async def test_long_term_retention_backups_begin_remove_time_based_immutability( long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -183,7 +183,7 @@ async def test_long_term_retention_backups_begin_set_legal_hold_immutability(sel long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -200,7 +200,7 @@ async def test_long_term_retention_backups_begin_update(self, resource_group): long_term_retention_database_name="str", backup_name="str", parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -213,7 +213,7 @@ async def test_long_term_retention_backups_list_by_resource_group_location(self, response = self.client.long_term_retention_backups.list_by_resource_group_location( resource_group_name=resource_group.name, location_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -226,7 +226,7 @@ async def test_long_term_retention_backups_list_by_resource_group_server(self, r resource_group_name=resource_group.name, location_name="str", long_term_retention_server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -240,7 +240,7 @@ async def test_long_term_retention_backups_list_by_resource_group_database(self, location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -255,7 +255,7 @@ async def test_long_term_retention_backups_get_by_resource_group(self, resource_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -271,7 +271,7 @@ async def test_long_term_retention_backups_begin_delete_by_resource_group(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -289,7 +289,7 @@ async def test_long_term_retention_backups_begin_change_access_tier_by_resource_ long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -314,7 +314,7 @@ async def test_long_term_retention_backups_begin_copy_by_resource_group(self, re "targetServerResourceId": "str", "targetSubscriptionId": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -333,7 +333,7 @@ async def test_long_term_retention_backups_begin_lock_time_based_immutability_by long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -352,7 +352,7 @@ async def test_long_term_retention_backups_begin_remove_legal_hold_immutability_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -371,7 +371,7 @@ async def test_long_term_retention_backups_begin_remove_time_based_immutability_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -390,7 +390,7 @@ async def test_long_term_retention_backups_begin_set_legal_hold_immutability_by_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -408,7 +408,7 @@ async def test_long_term_retention_backups_begin_update_by_resource_group(self, long_term_retention_database_name="str", backup_name="str", parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py index e0dcc7cc9b03..742068cffcb7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py @@ -18,6 +18,30 @@ class TestSqlManagementLongTermRetentionManagedInstanceBackupsOperations(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_location( + location_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_database( + location_name="str", + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_long_term_retention_managed_instance_backups_get(self, resource_group): @@ -26,7 +50,7 @@ def test_long_term_retention_managed_instance_backups_get(self, resource_group): managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,7 +64,7 @@ def test_long_term_retention_managed_instance_backups_begin_delete(self, resourc managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -48,12 +72,11 @@ def test_long_term_retention_managed_instance_backups_begin_delete(self, resourc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_database( + def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_instance( location_name="str", managed_instance_name="str", - database_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -61,11 +84,11 @@ def test_long_term_retention_managed_instance_backups_list_by_database(self, res @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_instance( + def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( + resource_group_name=resource_group.name, location_name="str", - managed_instance_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -73,10 +96,13 @@ def test_long_term_retention_managed_instance_backups_list_by_instance(self, res @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_location( + def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name=resource_group.name, location_name="str", - api_version="2021-05-01-preview", + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -91,7 +117,7 @@ def test_long_term_retention_managed_instance_backups_get_by_resource_group(self managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -106,26 +132,12 @@ def test_long_term_retention_managed_instance_backups_begin_delete_by_resource_g managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( - resource_group_name=resource_group.name, - location_name="str", - managed_instance_name="str", - database_name="str", - api_version="2021-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_long_term_retention_managed_instance_backups_list_by_resource_group_instance(self, resource_group): @@ -133,19 +145,7 @@ def test_long_term_retention_managed_instance_backups_list_by_resource_group_ins resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", - api_version="2021-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py index 628cebf3e3a5..7f33f7f3668a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py @@ -19,6 +19,30 @@ class TestSqlManagementLongTermRetentionManagedInstanceBackupsOperationsAsync(Az def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_location( + location_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_database( + location_name="str", + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_long_term_retention_managed_instance_backups_get(self, resource_group): @@ -27,7 +51,7 @@ async def test_long_term_retention_managed_instance_backups_get(self, resource_g managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -42,7 +66,7 @@ async def test_long_term_retention_managed_instance_backups_begin_delete(self, r managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -51,12 +75,11 @@ async def test_long_term_retention_managed_instance_backups_begin_delete(self, r @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_database( + async def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_instance( location_name="str", managed_instance_name="str", - database_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -64,11 +87,11 @@ async def test_long_term_retention_managed_instance_backups_list_by_database(sel @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_instance( + async def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( + resource_group_name=resource_group.name, location_name="str", - managed_instance_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -76,10 +99,13 @@ async def test_long_term_retention_managed_instance_backups_list_by_instance(sel @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_location( + async def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name=resource_group.name, location_name="str", - api_version="2021-05-01-preview", + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -94,7 +120,7 @@ async def test_long_term_retention_managed_instance_backups_get_by_resource_grou managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -110,27 +136,13 @@ async def test_long_term_retention_managed_instance_backups_begin_delete_by_reso managed_instance_name="str", database_name="str", backup_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( - resource_group_name=resource_group.name, - location_name="str", - managed_instance_name="str", - database_name="str", - api_version="2021-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_long_term_retention_managed_instance_backups_list_by_resource_group_instance(self, resource_group): @@ -138,19 +150,7 @@ async def test_long_term_retention_managed_instance_backups_list_by_resource_gro resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", - api_version="2021-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py index d994095ca7bf..cecf09bbe399 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py @@ -25,7 +25,7 @@ def test_long_term_retention_policies_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_long_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_long_term_retention_policies_begin_create_or_update(self, resource_grou "weeklyRetention": "str", "yearlyRetention": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py index 0b7490e11573..6a209f788279 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py @@ -26,7 +26,7 @@ async def test_long_term_retention_policies_list_by_database(self, resource_grou resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_long_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ async def test_long_term_retention_policies_begin_create_or_update(self, resourc "weeklyRetention": "str", "yearlyRetention": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py index 58f069840ef3..b57ea52c6184 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py @@ -26,7 +26,7 @@ def test_maintenance_window_options_get(self, resource_group): server_name="str", database_name="str", maintenance_window_options_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py index b689406046a9..e006129ca3d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py @@ -27,7 +27,7 @@ async def test_maintenance_window_options_get(self, resource_group): server_name="str", database_name="str", maintenance_window_options_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py index f7dd56f94e21..ab29810069d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py @@ -26,7 +26,7 @@ def test_maintenance_windows_get(self, resource_group): server_name="str", database_name="str", maintenance_window_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ def test_maintenance_windows_create_or_update(self, resource_group): "timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py index 3af1fad351d6..85c9eb23212d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py @@ -27,7 +27,7 @@ async def test_maintenance_windows_get(self, resource_group): server_name="str", database_name="str", maintenance_window_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +47,7 @@ async def test_maintenance_windows_create_or_update(self, resource_group): "timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py index 4640ecf1bb72..3540f8daf795 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementManagedBackupShortTermRetentionPoliciesOperations(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_backup_short_term_retention_policies_get(self, resource_group): @@ -26,7 +39,7 @@ def test_managed_backup_short_term_retention_policies_get(self, resource_group): managed_instance_name="str", database_name="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +54,7 @@ def test_managed_backup_short_term_retention_policies_begin_create_or_update(sel database_name="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -56,21 +69,8 @@ def test_managed_backup_short_term_retention_policies_begin_update(self, resourc database_name="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py index dba67bf9b180..cc87af6a551b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementManagedBackupShortTermRetentionPoliciesOperationsAsync(Az def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_backup_short_term_retention_policies_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_managed_backup_short_term_retention_policies_get(self, resource_g managed_instance_name="str", database_name="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -43,7 +56,7 @@ async def test_managed_backup_short_term_retention_policies_begin_create_or_upda database_name="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -60,22 +73,9 @@ async def test_managed_backup_short_term_retention_policies_begin_update(self, r database_name="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py index 8af4d7f892e9..5f2b94e74974 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py @@ -25,7 +25,7 @@ def test_managed_database_advanced_threat_protection_settings_list_by_database(s resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_managed_database_advanced_threat_protection_settings_get(self, resource managed_instance_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_managed_database_advanced_threat_protection_settings_create_or_update(s }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py index 0b5fc607e665..06a50c7851fc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py @@ -26,7 +26,7 @@ async def test_managed_database_advanced_threat_protection_settings_list_by_data resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_managed_database_advanced_threat_protection_settings_get(self, re managed_instance_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_managed_database_advanced_threat_protection_settings_create_or_up }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py index 109b62b037e5..54bcc5341c9f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py @@ -25,7 +25,7 @@ def test_managed_database_columns_list_by_database(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ def test_managed_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_managed_database_columns_get(self, resource_group): schema_name="str", table_name="str", column_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py index e7a9182a06dc..228a9c6b30c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py @@ -26,7 +26,7 @@ async def test_managed_database_columns_list_by_database(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ async def test_managed_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ async def test_managed_database_columns_get(self, resource_group): schema_name="str", table_name="str", column_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py index a33e6f053aed..e74e4b3b100b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py @@ -24,7 +24,7 @@ def test_managed_database_move_operations_list_by_location(self, resource_group) response = self.client.managed_database_move_operations.list_by_location( resource_group_name=resource_group.name, location_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_database_move_operations_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", operation_id="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py index 16cf1b5ee9a8..2dd41a6bed40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_database_move_operations_list_by_location(self, resource_ response = self.client.managed_database_move_operations.list_by_location( resource_group_name=resource_group.name, location_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_database_move_operations_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", operation_id="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py index cefa10f54851..0af5dddf3e09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py @@ -26,7 +26,7 @@ def test_managed_database_queries_get(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,7 +40,7 @@ def test_managed_database_queries_list_by_query(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py index 8988d0d031c9..4740900f574a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py @@ -27,7 +27,7 @@ async def test_managed_database_queries_get(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +41,7 @@ async def test_managed_database_queries_list_by_query(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py index bc6f8ea7abae..cb6d532307db 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py @@ -38,7 +38,7 @@ def test_managed_database_recommended_sensitivity_labels_update(self, resource_g } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py index 54c0dd25683a..1c37de1507ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py @@ -39,7 +39,7 @@ async def test_managed_database_recommended_sensitivity_labels_update(self, reso } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py index 52dc919fd6f8..bd0907b34c0f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py @@ -26,7 +26,7 @@ def test_managed_database_restore_details_get(self, resource_group): managed_instance_name="str", database_name="str", restore_details_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py index f5e3e1d657f0..756e96688243 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py @@ -27,7 +27,7 @@ async def test_managed_database_restore_details_get(self, resource_group): managed_instance_name="str", database_name="str", restore_details_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py index b9787152f37d..6c40f62b9822 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py @@ -25,7 +25,7 @@ def test_managed_database_schemas_list_by_database(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_managed_database_schemas_get(self, resource_group): managed_instance_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py index 7e94e6926e4b..45d6ceebdd1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py @@ -26,7 +26,7 @@ async def test_managed_database_schemas_list_by_database(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_managed_database_schemas_get(self, resource_group): managed_instance_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py index 61ed6b296283..b58053ae58a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementManagedDatabaseSecurityAlertPoliciesOperations(AzureMgmtR def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.managed_database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_database_security_alert_policies_get(self, resource_group): @@ -26,7 +39,7 @@ def test_managed_database_security_alert_policies_get(self, resource_group): managed_instance_name="str", database_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,21 +66,8 @@ def test_managed_database_security_alert_policies_create_or_update(self, resourc "storageEndpoint": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.managed_database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py index 93ba32dd3e26..31e1cacd63be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementManagedDatabaseSecurityAlertPoliciesOperationsAsync(Azure def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.managed_database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_database_security_alert_policies_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_managed_database_security_alert_policies_get(self, resource_group managed_instance_name="str", database_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,21 +67,8 @@ async def test_managed_database_security_alert_policies_create_or_update(self, r "storageEndpoint": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.managed_database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py index f384fcc7c123..6756e6d10150 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py @@ -25,7 +25,7 @@ def test_managed_database_security_events_list_by_database(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py index d2cb171f098e..df0b9d707b82 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py @@ -26,7 +26,7 @@ async def test_managed_database_security_events_list_by_database(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py index 2c5dd67a1254..1d42ea5c151c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py @@ -18,6 +18,74 @@ class TestSqlManagementManagedDatabaseSensitivityLabelsOperations(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_current_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_sensitivity_labels_update(self, resource_group): + response = self.client.managed_database_sensitivity_labels.update( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + parameters={ + "operations": [ + { + "column": "str", + "id": "str", + "name": "str", + "op": "str", + "schema": "str", + "sensitivityLabel": { + "clientClassificationSource": "str", + "columnName": "str", + "id": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "managedBy": "str", + "name": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + "type": "str", + }, + "table": "str", + "type": "str", + } + ] + }, + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_database_sensitivity_labels_get(self, resource_group): @@ -29,7 +97,7 @@ def test_managed_database_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,6 +114,7 @@ def test_managed_database_sensitivity_labels_create_or_update(self, resource_gro table_name="str", column_name="str", parameters={ + "clientClassificationSource": "str", "columnName": "str", "id": "str", "informationType": "str", @@ -61,7 +130,7 @@ def test_managed_database_sensitivity_labels_create_or_update(self, resource_gro "type": "str", }, sensitivity_label_source="current", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -78,7 +147,7 @@ def test_managed_database_sensitivity_labels_delete(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="current", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -95,7 +164,7 @@ def test_managed_database_sensitivity_labels_disable_recommendation(self, resour table_name="str", column_name="str", sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -112,7 +181,7 @@ def test_managed_database_sensitivity_labels_enable_recommendation(self, resourc table_name="str", column_name="str", sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -120,66 +189,12 @@ def test_managed_database_sensitivity_labels_enable_recommendation(self, resourc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_current_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_sensitivity_labels_update(self, resource_group): - response = self.client.managed_database_sensitivity_labels.update( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - parameters={ - "operations": [ - { - "column": "str", - "id": "str", - "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - "table": "str", - "type": "str", - } - ] - }, - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + def test_managed_database_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py index fe12cbc9778f..d41528504737 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py @@ -19,6 +19,74 @@ class TestSqlManagementManagedDatabaseSensitivityLabelsOperationsAsync(AzureMgmt def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_current_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_sensitivity_labels_update(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.update( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + parameters={ + "operations": [ + { + "column": "str", + "id": "str", + "name": "str", + "op": "str", + "schema": "str", + "sensitivityLabel": { + "clientClassificationSource": "str", + "columnName": "str", + "id": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "managedBy": "str", + "name": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + "type": "str", + }, + "table": "str", + "type": "str", + } + ] + }, + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_database_sensitivity_labels_get(self, resource_group): @@ -30,7 +98,7 @@ async def test_managed_database_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,6 +115,7 @@ async def test_managed_database_sensitivity_labels_create_or_update(self, resour table_name="str", column_name="str", parameters={ + "clientClassificationSource": "str", "columnName": "str", "id": "str", "informationType": "str", @@ -62,7 +131,7 @@ async def test_managed_database_sensitivity_labels_create_or_update(self, resour "type": "str", }, sensitivity_label_source="current", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -79,7 +148,7 @@ async def test_managed_database_sensitivity_labels_delete(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="current", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -96,7 +165,7 @@ async def test_managed_database_sensitivity_labels_disable_recommendation(self, table_name="str", column_name="str", sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -113,7 +182,7 @@ async def test_managed_database_sensitivity_labels_enable_recommendation(self, r table_name="str", column_name="str", sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -121,66 +190,12 @@ async def test_managed_database_sensitivity_labels_enable_recommendation(self, r @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_current_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_update(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.update( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - parameters={ - "operations": [ - { - "column": "str", - "id": "str", - "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - "table": "str", - "type": "str", - } - ] - }, - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + async def test_managed_database_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py index 372f578580b7..787e580c9882 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py @@ -26,7 +26,7 @@ def test_managed_database_tables_list_by_schema(self, resource_group): managed_instance_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_managed_database_tables_get(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py index 3f4bd8bbfa64..b70d190aa2f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py @@ -27,7 +27,7 @@ async def test_managed_database_tables_list_by_schema(self, resource_group): managed_instance_name="str", database_name="str", schema_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_managed_database_tables_get(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py index 49784755fbf9..cfe148a1d5f5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py @@ -20,28 +20,26 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_get(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.get( + def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - tde_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.create_or_update( + def test_managed_database_transparent_data_encryption_get(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,13 +47,15 @@ def test_managed_database_transparent_data_encryption_create_or_update(self, res @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.list_by_database( + def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + tde_name="str", + parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py index b8a884d0f02a..93044236e3d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py @@ -21,28 +21,26 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_get(self, resource_group): - response = await self.client.managed_database_transparent_data_encryption.get( + async def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - tde_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): - response = await self.client.managed_database_transparent_data_encryption.create_or_update( + async def test_managed_database_transparent_data_encryption_get(self, resource_group): + response = await self.client.managed_database_transparent_data_encryption.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,13 +48,15 @@ async def test_managed_database_transparent_data_encryption_create_or_update(sel @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.list_by_database( + async def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): + response = await self.client.managed_database_transparent_data_encryption.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", + tde_name="str", + parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py index ccd5b0cf9363..412ffad28b0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -28,7 +28,7 @@ def test_managed_database_vulnerability_assessment_rule_baselines_get(self, reso vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_managed_database_vulnerability_assessment_rule_baselines_create_or_upda rule_id="str", baseline_name="str", parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ def test_managed_database_vulnerability_assessment_rule_baselines_delete(self, r vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py index 8a67c0272453..191440b59171 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py @@ -29,7 +29,7 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_get(self vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_create_o rule_id="str", baseline_name="str", parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_delete(s vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py index 123e56446b8d..bb55040ad192 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py @@ -20,29 +20,28 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( + def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result - + api_version="2025-01-01", + ) + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_export(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.export( + def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,29 +49,30 @@ def test_managed_database_vulnerability_assessment_scans_export(self, resource_g @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( + def test_managed_database_vulnerability_assessment_scans_export(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.export( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + scan_id="str", + api_version="2025-01-01", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.get( + def test_managed_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", - ) + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py index d9728882a296..b02c50aaeb96 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py @@ -21,31 +21,28 @@ def setup_method(self, method): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): - response = await ( - await self.client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - vulnerability_assessment_name="str", - scan_id="str", - api_version="2020-11-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - + async def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + vulnerability_assessment_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_export(self, resource_group): - response = await self.client.managed_database_vulnerability_assessment_scans.export( + async def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): + response = await self.client.managed_database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,29 +50,32 @@ async def test_managed_database_vulnerability_assessment_scans_export(self, reso @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( + async def test_managed_database_vulnerability_assessment_scans_export(self, resource_group): + response = await self.client.managed_database_vulnerability_assessment_scans.export( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + scan_id="str", + api_version="2025-01-01", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): - response = await self.client.managed_database_vulnerability_assessment_scans.get( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - vulnerability_assessment_name="str", - scan_id="str", - api_version="2020-11-01-preview", - ) + async def test_managed_database_vulnerability_assessment_scans_begin_initiate_scan(self, resource_group): + response = await ( + await self.client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + vulnerability_assessment_name="str", + scan_id="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py index 30ef65ffec49..c3438f6141cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementManagedDatabaseVulnerabilityAssessmentsOperations(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_database_vulnerability_assessments_get(self, resource_group): @@ -26,7 +39,7 @@ def test_managed_database_vulnerability_assessments_get(self, resource_group): managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,7 +62,7 @@ def test_managed_database_vulnerability_assessments_create_or_update(self, resou "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -63,21 +76,8 @@ def test_managed_database_vulnerability_assessments_delete(self, resource_group) managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py index fd7f67a8acfd..b24358ecdd72 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementManagedDatabaseVulnerabilityAssessmentsOperationsAsync(Az def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_database_vulnerability_assessments_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_managed_database_vulnerability_assessments_get(self, resource_gro managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +63,7 @@ async def test_managed_database_vulnerability_assessments_create_or_update(self, "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,21 +77,8 @@ async def test_managed_database_vulnerability_assessments_delete(self, resource_ managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py index 8edb91568806..87cabee6752d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py @@ -24,7 +24,7 @@ def test_managed_databases_list_by_instance(self, resource_group): response = self.client.managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,6 +62,12 @@ def test_managed_databases_begin_create_or_update(self, resource_group): "crossSubscriptionTargetManagedInstanceId": "str", "defaultSecondaryLocation": "str", "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, "failoverGroupId": "str", "id": "str", "isLedgerOn": bool, @@ -79,7 +85,7 @@ def test_managed_databases_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,7 +98,7 @@ def test_managed_databases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -116,6 +122,12 @@ def test_managed_databases_begin_update(self, resource_group): "crossSubscriptionTargetManagedInstanceId": "str", "defaultSecondaryLocation": "str", "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, "failoverGroupId": "str", "isLedgerOn": bool, "lastBackupName": "str", @@ -130,7 +142,7 @@ def test_managed_databases_begin_update(self, resource_group): "storageContainerUri": "str", "tags": {"str": "str"}, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -144,7 +156,7 @@ def test_managed_databases_begin_cancel_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -158,7 +170,7 @@ def test_managed_databases_begin_complete_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -172,7 +184,20 @@ def test_managed_databases_begin_complete_restore(self, resource_group): managed_instance_name="str", database_name="str", parameters={"lastBackupName": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_databases_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = self.client.managed_databases.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -186,7 +211,7 @@ def test_managed_databases_begin_start_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str", "operationMode": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -198,7 +223,7 @@ def test_managed_databases_list_inaccessible_by_instance(self, resource_group): response = self.client.managed_databases.list_inaccessible_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py index 170ff5f896fe..71236e4a65de 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_databases_list_by_instance(self, resource_group): response = self.client.managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,6 +64,12 @@ async def test_managed_databases_begin_create_or_update(self, resource_group): "crossSubscriptionTargetManagedInstanceId": "str", "defaultSecondaryLocation": "str", "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, "failoverGroupId": "str", "id": "str", "isLedgerOn": bool, @@ -81,7 +87,7 @@ async def test_managed_databases_begin_create_or_update(self, resource_group): "tags": {"str": "str"}, "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -96,7 +102,7 @@ async def test_managed_databases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -122,6 +128,12 @@ async def test_managed_databases_begin_update(self, resource_group): "crossSubscriptionTargetManagedInstanceId": "str", "defaultSecondaryLocation": "str", "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, "failoverGroupId": "str", "isLedgerOn": bool, "lastBackupName": "str", @@ -136,7 +148,7 @@ async def test_managed_databases_begin_update(self, resource_group): "storageContainerUri": "str", "tags": {"str": "str"}, }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -152,7 +164,7 @@ async def test_managed_databases_begin_cancel_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -168,7 +180,7 @@ async def test_managed_databases_begin_complete_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -184,7 +196,22 @@ async def test_managed_databases_begin_complete_restore(self, resource_group): managed_instance_name="str", database_name="str", parameters={"lastBackupName": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_databases_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = await ( + await self.client.managed_databases.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -200,7 +227,7 @@ async def test_managed_databases_begin_start_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str", "operationMode": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -213,7 +240,7 @@ async def test_managed_databases_list_inaccessible_by_instance(self, resource_gr response = self.client.managed_databases.list_inaccessible_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py index b4720a72b44b..eff0cd579a25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_administrators_list_by_instance(self, resource_group): response = self.client.managed_instance_administrators.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_administrators_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ def test_managed_instance_administrators_begin_create_or_update(self, resource_g "tenantId": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,7 +72,7 @@ def test_managed_instance_administrators_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py index 6199c44820f1..dfd16aa59ab8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_administrators_list_by_instance(self, resource_g response = self.client.managed_instance_administrators.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_administrators_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ async def test_managed_instance_administrators_begin_create_or_update(self, reso "tenantId": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -76,7 +76,7 @@ async def test_managed_instance_administrators_begin_delete(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py index 8eda99ed16b3..992c5f866859 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_advanced_threat_protection_settings_list_by_instance(s response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_advanced_threat_protection_settings_get(self, resource resource_group_name=resource_group.name, managed_instance_name="str", advanced_threat_protection_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_managed_instance_advanced_threat_protection_settings_begin_create_or_up }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py index 1bcad0c66602..433bb93a4d95 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_advanced_threat_protection_settings_list_by_inst response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_advanced_threat_protection_settings_get(self, re resource_group_name=resource_group.name, managed_instance_name="str", advanced_threat_protection_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ async def test_managed_instance_advanced_threat_protection_settings_begin_create }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py index f128bd387c81..3dbf3e6d925b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementManagedInstanceAzureADOnlyAuthenticationsOperations(Azure def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): + response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_azure_ad_only_authentications_get(self, resource_group): @@ -25,7 +37,7 @@ def test_managed_instance_azure_ad_only_authentications_get(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -39,7 +51,7 @@ def test_managed_instance_azure_ad_only_authentications_begin_create_or_update(s managed_instance_name="str", authentication_name="str", parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -52,20 +64,8 @@ def test_managed_instance_azure_ad_only_authentications_begin_delete(self, resou resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): - response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py index 18f6e5c838d5..75d5dfdcc5d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementManagedInstanceAzureADOnlyAuthenticationsOperationsAsync( def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): + response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_azure_ad_only_authentications_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_managed_instance_azure_ad_only_authentications_get(self, resource resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +53,7 @@ async def test_managed_instance_azure_ad_only_authentications_begin_create_or_up managed_instance_name="str", authentication_name="str", parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -56,21 +68,9 @@ async def test_managed_instance_azure_ad_only_authentications_begin_delete(self, resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): - response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py index 54c9a0e7afd1..0b9c83977ac9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_dtcs_list_by_managed_instance(self, resource_group): response = self.client.managed_instance_dtcs.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_dtcs_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dtc_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ def test_managed_instance_dtcs_begin_create_or_update(self, resource_group): }, "type": "str", }, - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py index dce21860d607..b5c0544f3a8d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_dtcs_list_by_managed_instance(self, resource_gro response = self.client.managed_instance_dtcs.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_dtcs_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dtc_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,7 +72,7 @@ async def test_managed_instance_dtcs_begin_create_or_update(self, resource_group }, "type": "str", }, - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py index 62c55bcfe71f..5887aaff3f38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py @@ -18,26 +18,13 @@ class TestSqlManagementManagedInstanceEncryptionProtectorsOperations(AzureMgmtRe def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): - response = self.client.managed_instance_encryption_protectors.begin_revalidate( - resource_group_name=resource_group.name, - managed_instance_name="str", - encryption_protector_name="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): response = self.client.managed_instance_encryption_protectors.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -50,7 +37,7 @@ def test_managed_instance_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -74,7 +61,20 @@ def test_managed_instance_encryption_protectors_begin_create_or_update(self, res "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): + response = self.client.managed_instance_encryption_protectors.begin_revalidate( + resource_group_name=resource_group.name, + managed_instance_name="str", + encryption_protector_name="str", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py index efecbf45e81c..709584fb1bb6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py @@ -19,28 +19,13 @@ class TestSqlManagementManagedInstanceEncryptionProtectorsOperationsAsync(AzureM def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): - response = await ( - await self.client.managed_instance_encryption_protectors.begin_revalidate( - resource_group_name=resource_group.name, - managed_instance_name="str", - encryption_protector_name="str", - api_version="2020-11-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): response = self.client.managed_instance_encryption_protectors.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -53,7 +38,7 @@ async def test_managed_instance_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -78,7 +63,22 @@ async def test_managed_instance_encryption_protectors_begin_create_or_update(sel "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): + response = await ( + await self.client.managed_instance_encryption_protectors.begin_revalidate( + resource_group_name=resource_group.name, + managed_instance_name="str", + encryption_protector_name="str", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py index cb49ae5331e0..0dfa46ceb1bd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_keys_list_by_instance(self, resource_group): response = self.client.managed_instance_keys.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_keys_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,7 +61,7 @@ def test_managed_instance_keys_begin_create_or_update(self, resource_group): "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,7 +74,7 @@ def test_managed_instance_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py index 9d7f8c1582c3..6cb2d5f0c9f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_keys_list_by_instance(self, resource_group): response = self.client.managed_instance_keys.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_keys_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -63,7 +63,7 @@ async def test_managed_instance_keys_begin_create_or_update(self, resource_group "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +78,7 @@ async def test_managed_instance_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py index 626aaf821d2c..fd4412a6203d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementManagedInstanceLongTermRetentionPoliciesOperations(AzureM def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_instance_long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_long_term_retention_policies_get(self, resource_group): @@ -26,7 +39,7 @@ def test_managed_instance_long_term_retention_policies_get(self, resource_group) managed_instance_name="str", database_name="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,6 +54,7 @@ def test_managed_instance_long_term_retention_policies_begin_create_or_update(se database_name="str", policy_name="str", parameters={ + "backupStorageAccessTier": "str", "id": "str", "monthlyRetention": "str", "name": "str", @@ -49,7 +63,7 @@ def test_managed_instance_long_term_retention_policies_begin_create_or_update(se "weeklyRetention": "str", "yearlyRetention": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -57,13 +71,14 @@ def test_managed_instance_long_term_retention_policies_begin_create_or_update(se @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_instance_long_term_retention_policies.list_by_database( + def test_managed_instance_long_term_retention_policies_begin_delete(self, resource_group): + response = self.client.managed_instance_long_term_retention_policies.begin_delete( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] + policy_name="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py index d344d9367a74..2a0cd3444bce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementManagedInstanceLongTermRetentionPoliciesOperationsAsync(A def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_instance_long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_long_term_retention_policies_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_managed_instance_long_term_retention_policies_get(self, resource_ managed_instance_name="str", database_name="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -43,6 +56,7 @@ async def test_managed_instance_long_term_retention_policies_begin_create_or_upd database_name="str", policy_name="str", parameters={ + "backupStorageAccessTier": "str", "id": "str", "monthlyRetention": "str", "name": "str", @@ -51,7 +65,7 @@ async def test_managed_instance_long_term_retention_policies_begin_create_or_upd "weeklyRetention": "str", "yearlyRetention": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -60,13 +74,16 @@ async def test_managed_instance_long_term_retention_policies_begin_create_or_upd @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_instance_long_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] + async def test_managed_instance_long_term_retention_policies_begin_delete(self, resource_group): + response = await ( + await self.client.managed_instance_long_term_retention_policies.begin_delete( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + policy_name="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py index 557af70d53c7..480c2e20d5b1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_operations_list_by_managed_instance(self, resource_gro response = self.client.managed_instance_operations.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_operations_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_managed_instance_operations_cancel(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py index 1b948c0c76b4..5faee62e6334 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_operations_list_by_managed_instance(self, resour response = self.client.managed_instance_operations.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_operations_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,7 +51,7 @@ async def test_managed_instance_operations_cancel(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py index f22c0f136da1..65f9ad65810e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementManagedInstancePrivateEndpointConnectionsOperations(Azure def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_private_endpoint_connections_get(self, resource_group): @@ -25,7 +37,7 @@ def test_managed_instance_private_endpoint_connections_get(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +58,7 @@ def test_managed_instance_private_endpoint_connections_begin_create_or_update(se "provisioningState": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -59,20 +71,8 @@ def test_managed_instance_private_endpoint_connections_begin_delete(self, resour resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py index 9923e9479647..7ddedf4245e4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementManagedInstancePrivateEndpointConnectionsOperationsAsync( def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_private_endpoint_connections_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_managed_instance_private_endpoint_connections_get(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +64,7 @@ async def test_managed_instance_private_endpoint_connections_begin_create_or_upd "provisioningState": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -67,21 +79,9 @@ async def test_managed_instance_private_endpoint_connections_begin_delete(self, resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py index 3bdb2153e9f6..3cb32934a9c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py @@ -24,7 +24,7 @@ def test_managed_instance_private_link_resources_list_by_managed_instance(self, response = self.client.managed_instance_private_link_resources.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_instance_private_link_resources_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py index a6ca8fb44025..7b9b4abaf4f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_instance_private_link_resources_list_by_managed_instance( response = self.client.managed_instance_private_link_resources.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_instance_private_link_resources_get(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py index 8ca01bb33bba..164233ee5f5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py @@ -25,7 +25,7 @@ def test_managed_instance_tde_certificates_begin_create(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py index eec00fb81aef..b46de20ad99b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py @@ -27,7 +27,7 @@ async def test_managed_instance_tde_certificates_begin_create(self, resource_gro resource_group_name=resource_group.name, managed_instance_name="str", parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py index dd88325274b6..36c6c2f980f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementManagedInstanceVulnerabilityAssessmentsOperations(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): + response = self.client.managed_instance_vulnerability_assessments.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_vulnerability_assessments_get(self, resource_group): @@ -25,7 +37,7 @@ def test_managed_instance_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +59,7 @@ def test_managed_instance_vulnerability_assessments_create_or_update(self, resou "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,20 +72,8 @@ def test_managed_instance_vulnerability_assessments_delete(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): - response = self.client.managed_instance_vulnerability_assessments.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py index 1f60a4ff0ca4..da86f29a27ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementManagedInstanceVulnerabilityAssessmentsOperationsAsync(Az def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): + response = self.client.managed_instance_vulnerability_assessments.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_vulnerability_assessments_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_managed_instance_vulnerability_assessments_get(self, resource_gro resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,7 +60,7 @@ async def test_managed_instance_vulnerability_assessments_create_or_update(self, "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,20 +73,8 @@ async def test_managed_instance_vulnerability_assessments_delete(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): - response = self.client.managed_instance_vulnerability_assessments.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py index f230d1871216..51ab6fc9dc44 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_managed_instances_list(self, resource_group): response = self.client.managed_instances.list( - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ def test_managed_instances_list_by_instance_pool(self, resource_group): response = self.client.managed_instances.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_managed_instances_list_by_instance_pool(self, resource_group): def test_managed_instances_list_by_resource_group(self, resource_group): response = self.client.managed_instances.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_managed_instances_get(self, resource_group): response = self.client.managed_instances.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,6 +105,7 @@ def test_managed_instances_begin_create_or_update(self, resource_group): "licenseType": "str", "maintenanceConfigurationId": "str", "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, "minimalTlsVersion": "str", "name": "str", "pricingModel": "str", @@ -127,6 +128,7 @@ def test_managed_instances_begin_create_or_update(self, resource_group): "proxyOverride": "str", "publicDataEndpointEnabled": bool, "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -143,7 +145,7 @@ def test_managed_instances_begin_create_or_update(self, resource_group): "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -155,7 +157,7 @@ def test_managed_instances_begin_delete(self, resource_group): response = self.client.managed_instances.begin_delete( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -201,6 +203,7 @@ def test_managed_instances_begin_update(self, resource_group): "licenseType": "str", "maintenanceConfigurationId": "str", "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, "minimalTlsVersion": "str", "pricingModel": "str", "primaryUserAssignedIdentityId": "str", @@ -222,6 +225,7 @@ def test_managed_instances_begin_update(self, resource_group): "proxyOverride": "str", "publicDataEndpointEnabled": bool, "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -237,7 +241,7 @@ def test_managed_instances_begin_update(self, resource_group): "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -249,7 +253,7 @@ def test_managed_instances_begin_failover(self, resource_group): response = self.client.managed_instances.begin_failover( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -261,19 +265,31 @@ def test_managed_instances_list_outbound_network_dependencies_by_managed_instanc response = self.client.managed_instances.list_outbound_network_dependencies_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = self.client.managed_instances.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instances_begin_refresh_status(self, resource_group): response = self.client.managed_instances.begin_refresh_status( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -285,7 +301,7 @@ def test_managed_instances_begin_start(self, resource_group): response = self.client.managed_instances.begin_start( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -297,7 +313,7 @@ def test_managed_instances_begin_stop(self, resource_group): response = self.client.managed_instances.begin_stop( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -309,8 +325,21 @@ def test_managed_instances_list_by_managed_instance(self, resource_group): response = self.client.managed_instances.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): + response = self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={"tdeKeyUri": "str"}, + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py index 32253e5e0f49..e3de9eefca57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_managed_instances_list(self, resource_group): response = self.client.managed_instances.list( - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -35,7 +35,7 @@ async def test_managed_instances_list_by_instance_pool(self, resource_group): response = self.client.managed_instances.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_managed_instances_list_by_instance_pool(self, resource_group): async def test_managed_instances_list_by_resource_group(self, resource_group): response = self.client.managed_instances.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -58,7 +58,7 @@ async def test_managed_instances_get(self, resource_group): response = await self.client.managed_instances.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -107,6 +107,7 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "licenseType": "str", "maintenanceConfigurationId": "str", "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, "minimalTlsVersion": "str", "name": "str", "pricingModel": "str", @@ -129,6 +130,7 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "proxyOverride": "str", "publicDataEndpointEnabled": bool, "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -145,7 +147,7 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +161,7 @@ async def test_managed_instances_begin_delete(self, resource_group): await self.client.managed_instances.begin_delete( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -207,6 +209,7 @@ async def test_managed_instances_begin_update(self, resource_group): "licenseType": "str", "maintenanceConfigurationId": "str", "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, "minimalTlsVersion": "str", "pricingModel": "str", "primaryUserAssignedIdentityId": "str", @@ -228,6 +231,7 @@ async def test_managed_instances_begin_update(self, resource_group): "proxyOverride": "str", "publicDataEndpointEnabled": bool, "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, @@ -243,7 +247,7 @@ async def test_managed_instances_begin_update(self, resource_group): "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -257,7 +261,7 @@ async def test_managed_instances_begin_failover(self, resource_group): await self.client.managed_instances.begin_failover( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -270,12 +274,26 @@ async def test_managed_instances_list_outbound_network_dependencies_by_managed_i response = self.client.managed_instances.list_outbound_network_dependencies_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = await ( + await self.client.managed_instances.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instances_begin_refresh_status(self, resource_group): @@ -283,7 +301,7 @@ async def test_managed_instances_begin_refresh_status(self, resource_group): await self.client.managed_instances.begin_refresh_status( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -297,7 +315,7 @@ async def test_managed_instances_begin_start(self, resource_group): await self.client.managed_instances.begin_start( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -311,7 +329,7 @@ async def test_managed_instances_begin_stop(self, resource_group): await self.client.managed_instances.begin_stop( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -324,8 +342,23 @@ async def test_managed_instances_list_by_managed_instance(self, resource_group): response = self.client.managed_instances.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): + response = await ( + await self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={"tdeKeyUri": "str"}, + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py index fbb2f8614129..09f303236bc3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py @@ -25,7 +25,7 @@ def test_managed_ledger_digest_uploads_list_by_database(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_managed_ledger_digest_uploads_get(self, resource_group): managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +54,7 @@ def test_managed_ledger_digest_uploads_begin_create_or_update(self, resource_gro database_name="str", ledger_digest_uploads="str", parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_managed_ledger_digest_uploads_begin_disable(self, resource_group): managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py index b9524b23e9cf..0e8f3b214a8f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py @@ -26,7 +26,7 @@ async def test_managed_ledger_digest_uploads_list_by_database(self, resource_gro resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_managed_ledger_digest_uploads_get(self, resource_group): managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,7 +56,7 @@ async def test_managed_ledger_digest_uploads_begin_create_or_update(self, resour database_name="str", ledger_digest_uploads="str", parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -72,7 +72,7 @@ async def test_managed_ledger_digest_uploads_begin_disable(self, resource_group) managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 1f97c8393c74..58c0765388bc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -21,6 +21,21 @@ class TestSqlManagementManagedRestorableDroppedDatabaseBackupShortTermRetentionP def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( + self, resource_group + ): + response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + restorable_dropped_database_id="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_restorable_dropped_database_backup_short_term_retention_policies_get(self, resource_group): @@ -29,7 +44,7 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +62,7 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie restorable_dropped_database_id="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() ) # call '.result()' to poll until service return final result @@ -65,23 +80,8 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie restorable_dropped_database_id="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( - self, resource_group - ): - response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py index b6c6bc98a32f..6a9e94a15828 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py @@ -22,6 +22,21 @@ class TestSqlManagementManagedRestorableDroppedDatabaseBackupShortTermRetentionP def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( + self, resource_group + ): + response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + restorable_dropped_database_id="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_restorable_dropped_database_backup_short_term_retention_policies_get(self, resource_group): @@ -30,7 +45,7 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,7 +63,7 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p restorable_dropped_database_id="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -67,24 +82,9 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p restorable_dropped_database_id="str", policy_name="str", parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( - self, resource_group - ): - response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py index a0ad267ce1b9..1d4795bd4037 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py @@ -24,7 +24,7 @@ def test_managed_server_dns_aliases_list_by_managed_instance(self, resource_grou response = self.client.managed_server_dns_aliases.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_managed_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_managed_server_dns_aliases_begin_create_or_update(self, resource_group) managed_instance_name="str", dns_alias_name="str", parameters={"createDnsRecord": True}, - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_managed_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,7 +78,7 @@ def test_managed_server_dns_aliases_begin_acquire(self, resource_group): managed_instance_name="str", dns_alias_name="str", parameters={"oldManagedServerDnsAliasResourceId": "str"}, - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py index 39db4bd72fdd..abb3d6208d0b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py @@ -25,7 +25,7 @@ async def test_managed_server_dns_aliases_list_by_managed_instance(self, resourc response = self.client.managed_server_dns_aliases.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_managed_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_managed_server_dns_aliases_begin_create_or_update(self, resource_ managed_instance_name="str", dns_alias_name="str", parameters={"createDnsRecord": True}, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -68,7 +68,7 @@ async def test_managed_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -84,7 +84,7 @@ async def test_managed_server_dns_aliases_begin_acquire(self, resource_group): managed_instance_name="str", dns_alias_name="str", parameters={"oldManagedServerDnsAliasResourceId": "str"}, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py index 18f4b0d56efb..e3ac72789b23 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementManagedServerSecurityAlertPoliciesOperations(AzureMgmtRec def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): + response = self.client.managed_server_security_alert_policies.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_server_security_alert_policies_get(self, resource_group): @@ -25,7 +37,7 @@ def test_managed_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,20 +71,8 @@ def test_managed_server_security_alert_policies_begin_create_or_update(self, res }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): - response = self.client.managed_server_security_alert_policies.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py index cf7435235ec7..764a95d7020c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementManagedServerSecurityAlertPoliciesOperationsAsync(AzureMg def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): + response = self.client.managed_server_security_alert_policies.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_server_security_alert_policies_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_managed_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,21 +73,9 @@ async def test_managed_server_security_alert_policies_begin_create_or_update(sel }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): - response = self.client.managed_server_security_alert_policies.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py index 082ef375e132..24f541112ba3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py @@ -24,7 +24,7 @@ def test_network_security_perimeter_configurations_list_by_server(self, resource response = self.client.network_security_perimeter_configurations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_network_security_perimeter_configurations_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_network_security_perimeter_configurations_begin_reconcile(self, resourc resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py index d910d7aaeaa5..e431a6a0cdb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py @@ -25,7 +25,7 @@ async def test_network_security_perimeter_configurations_list_by_server(self, re response = self.client.network_security_perimeter_configurations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_network_security_perimeter_configurations_get(self, resource_grou resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_network_security_perimeter_configurations_begin_reconcile(self, r resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py index 075121208531..aa82af1bbd84 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py index 69384b0abb48..41888cde50f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_operations_list(self, resource_group): response = self.client.operations.list( - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py index 9dab0024095e..57058a23b60c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementOutboundFirewallRulesOperations(AzureMgmtRecordedTestCase def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_outbound_firewall_rules_list_by_server(self, resource_group): + response = self.client.outbound_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_outbound_firewall_rules_get(self, resource_group): @@ -25,7 +37,7 @@ def test_outbound_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -38,8 +50,7 @@ def test_outbound_firewall_rules_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - parameters={"id": "str", "name": "str", "provisioningState": "str", "type": "str"}, - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -52,20 +63,8 @@ def test_outbound_firewall_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_outbound_firewall_rules_list_by_server(self, resource_group): - response = self.client.outbound_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2021-02-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py index 13ce5a5ab0bb..fed04638215c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementOutboundFirewallRulesOperationsAsync(AzureMgmtRecordedTes def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_outbound_firewall_rules_list_by_server(self, resource_group): + response = self.client.outbound_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_outbound_firewall_rules_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_outbound_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,8 +52,7 @@ async def test_outbound_firewall_rules_begin_create_or_update(self, resource_gro resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - parameters={"id": "str", "name": "str", "provisioningState": "str", "type": "str"}, - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -56,21 +67,9 @@ async def test_outbound_firewall_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_outbound_firewall_rules_list_by_server(self, resource_group): - response = self.client.outbound_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2021-02-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py index bdfe959f96ed..4f8fccbf0e1c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py @@ -24,7 +24,7 @@ def test_private_endpoint_connections_list_by_server(self, resource_group): response = self.client.private_endpoint_connections.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ def test_private_endpoint_connections_begin_create_or_update(self, resource_grou "provisioningState": "str", "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,7 +72,7 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py index 55cf005e8087..b2c357e4a8c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py @@ -25,7 +25,7 @@ async def test_private_endpoint_connections_list_by_server(self, resource_group) response = self.client.private_endpoint_connections.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ async def test_private_endpoint_connections_begin_create_or_update(self, resourc "provisioningState": "str", "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +80,7 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py index a9c4182c2e74..e05044e78c7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py @@ -24,7 +24,7 @@ def test_private_link_resources_list_by_server(self, resource_group): response = self.client.private_link_resources.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_private_link_resources_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py index b767354cb5ea..f8136e124ba2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_private_link_resources_list_by_server(self, resource_group): response = self.client.private_link_resources.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_private_link_resources_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py index f9581d6f0f81..823b4a21e6ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py @@ -38,7 +38,7 @@ def test_recommended_sensitivity_labels_update(self, resource_group): } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py index a9805e82f9a9..ebe390d2a348 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py @@ -39,7 +39,7 @@ async def test_recommended_sensitivity_labels_update(self, resource_group): } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py index fa9784cf95e9..9d7cfc53562e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py @@ -24,7 +24,7 @@ def test_recoverable_databases_list_by_server(self, resource_group): response = self.client.recoverable_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_recoverable_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py index 2c82dc4ba693..91583ba25a44 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_recoverable_databases_list_by_server(self, resource_group): response = self.client.recoverable_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_recoverable_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py index d0313b458aa5..56fd824d97b1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py @@ -24,7 +24,7 @@ def test_recoverable_managed_databases_list_by_instance(self, resource_group): response = self.client.recoverable_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_recoverable_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", recoverable_database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py index c13ded5d7f1b..5fa7744eca4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_recoverable_managed_databases_list_by_instance(self, resource_gro response = self.client.recoverable_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_recoverable_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", recoverable_database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py index e729382c249d..4b480f956336 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py @@ -25,7 +25,7 @@ def test_replication_links_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_replication_links_get(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ def test_replication_links_begin_create_or_update(self, resource_group): "startTime": "2020-02-20 00:00:00", "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -84,7 +84,7 @@ def test_replication_links_begin_delete(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +99,7 @@ def test_replication_links_begin_update(self, resource_group): database_name="str", link_id="str", parameters={"id": "str", "linkType": "str", "name": "str", "type": "str"}, - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -113,7 +113,7 @@ def test_replication_links_begin_failover(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -127,7 +127,7 @@ def test_replication_links_begin_failover_allow_data_loss(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -139,7 +139,7 @@ def test_replication_links_list_by_server(self, resource_group): response = self.client.replication_links.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py index 413c94962382..63118ccbfb15 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py @@ -26,7 +26,7 @@ async def test_replication_links_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_replication_links_get(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,7 +72,7 @@ async def test_replication_links_begin_create_or_update(self, resource_group): "startTime": "2020-02-20 00:00:00", "type": "str", }, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -88,7 +88,7 @@ async def test_replication_links_begin_delete(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -105,7 +105,7 @@ async def test_replication_links_begin_update(self, resource_group): database_name="str", link_id="str", parameters={"id": "str", "linkType": "str", "name": "str", "type": "str"}, - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -121,7 +121,7 @@ async def test_replication_links_begin_failover(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -137,7 +137,7 @@ async def test_replication_links_begin_failover_allow_data_loss(self, resource_g server_name="str", database_name="str", link_id="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -150,7 +150,7 @@ async def test_replication_links_list_by_server(self, resource_group): response = self.client.replication_links.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2023-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py index c7f456d144e7..27c79774314b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py @@ -24,7 +24,7 @@ def test_restorable_dropped_databases_list_by_server(self, resource_group): response = self.client.restorable_dropped_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_restorable_dropped_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", restorable_dropped_database_id="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py index e877d2d9394a..70c623bc99bc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_dropped_databases_list_by_server(self, resource_group) response = self.client.restorable_dropped_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_restorable_dropped_databases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", restorable_dropped_database_id="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py index 48b24e11fbb8..426f31167f87 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py @@ -24,7 +24,7 @@ def test_restorable_dropped_managed_databases_list_by_instance(self, resource_gr response = self.client.restorable_dropped_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_restorable_dropped_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", restorable_dropped_database_id="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py index 395f08dd16be..997af4db74e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_restorable_dropped_managed_databases_list_by_instance(self, resou response = self.client.restorable_dropped_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_restorable_dropped_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", restorable_dropped_database_id="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py index 2045cea002f1..1f416cf7a53c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py @@ -25,7 +25,7 @@ def test_restore_points_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_restore_points_begin_create(self, resource_group): server_name="str", database_name="str", parameters={"restorePointLabel": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -53,7 +53,7 @@ def test_restore_points_get(self, resource_group): server_name="str", database_name="str", restore_point_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ def test_restore_points_delete(self, resource_group): server_name="str", database_name="str", restore_point_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py index 264a7b3a98a6..6281c80f7f5d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py @@ -26,7 +26,7 @@ async def test_restore_points_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ async def test_restore_points_begin_create(self, resource_group): server_name="str", database_name="str", parameters={"restorePointLabel": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -56,7 +56,7 @@ async def test_restore_points_get(self, resource_group): server_name="str", database_name="str", restore_point_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -70,7 +70,7 @@ async def test_restore_points_delete(self, resource_group): server_name="str", database_name="str", restore_point_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py index e1ad5f777bba..8d44275641ee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py @@ -25,7 +25,7 @@ def test_sensitivity_labels_list_current_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -47,6 +47,7 @@ def test_sensitivity_labels_update(self, resource_group): "op": "str", "schema": "str", "sensitivityLabel": { + "clientClassificationSource": "str", "columnName": "str", "id": "str", "informationType": "str", @@ -66,7 +67,7 @@ def test_sensitivity_labels_update(self, resource_group): } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -79,7 +80,7 @@ def test_sensitivity_labels_list_recommended_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -87,16 +88,16 @@ def test_sensitivity_labels_list_recommended_by_database(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sensitivity_labels_enable_recommendation(self, resource_group): - response = self.client.sensitivity_labels.enable_recommendation( + def test_sensitivity_labels_get(self, resource_group): + response = self.client.sensitivity_labels.get( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + sensitivity_label_source="str", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -104,16 +105,32 @@ def test_sensitivity_labels_enable_recommendation(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sensitivity_labels_disable_recommendation(self, resource_group): - response = self.client.sensitivity_labels.disable_recommendation( + def test_sensitivity_labels_create_or_update(self, resource_group): + response = self.client.sensitivity_labels.create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + parameters={ + "clientClassificationSource": "str", + "columnName": "str", + "id": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "managedBy": "str", + "name": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + "type": "str", + }, + sensitivity_label_source="current", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -121,16 +138,16 @@ def test_sensitivity_labels_disable_recommendation(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sensitivity_labels_get(self, resource_group): - response = self.client.sensitivity_labels.get( + def test_sensitivity_labels_delete(self, resource_group): + response = self.client.sensitivity_labels.delete( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="str", - api_version="2020-11-01-preview", + sensitivity_label_source="current", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -138,31 +155,16 @@ def test_sensitivity_labels_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sensitivity_labels_create_or_update(self, resource_group): - response = self.client.sensitivity_labels.create_or_update( + def test_sensitivity_labels_disable_recommendation(self, resource_group): + response = self.client.sensitivity_labels.disable_recommendation( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - parameters={ - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - sensitivity_label_source="current", - api_version="2020-11-01-preview", + sensitivity_label_source="recommended", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -170,17 +172,30 @@ def test_sensitivity_labels_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sensitivity_labels_delete(self, resource_group): - response = self.client.sensitivity_labels.delete( + def test_sensitivity_labels_enable_recommendation(self, resource_group): + response = self.client.sensitivity_labels.enable_recommendation( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="current", - api_version="2020-11-01-preview", + sensitivity_label_source="recommended", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.sensitivity_labels.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py index aae7e3af0c12..b3c775fc7847 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py @@ -26,7 +26,7 @@ async def test_sensitivity_labels_list_current_by_database(self, resource_group) resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -48,6 +48,7 @@ async def test_sensitivity_labels_update(self, resource_group): "op": "str", "schema": "str", "sensitivityLabel": { + "clientClassificationSource": "str", "columnName": "str", "id": "str", "informationType": "str", @@ -67,7 +68,7 @@ async def test_sensitivity_labels_update(self, resource_group): } ] }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -80,7 +81,7 @@ async def test_sensitivity_labels_list_recommended_by_database(self, resource_gr resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -88,16 +89,16 @@ async def test_sensitivity_labels_list_recommended_by_database(self, resource_gr @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sensitivity_labels_enable_recommendation(self, resource_group): - response = await self.client.sensitivity_labels.enable_recommendation( + async def test_sensitivity_labels_get(self, resource_group): + response = await self.client.sensitivity_labels.get( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + sensitivity_label_source="str", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,16 +106,32 @@ async def test_sensitivity_labels_enable_recommendation(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sensitivity_labels_disable_recommendation(self, resource_group): - response = await self.client.sensitivity_labels.disable_recommendation( + async def test_sensitivity_labels_create_or_update(self, resource_group): + response = await self.client.sensitivity_labels.create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2020-11-01-preview", + parameters={ + "clientClassificationSource": "str", + "columnName": "str", + "id": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "managedBy": "str", + "name": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + "type": "str", + }, + sensitivity_label_source="current", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -122,16 +139,16 @@ async def test_sensitivity_labels_disable_recommendation(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sensitivity_labels_get(self, resource_group): - response = await self.client.sensitivity_labels.get( + async def test_sensitivity_labels_delete(self, resource_group): + response = await self.client.sensitivity_labels.delete( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="str", - api_version="2020-11-01-preview", + sensitivity_label_source="current", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -139,31 +156,16 @@ async def test_sensitivity_labels_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sensitivity_labels_create_or_update(self, resource_group): - response = await self.client.sensitivity_labels.create_or_update( + async def test_sensitivity_labels_disable_recommendation(self, resource_group): + response = await self.client.sensitivity_labels.disable_recommendation( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - parameters={ - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - sensitivity_label_source="current", - api_version="2020-11-01-preview", + sensitivity_label_source="recommended", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -171,17 +173,30 @@ async def test_sensitivity_labels_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sensitivity_labels_delete(self, resource_group): - response = await self.client.sensitivity_labels.delete( + async def test_sensitivity_labels_enable_recommendation(self, resource_group): + response = await self.client.sensitivity_labels.enable_recommendation( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="current", - api_version="2020-11-01-preview", + sensitivity_label_source="recommended", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.sensitivity_labels.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py index 0692c96005ca..b0c5550008d4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py @@ -24,7 +24,7 @@ def test_server_advanced_threat_protection_settings_list_by_server(self, resourc response = self.client.server_advanced_threat_protection_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_advanced_threat_protection_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", advanced_threat_protection_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ def test_server_advanced_threat_protection_settings_begin_create_or_update(self, }, "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py index 17481c353c3b..5c6ab4b06f76 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py @@ -25,7 +25,7 @@ async def test_server_advanced_threat_protection_settings_list_by_server(self, r response = self.client.server_advanced_threat_protection_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_advanced_threat_protection_settings_get(self, resource_gro resource_group_name=resource_group.name, server_name="str", advanced_threat_protection_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -67,7 +67,7 @@ async def test_server_advanced_threat_protection_settings_begin_create_or_update }, "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py index b67cfd24bf68..7bbb0d57b06f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py @@ -24,7 +24,7 @@ def test_server_advisors_list_by_server(self, resource_group): response = self.client.server_advisors.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_advisors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,7 +62,7 @@ def test_server_advisors_update(self, resource_group): "recommendationsStatus": "str", "recommendedActions": [ { - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -73,7 +73,7 @@ def test_server_advisors_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -97,7 +97,7 @@ def test_server_advisors_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -122,7 +122,7 @@ def test_server_advisors_update(self, resource_group): ], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py index c7b921f80ba5..cbfed1432d14 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py @@ -25,7 +25,7 @@ async def test_server_advisors_list_by_server(self, resource_group): response = await self.client.server_advisors.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_advisors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", advisor_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -63,7 +63,7 @@ async def test_server_advisors_update(self, resource_group): "recommendationsStatus": "str", "recommendedActions": [ { - "details": {"str": {}}, + "details": {"str": "str"}, "errorDetails": {"errorCode": "str", "isRetryable": "str"}, "estimatedImpact": [ { @@ -74,7 +74,7 @@ async def test_server_advisors_update(self, resource_group): "unit": "str", } ], - "executeActionDuration": "str", + "executeActionDuration": "1 day, 0:00:00", "executeActionInitiatedBy": "str", "executeActionInitiatedTime": "2020-02-20 00:00:00", "executeActionStartTime": "2020-02-20 00:00:00", @@ -98,7 +98,7 @@ async def test_server_advisors_update(self, resource_group): } ], "recommendationReason": "str", - "revertActionDuration": "str", + "revertActionDuration": "1 day, 0:00:00", "revertActionInitiatedBy": "str", "revertActionInitiatedTime": "2020-02-20 00:00:00", "revertActionStartTime": "2020-02-20 00:00:00", @@ -123,7 +123,7 @@ async def test_server_advisors_update(self, resource_group): ], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py index 4ef3627bd371..8ad8a0097653 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py @@ -24,7 +24,7 @@ def test_server_automatic_tuning_get(self, resource_group): response = self.client.server_automatic_tuning.get( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -44,7 +44,7 @@ def test_server_automatic_tuning_update(self, resource_group): "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py index aee3914f7207..99473f8831a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py @@ -25,7 +25,7 @@ async def test_server_automatic_tuning_get(self, resource_group): response = await self.client.server_automatic_tuning.get( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +45,7 @@ async def test_server_automatic_tuning_update(self, resource_group): "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py index 6ff85657fe22..b0057cac1fc7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerAzureADAdministratorsOperations(AzureMgmtRecordedTe def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_azure_ad_administrators_list_by_server(self, resource_group): + response = self.client.server_azure_ad_administrators.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_azure_ad_administrators_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_azure_ad_administrators_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,7 +60,7 @@ def test_server_azure_ad_administrators_begin_create_or_update(self, resource_gr "tenantId": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -61,20 +73,8 @@ def test_server_azure_ad_administrators_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_azure_ad_administrators_list_by_server(self, resource_group): - response = self.client.server_azure_ad_administrators.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py index 07fa1a7fca1f..590f472c57b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerAzureADAdministratorsOperationsAsync(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_azure_ad_administrators_list_by_server(self, resource_group): + response = self.client.server_azure_ad_administrators.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_azure_ad_administrators_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_azure_ad_administrators_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +62,7 @@ async def test_server_azure_ad_administrators_begin_create_or_update(self, resou "tenantId": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -65,21 +77,9 @@ async def test_server_azure_ad_administrators_begin_delete(self, resource_group) resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_azure_ad_administrators_list_by_server(self, resource_group): - response = self.client.server_azure_ad_administrators.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py index 5cfe94beab40..97e574137273 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerAzureADOnlyAuthenticationsOperations(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): + response = self.client.server_azure_ad_only_authentications.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_azure_ad_only_authentications_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_azure_ad_only_authentications_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -39,7 +51,7 @@ def test_server_azure_ad_only_authentications_begin_create_or_update(self, resou server_name="str", authentication_name="str", parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -52,20 +64,8 @@ def test_server_azure_ad_only_authentications_begin_delete(self, resource_group) resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): - response = self.client.server_azure_ad_only_authentications.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py index 4ee031acce81..e88801a29edd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerAzureADOnlyAuthenticationsOperationsAsync(AzureMgmt def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): + response = self.client.server_azure_ad_only_authentications.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_azure_ad_only_authentications_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_azure_ad_only_authentications_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +53,7 @@ async def test_server_azure_ad_only_authentications_begin_create_or_update(self, server_name="str", authentication_name="str", parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -56,21 +68,9 @@ async def test_server_azure_ad_only_authentications_begin_delete(self, resource_ resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): - response = self.client.server_azure_ad_only_authentications.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py index 16df7dada803..2af2cafd03bf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py @@ -24,7 +24,7 @@ def test_server_blob_auditing_policies_list_by_server(self, resource_group): response = self.client.server_blob_auditing_policies.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -66,7 +66,7 @@ def test_server_blob_auditing_policies_begin_create_or_update(self, resource_gro "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py index a1dc30178d19..ae8535de9b38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py @@ -25,7 +25,7 @@ async def test_server_blob_auditing_policies_list_by_server(self, resource_group response = self.client.server_blob_auditing_policies.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_server_blob_auditing_policies_begin_create_or_update(self, resour "type": "str", }, blob_auditing_policy_name="default", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py index 6dd321cc91a7..4988febac186 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py @@ -24,7 +24,7 @@ def test_server_configuration_options_list_by_managed_instance(self, resource_gr response = self.client.server_configuration_options.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_configuration_options_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", server_configuration_option_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_server_configuration_options_begin_create_or_update(self, resource_grou "serverConfigurationOptionValue": 0, "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py index 2c86435f159a..17bc7104cb98 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py @@ -25,7 +25,7 @@ async def test_server_configuration_options_list_by_managed_instance(self, resou response = self.client.server_configuration_options.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_configuration_options_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", server_configuration_option_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ async def test_server_configuration_options_begin_create_or_update(self, resourc "serverConfigurationOptionValue": 0, "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py index 2facbb9a698d..902a234873ec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerConnectionPoliciesOperations(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_connection_policies_list_by_server(self, resource_group): + response = self.client.server_connection_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_connection_policies_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_connection_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", connection_policy_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,20 +58,8 @@ def test_server_connection_policies_begin_create_or_update(self, resource_group) "name": "str", "type": "str", }, - api_version="2021-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_connection_policies_list_by_server(self, resource_group): - response = self.client.server_connection_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2021-05-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py index b1cfcdb176e2..b7c4c18e9ff0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerConnectionPoliciesOperationsAsync(AzureMgmtRecorded def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_connection_policies_list_by_server(self, resource_group): + response = self.client.server_connection_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_connection_policies_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_connection_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", connection_policy_name="str", - api_version="2021-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,21 +60,9 @@ async def test_server_connection_policies_begin_create_or_update(self, resource_ "name": "str", "type": "str", }, - api_version="2021-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_connection_policies_list_by_server(self, resource_group): - response = self.client.server_connection_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2021-05-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py index 547eee1771e4..83a3ae20b1fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py @@ -24,7 +24,7 @@ def test_server_dev_ops_audit_settings_list_by_server(self, resource_group): response = self.client.server_dev_ops_audit_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_dev_ops_audit_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dev_ops_auditing_settings_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ def test_server_dev_ops_audit_settings_begin_create_or_update(self, resource_gro }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py index e98bad58de79..1ead3f532d1d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py @@ -25,7 +25,7 @@ async def test_server_dev_ops_audit_settings_list_by_server(self, resource_group response = self.client.server_dev_ops_audit_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_dev_ops_audit_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dev_ops_auditing_settings_name="str", - api_version="2022-02-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,7 +71,7 @@ async def test_server_dev_ops_audit_settings_begin_create_or_update(self, resour }, "type": "str", }, - api_version="2022-02-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py index 17f4c5da272a..090bd5c825ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerDnsAliasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_dns_aliases_list_by_server(self, resource_group): + response = self.client.server_dns_aliases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_dns_aliases_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -38,7 +50,7 @@ def test_server_dns_aliases_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -51,24 +63,12 @@ def test_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_dns_aliases_list_by_server(self, resource_group): - response = self.client.server_dns_aliases.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_dns_aliases_begin_acquire(self, resource_group): @@ -77,7 +77,7 @@ def test_server_dns_aliases_begin_acquire(self, resource_group): server_name="str", dns_alias_name="str", parameters={"oldServerDnsAliasId": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py index 4ef14e88e586..e01fa3a5ed5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerDnsAliasesOperationsAsync(AzureMgmtRecordedTestCase def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_dns_aliases_list_by_server(self, resource_group): + response = self.client.server_dns_aliases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_dns_aliases_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,7 +52,7 @@ async def test_server_dns_aliases_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -55,25 +67,13 @@ async def test_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_dns_aliases_list_by_server(self, resource_group): - response = self.client.server_dns_aliases.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_dns_aliases_begin_acquire(self, resource_group): @@ -83,7 +83,7 @@ async def test_server_dns_aliases_begin_acquire(self, resource_group): server_name="str", dns_alias_name="str", parameters={"oldServerDnsAliasId": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py index bfb7f51a16d2..443f41ea3b5f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py @@ -24,7 +24,7 @@ def test_server_keys_list_by_server(self, resource_group): response = self.client.server_keys.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_keys_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,6 +54,7 @@ def test_server_keys_begin_create_or_update(self, resource_group): "autoRotationEnabled": bool, "creationDate": "2020-02-20 00:00:00", "id": "str", + "keyVersion": "str", "kind": "str", "location": "str", "name": "str", @@ -63,7 +64,7 @@ def test_server_keys_begin_create_or_update(self, resource_group): "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,7 +77,7 @@ def test_server_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py index 6a1cb467f9e4..a4b72cb96bf2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py @@ -25,7 +25,7 @@ async def test_server_keys_list_by_server(self, resource_group): response = self.client.server_keys.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_keys_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,6 +56,7 @@ async def test_server_keys_begin_create_or_update(self, resource_group): "autoRotationEnabled": bool, "creationDate": "2020-02-20 00:00:00", "id": "str", + "keyVersion": "str", "kind": "str", "location": "str", "name": "str", @@ -65,7 +66,7 @@ async def test_server_keys_begin_create_or_update(self, resource_group): "type": "str", "uri": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,7 +81,7 @@ async def test_server_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py index e631f6193744..4faade032193 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py @@ -24,7 +24,7 @@ def test_server_operations_list_by_server(self, resource_group): response = self.client.server_operations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py index 4be30b1107d3..a57dbb3908e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py @@ -25,7 +25,7 @@ async def test_server_operations_list_by_server(self, resource_group): response = self.client.server_operations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py index 42a1240d2ab5..3b07b59133fc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerSecurityAlertPoliciesOperations(AzureMgmtRecordedTe def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_security_alert_policies_list_by_server(self, resource_group): + response = self.client.server_security_alert_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_security_alert_policies_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,20 +71,8 @@ def test_server_security_alert_policies_begin_create_or_update(self, resource_gr }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_security_alert_policies_list_by_server(self, resource_group): - response = self.client.server_security_alert_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py index 0ebd68914a78..5bd6d9ce598c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerSecurityAlertPoliciesOperationsAsync(AzureMgmtRecor def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_security_alert_policies_list_by_server(self, resource_group): + response = self.client.server_security_alert_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_security_alert_policies_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", security_alert_policy_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,21 +73,9 @@ async def test_server_security_alert_policies_begin_create_or_update(self, resou }, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_security_alert_policies_list_by_server(self, resource_group): - response = self.client.server_security_alert_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py index dc78c0213e02..e323ed392a60 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py @@ -24,7 +24,7 @@ def test_server_trust_certificates_list_by_instance(self, resource_group): response = self.client.server_trust_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_server_trust_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,7 +58,7 @@ def test_server_trust_certificates_begin_create_or_update(self, resource_group): "thumbprint": "str", "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,7 +71,7 @@ def test_server_trust_certificates_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py index 8d110865ff69..5fa4c6456a32 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py @@ -25,7 +25,7 @@ async def test_server_trust_certificates_list_by_instance(self, resource_group): response = self.client.server_trust_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_server_trust_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,7 +60,7 @@ async def test_server_trust_certificates_begin_create_or_update(self, resource_g "thumbprint": "str", "type": "str", }, - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,7 +75,7 @@ async def test_server_trust_certificates_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2021-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py index a42ba198b725..c5c7c722980c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerTrustGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_trust_groups_list_by_location(self, resource_group): + response = self.client.server_trust_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_trust_groups_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_trust_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,7 +57,7 @@ def test_server_trust_groups_begin_create_or_update(self, resource_group): "trustScopes": ["str"], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -58,31 +70,19 @@ def test_server_trust_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_trust_groups_list_by_location(self, resource_group): - response = self.client.server_trust_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_trust_groups_list_by_instance(self, resource_group): response = self.client.server_trust_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py index 526a2b780544..2fbcabe8ef01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerTrustGroupsOperationsAsync(AzureMgmtRecordedTestCas def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_trust_groups_list_by_location(self, resource_group): + response = self.client.server_trust_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_trust_groups_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_trust_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +59,7 @@ async def test_server_trust_groups_begin_create_or_update(self, resource_group): "trustScopes": ["str"], "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -62,32 +74,20 @@ async def test_server_trust_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_trust_groups_list_by_location(self, resource_group): - response = self.client.server_trust_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_trust_groups_list_by_instance(self, resource_group): response = self.client.server_trust_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py index 5e0829956557..1df3780b34a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py @@ -24,7 +24,7 @@ def test_server_usages_list_by_server(self, resource_group): response = self.client.server_usages.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2014-04-01", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py index 859aa73cd7fb..54ca4c46dcaa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py @@ -25,7 +25,7 @@ async def test_server_usages_list_by_server(self, resource_group): response = self.client.server_usages.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2014-04-01", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py index 0ff7bb8ce725..99f62607acee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementServerVulnerabilityAssessmentsOperations(AzureMgmtRecorde def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_vulnerability_assessments_list_by_server(self, resource_group): + response = self.client.server_vulnerability_assessments.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_vulnerability_assessments_get(self, resource_group): @@ -25,7 +37,7 @@ def test_server_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,7 +59,7 @@ def test_server_vulnerability_assessments_create_or_update(self, resource_group) "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,20 +72,8 @@ def test_server_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_vulnerability_assessments_list_by_server(self, resource_group): - response = self.client.server_vulnerability_assessments.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py index 2898f0f6ae29..6bdb1de9b22e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementServerVulnerabilityAssessmentsOperationsAsync(AzureMgmtRe def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_vulnerability_assessments_list_by_server(self, resource_group): + response = self.client.server_vulnerability_assessments.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_vulnerability_assessments_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_server_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,7 +60,7 @@ async def test_server_vulnerability_assessments_create_or_update(self, resource_ "storageContainerSasKey": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,20 +73,8 @@ async def test_server_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_vulnerability_assessments_list_by_server(self, resource_group): - response = self.client.server_vulnerability_assessments.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py index a0dcf0b74857..884ebf7eb501 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_servers_check_name_availability(self, resource_group): response = self.client.servers.check_name_availability( parameters={"name": "str", "type": "Microsoft.Sql/servers"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_servers_check_name_availability(self, resource_group): @recorded_by_proxy def test_servers_list(self, resource_group): response = self.client.servers.list( - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ def test_servers_list(self, resource_group): def test_servers_list_by_resource_group(self, resource_group): response = self.client.servers.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ def test_servers_get(self, resource_group): response = self.client.servers.get( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -121,7 +121,7 @@ def test_servers_begin_create_or_update(self, resource_group): "version": "str", "workspaceFeature": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -133,7 +133,7 @@ def test_servers_begin_delete(self, resource_group): response = self.client.servers.begin_delete( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -193,7 +193,7 @@ def test_servers_begin_update(self, resource_group): "version": "str", "workspaceFeature": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -218,7 +218,7 @@ def test_servers_begin_import_database(self, resource_group): "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, "serviceObjectiveName": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -230,7 +230,7 @@ def test_servers_begin_refresh_status(self, resource_group): response = self.client.servers.begin_refresh_status( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py index 31d0b8ea3eb4..45b38a802208 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_servers_check_name_availability(self, resource_group): response = await self.client.servers.check_name_availability( parameters={"name": "str", "type": "Microsoft.Sql/servers"}, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_servers_check_name_availability(self, resource_group): @recorded_by_proxy_async async def test_servers_list(self, resource_group): response = self.client.servers.list( - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ async def test_servers_list(self, resource_group): async def test_servers_list_by_resource_group(self, resource_group): response = self.client.servers.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -57,7 +57,7 @@ async def test_servers_get(self, resource_group): response = await self.client.servers.get( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -123,7 +123,7 @@ async def test_servers_begin_create_or_update(self, resource_group): "version": "str", "workspaceFeature": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -137,7 +137,7 @@ async def test_servers_begin_delete(self, resource_group): await self.client.servers.begin_delete( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -199,7 +199,7 @@ async def test_servers_begin_update(self, resource_group): "version": "str", "workspaceFeature": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -226,7 +226,7 @@ async def test_servers_begin_import_database(self, resource_group): "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, "serviceObjectiveName": "str", }, - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -240,7 +240,7 @@ async def test_servers_begin_refresh_status(self, resource_group): await self.client.servers.begin_refresh_status( resource_group_name=resource_group.name, server_name="str", - api_version="2024-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py index a396c4762ff3..e702ce3469ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py @@ -24,7 +24,7 @@ def test_sql_agent_get(self, resource_group): response = self.client.sql_agent.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_sql_agent_create_or_update(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py index b51db5013d2a..f47fcb3b481d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py @@ -25,7 +25,7 @@ async def test_sql_agent_get(self, resource_group): response = await self.client.sql_agent.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_sql_agent_create_or_update(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py index bdbc96890e13..47bd812f4121 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py @@ -26,7 +26,7 @@ def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessm server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_sql_vulnerability_assessment_baseline_get(self, resource_group): vulnerability_assessment_name="str", baseline_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py index b66492b887d5..14fde5505120 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py @@ -27,7 +27,7 @@ async def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_a server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_sql_vulnerability_assessment_baseline_get(self, resource_group): vulnerability_assessment_name="str", baseline_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py index e5032cee4b89..174a2e21acee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py @@ -42,7 +42,7 @@ def test_sql_vulnerability_assessment_baselines_create_or_update(self, resource_ "type": "str", }, system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py index cac2bcca1c8a..0e349d4f94e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py @@ -43,7 +43,7 @@ async def test_sql_vulnerability_assessment_baselines_create_or_update(self, res "type": "str", }, system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py index 15a930463fe3..d4e64e55b378 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py @@ -26,7 +26,7 @@ def test_sql_vulnerability_assessment_execute_scan_begin_execute(self, resource_ server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py index e9b7257d7167..5ea5718df7fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py @@ -28,7 +28,7 @@ async def test_sql_vulnerability_assessment_execute_scan_begin_execute(self, res server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py index e5cfbfe3abd5..6bac8b4eeee1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py @@ -27,7 +27,7 @@ def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, resou vulnerability_assessment_name="str", baseline_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -43,7 +43,7 @@ def test_sql_vulnerability_assessment_rule_baseline_get(self, resource_group): baseline_name="str", rule_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -74,7 +74,7 @@ def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, resou "type": "str", }, system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py index f3592e74b051..1170b2793c2b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py @@ -28,7 +28,7 @@ async def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, vulnerability_assessment_name="str", baseline_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_sql_vulnerability_assessment_rule_baseline_get(self, resource_gro baseline_name="str", rule_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -75,7 +75,7 @@ async def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, "type": "str", }, system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py index 1ad4af4ac172..6ad73c4890c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py @@ -28,7 +28,7 @@ def test_sql_vulnerability_assessment_rule_baselines_delete(self, resource_group baseline_name="str", rule_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py index aade3f5bb53e..941478a4e95e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py @@ -29,7 +29,7 @@ async def test_sql_vulnerability_assessment_rule_baselines_delete(self, resource baseline_name="str", rule_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py index 0b9b54ca16fa..72002c9b0d24 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py @@ -27,7 +27,7 @@ def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_gr vulnerability_assessment_name="str", scan_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -43,7 +43,7 @@ def test_sql_vulnerability_assessment_scan_result_get(self, resource_group): scan_id="str", scan_result_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py index ceb959ede613..2dcdfc51d18c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py @@ -28,7 +28,7 @@ async def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resou vulnerability_assessment_name="str", scan_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -44,7 +44,7 @@ async def test_sql_vulnerability_assessment_scan_result_get(self, resource_group scan_id="str", scan_result_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py index ba597104a579..0d78a45234be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py @@ -26,7 +26,7 @@ def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessment server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_sql_vulnerability_assessment_scans_get(self, resource_group): vulnerability_assessment_name="str", scan_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py index 760fab5ac911..815a8cc44d3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py @@ -27,7 +27,7 @@ async def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_asse server_name="str", vulnerability_assessment_name="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_sql_vulnerability_assessment_scans_get(self, resource_group): vulnerability_assessment_name="str", scan_id="str", system_database_name="master", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py index 4c2f73ebf626..a95a36069ce1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py @@ -25,7 +25,7 @@ def test_sql_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py index 340d6f171baf..302a6d1a7411 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py @@ -26,7 +26,7 @@ async def test_sql_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py index 0e7aac84f5e5..b5c1d5e70cec 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py @@ -24,7 +24,7 @@ def test_sql_vulnerability_assessments_settings_list_by_server(self, resource_gr response = self.client.sql_vulnerability_assessments_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_sql_vulnerability_assessments_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_sql_vulnerability_assessments_settings_create_or_update(self, resource_ }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py index bb1867a42c11..b3b7737f8636 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py @@ -25,7 +25,7 @@ async def test_sql_vulnerability_assessments_settings_list_by_server(self, resou response = self.client.sql_vulnerability_assessments_settings.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_sql_vulnerability_assessments_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -65,7 +65,7 @@ async def test_sql_vulnerability_assessments_settings_create_or_update(self, res }, "type": "str", }, - api_version="2022-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py index 5232d4c7ecd1..2b4aa8c5e629 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py @@ -24,7 +24,7 @@ def test_start_stop_managed_instance_schedules_list_by_instance(self, resource_g response = self.client.start_stop_managed_instance_schedules.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_start_stop_managed_instance_schedules_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ def test_start_stop_managed_instance_schedules_create_or_update(self, resource_g "timeZoneId": "UTC", "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,7 +81,7 @@ def test_start_stop_managed_instance_schedules_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py index 2617b2575f76..e6ac3f38a385 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py @@ -25,7 +25,7 @@ async def test_start_stop_managed_instance_schedules_list_by_instance(self, reso response = self.client.start_stop_managed_instance_schedules.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_start_stop_managed_instance_schedules_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -69,7 +69,7 @@ async def test_start_stop_managed_instance_schedules_create_or_update(self, reso "timeZoneId": "UTC", "type": "str", }, - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,7 +82,7 @@ async def test_start_stop_managed_instance_schedules_delete(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py index 904a8ae209b4..8db0f68ca534 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_subscription_usages_list_by_location(self, resource_group): response = self.client.subscription_usages.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_subscription_usages_get(self, resource_group): response = self.client.subscription_usages.get( location_name="str", usage_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py index 5a3fe738892b..243f31741872 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_subscription_usages_list_by_location(self, resource_group): response = self.client.subscription_usages.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_subscription_usages_get(self, resource_group): response = await self.client.subscription_usages.get( location_name="str", usage_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py index 9c6297679137..e3b2682a5931 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py @@ -25,7 +25,7 @@ def test_synapse_link_workspaces_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py index 9b9a6a2ae58f..0c205f32722c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py @@ -26,7 +26,7 @@ async def test_synapse_link_workspaces_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py index 884014416b37..73b2eb120438 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementSyncAgentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_agents_list_by_server(self, resource_group): + response = self.client.sync_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sync_agents_get(self, resource_group): @@ -25,7 +37,7 @@ def test_sync_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -49,7 +61,7 @@ def test_sync_agents_begin_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -62,24 +74,12 @@ def test_sync_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_agents_list_by_server(self, resource_group): - response = self.client.sync_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sync_agents_generate_key(self, resource_group): @@ -87,7 +87,7 @@ def test_sync_agents_generate_key(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -100,7 +100,7 @@ def test_sync_agents_list_linked_databases(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py index 368e5ea0d855..151a73c7880c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementSyncAgentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_agents_list_by_server(self, resource_group): + response = self.client.sync_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_agents_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_sync_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,7 +63,7 @@ async def test_sync_agents_begin_create_or_update(self, resource_group): "type": "str", "version": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -66,25 +78,13 @@ async def test_sync_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_agents_list_by_server(self, resource_group): - response = self.client.sync_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_agents_generate_key(self, resource_group): @@ -92,7 +92,7 @@ async def test_sync_agents_generate_key(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,7 +105,7 @@ async def test_sync_agents_list_linked_databases(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py index 362328a861a8..1f6a5414955d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_sync_groups_list_sync_database_ids(self, resource_group): response = self.client.sync_groups.list_sync_database_ids( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -31,77 +31,17 @@ def test_sync_groups_list_sync_database_ids(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_begin_refresh_hub_schema(self, resource_group): - response = self.client.sync_groups.begin_refresh_hub_schema( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_groups_list_hub_schemas(self, resource_group): - response = self.client.sync_groups.list_hub_schemas( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_groups_list_logs(self, resource_group): - response = self.client.sync_groups.list_logs( + def test_sync_groups_list_by_database(self, resource_group): + response = self.client.sync_groups.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - sync_group_name="str", - start_time="str", - end_time="str", - type="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_groups_cancel_sync(self, resource_group): - response = self.client.sync_groups.cancel_sync( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_groups_trigger_sync(self, resource_group): - response = self.client.sync_groups.trigger_sync( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sync_groups_get(self, resource_group): @@ -110,7 +50,7 @@ def test_sync_groups_get(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -147,7 +87,7 @@ def test_sync_groups_begin_create_or_update(self, resource_group): "type": "str", "usePrivateLinkConnection": bool, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -161,7 +101,7 @@ def test_sync_groups_begin_delete(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -198,7 +138,7 @@ def test_sync_groups_begin_update(self, resource_group): "type": "str", "usePrivateLinkConnection": bool, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -206,13 +146,73 @@ def test_sync_groups_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_list_by_database(self, resource_group): - response = self.client.sync_groups.list_by_database( + def test_sync_groups_cancel_sync(self, resource_group): + response = self.client.sync_groups.cancel_sync( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_groups_list_hub_schemas(self, resource_group): + response = self.client.sync_groups.list_hub_schemas( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_groups_list_logs(self, resource_group): + response = self.client.sync_groups.list_logs( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + sync_group_name="str", + start_time="str", + end_time="str", + type="str", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_groups_begin_refresh_hub_schema(self, resource_group): + response = self.client.sync_groups.begin_refresh_hub_schema( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_groups_trigger_sync(self, resource_group): + response = self.client.sync_groups.trigger_sync( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py index 8fedff1b1bd0..b17fb7d05ed4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_sync_groups_list_sync_database_ids(self, resource_group): response = self.client.sync_groups.list_sync_database_ids( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -32,79 +32,17 @@ async def test_sync_groups_list_sync_database_ids(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_groups_begin_refresh_hub_schema(self, resource_group): - response = await ( - await self.client.sync_groups.begin_refresh_hub_schema( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_list_hub_schemas(self, resource_group): - response = self.client.sync_groups.list_hub_schemas( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_list_logs(self, resource_group): - response = self.client.sync_groups.list_logs( + async def test_sync_groups_list_by_database(self, resource_group): + response = self.client.sync_groups.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - sync_group_name="str", - start_time="str", - end_time="str", - type="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_cancel_sync(self, resource_group): - response = await self.client.sync_groups.cancel_sync( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_trigger_sync(self, resource_group): - response = await self.client.sync_groups.trigger_sync( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_groups_get(self, resource_group): @@ -113,7 +51,7 @@ async def test_sync_groups_get(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -154,7 +92,7 @@ async def test_sync_groups_begin_create_or_update(self, resource_group): "type": "str", "usePrivateLinkConnection": bool, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -170,7 +108,7 @@ async def test_sync_groups_begin_delete(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -212,7 +150,7 @@ async def test_sync_groups_begin_update(self, resource_group): "type": "str", "usePrivateLinkConnection": bool, }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -221,13 +159,75 @@ async def test_sync_groups_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_groups_list_by_database(self, resource_group): - response = self.client.sync_groups.list_by_database( + async def test_sync_groups_cancel_sync(self, resource_group): + response = await self.client.sync_groups.cancel_sync( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2020-11-01-preview", + sync_group_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_list_hub_schemas(self, resource_group): + response = self.client.sync_groups.list_hub_schemas( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_list_logs(self, resource_group): + response = self.client.sync_groups.list_logs( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + start_time="str", + end_time="str", + type="str", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_begin_refresh_hub_schema(self, resource_group): + response = await ( + await self.client.sync_groups.begin_refresh_hub_schema( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_trigger_sync(self, resource_group): + response = await self.client.sync_groups.trigger_sync( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py index fc55313dc798..98cc7bf567c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py @@ -18,6 +18,20 @@ class TestSqlManagementSyncMembersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_members_list_by_sync_group(self, resource_group): + response = self.client.sync_members.list_by_sync_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sync_members_get(self, resource_group): @@ -27,7 +41,7 @@ def test_sync_members_get(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,7 +73,7 @@ def test_sync_members_begin_create_or_update(self, resource_group): "usePrivateLinkConnection": bool, "userName": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,7 +88,7 @@ def test_sync_members_begin_delete(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -106,7 +120,7 @@ def test_sync_members_begin_update(self, resource_group): "usePrivateLinkConnection": bool, "userName": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -114,15 +128,16 @@ def test_sync_members_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_members_list_by_sync_group(self, resource_group): - response = self.client.sync_members.list_by_sync_group( + def test_sync_members_begin_refresh_member_schema(self, resource_group): + response = self.client.sync_members.begin_refresh_member_schema( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] + sync_member_name="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @@ -135,23 +150,8 @@ def test_sync_members_list_member_schemas(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_members_begin_refresh_member_schema(self, resource_group): - response = self.client.sync_members.begin_refresh_member_schema( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - sync_member_name="str", - api_version="2020-11-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py index 7b493741cb1d..f183b795cec4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py @@ -19,6 +19,20 @@ class TestSqlManagementSyncMembersOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_members_list_by_sync_group(self, resource_group): + response = self.client.sync_members.list_by_sync_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_members_get(self, resource_group): @@ -28,7 +42,7 @@ async def test_sync_members_get(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,7 +75,7 @@ async def test_sync_members_begin_create_or_update(self, resource_group): "usePrivateLinkConnection": bool, "userName": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,7 +92,7 @@ async def test_sync_members_begin_delete(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -112,7 +126,7 @@ async def test_sync_members_begin_update(self, resource_group): "usePrivateLinkConnection": bool, "userName": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -121,15 +135,18 @@ async def test_sync_members_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_members_list_by_sync_group(self, resource_group): - response = self.client.sync_members.list_by_sync_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] + async def test_sync_members_begin_refresh_member_schema(self, resource_group): + response = await ( + await self.client.sync_members.begin_refresh_member_schema( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + sync_member_name="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @@ -142,25 +159,8 @@ async def test_sync_members_list_member_schemas(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_members_begin_refresh_member_schema(self, resource_group): - response = await ( - await self.client.sync_members.begin_refresh_member_schema( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - sync_member_name="str", - api_version="2020-11-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py index 5550b8a2f045..b638149c417c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py @@ -25,7 +25,7 @@ def test_tde_certificates_begin_create(self, resource_group): resource_group_name=resource_group.name, server_name="str", parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py index da0817d445aa..e91a48adadd1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py @@ -27,7 +27,7 @@ async def test_tde_certificates_begin_create(self, resource_group): resource_group_name=resource_group.name, server_name="str", parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py index bcce320da7bd..1d1ab12b1684 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_time_zones_list_by_location(self, resource_group): response = self.client.time_zones.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -35,7 +35,7 @@ def test_time_zones_get(self, resource_group): response = self.client.time_zones.get( location_name="str", time_zone_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py index 69929c9c88c6..24744dbde626 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_time_zones_list_by_location(self, resource_group): response = self.client.time_zones.list_by_location( location_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -36,7 +36,7 @@ async def test_time_zones_get(self, resource_group): response = await self.client.time_zones.get( location_name="str", time_zone_id="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py index da64d7581a6f..7b547aadf584 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py @@ -25,7 +25,7 @@ def test_transparent_data_encryptions_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_transparent_data_encryptions_get(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,8 +53,36 @@ def test_transparent_data_encryptions_begin_create_or_update(self, resource_grou server_name="str", database_name="str", tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2022-08-01-preview", + parameters={"id": "str", "name": "str", "scanState": "str", "state": "str", "type": "str"}, + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_resume(self, resource_group): + response = self.client.transparent_data_encryptions.begin_resume( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + tde_name="str", + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_transparent_data_encryptions_begin_suspend(self, resource_group): + response = self.client.transparent_data_encryptions.begin_suspend( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + tde_name="str", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py index b21e4bbb6fff..dedda0035d96 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py @@ -26,7 +26,7 @@ async def test_transparent_data_encryptions_list_by_database(self, resource_grou resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_transparent_data_encryptions_get(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2022-08-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,8 +55,40 @@ async def test_transparent_data_encryptions_begin_create_or_update(self, resourc server_name="str", database_name="str", tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2022-08-01-preview", + parameters={"id": "str", "name": "str", "scanState": "str", "state": "str", "type": "str"}, + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_resume(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_resume( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + tde_name="str", + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_begin_suspend(self, resource_group): + response = await ( + await self.client.transparent_data_encryptions.begin_suspend( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + tde_name="str", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py index 005fa924cbb7..e6908d868c7f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py @@ -24,7 +24,7 @@ def test_usages_list_by_instance_pool(self, resource_group): response = self.client.usages.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py index 6242bdd9c9f5..1a0763b696e0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py @@ -25,7 +25,7 @@ async def test_usages_list_by_instance_pool(self, resource_group): response = self.client.usages.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2021-02-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py index d61935941d90..b3e12646157e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_virtual_clusters_list(self, resource_group): response = self.client.virtual_clusters.list( - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_virtual_clusters_list(self, resource_group): def test_virtual_clusters_list_by_resource_group(self, resource_group): response = self.client.virtual_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,19 +45,41 @@ def test_virtual_clusters_get(self, resource_group): response = self.client.virtual_clusters.get( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_clusters_begin_create_or_update(self, resource_group): + response = self.client.virtual_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + virtual_cluster_name="str", + parameters={ + "location": "str", + "childResources": ["str"], + "id": "str", + "name": "str", + "subnetId": "str", + "tags": {"str": "str"}, + "type": "str", + "version": "str", + }, + api_version="2025-01-01", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_virtual_clusters_begin_delete(self, resource_group): response = self.client.virtual_clusters.begin_delete( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -70,7 +92,7 @@ def test_virtual_clusters_begin_update(self, resource_group): resource_group_name=resource_group.name, virtual_cluster_name="str", parameters={"childResources": ["str"], "subnetId": "str", "tags": {"str": "str"}, "version": "str"}, - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,7 +104,7 @@ def test_virtual_clusters_begin_update_dns_servers(self, resource_group): response = self.client.virtual_clusters.begin_update_dns_servers( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py index 8f67b6cefa9c..aacd87c6dfff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_virtual_clusters_list(self, resource_group): response = self.client.virtual_clusters.list( - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_virtual_clusters_list(self, resource_group): async def test_virtual_clusters_list_by_resource_group(self, resource_group): response = self.client.virtual_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2022-05-01-preview", + api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,12 +46,36 @@ async def test_virtual_clusters_get(self, resource_group): response = await self.client.virtual_clusters.get( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_clusters_begin_create_or_update(self, resource_group): + response = await ( + await self.client.virtual_clusters.begin_create_or_update( + resource_group_name=resource_group.name, + virtual_cluster_name="str", + parameters={ + "location": "str", + "childResources": ["str"], + "id": "str", + "name": "str", + "subnetId": "str", + "tags": {"str": "str"}, + "type": "str", + "version": "str", + }, + api_version="2025-01-01", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_virtual_clusters_begin_delete(self, resource_group): @@ -59,7 +83,7 @@ async def test_virtual_clusters_begin_delete(self, resource_group): await self.client.virtual_clusters.begin_delete( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -74,7 +98,7 @@ async def test_virtual_clusters_begin_update(self, resource_group): resource_group_name=resource_group.name, virtual_cluster_name="str", parameters={"childResources": ["str"], "subnetId": "str", "tags": {"str": "str"}, "version": "str"}, - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -88,7 +112,7 @@ async def test_virtual_clusters_begin_update_dns_servers(self, resource_group): await self.client.virtual_clusters.begin_update_dns_servers( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2022-05-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py index 2c6268e46383..b622ec2d1b77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py @@ -18,6 +18,18 @@ class TestSqlManagementVirtualNetworkRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_rules_list_by_server(self, resource_group): + response = self.client.virtual_network_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_virtual_network_rules_get(self, resource_group): @@ -25,7 +37,7 @@ def test_virtual_network_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -46,7 +58,7 @@ def test_virtual_network_rules_begin_create_or_update(self, resource_group): "type": "str", "virtualNetworkSubnetId": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -59,20 +71,8 @@ def test_virtual_network_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_virtual_network_rules_list_by_server(self, resource_group): - response = self.client.virtual_network_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py index 4eed6409d93e..c4f8a8fff355 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py @@ -19,6 +19,18 @@ class TestSqlManagementVirtualNetworkRulesOperationsAsync(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_rules_list_by_server(self, resource_group): + response = self.client.virtual_network_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_virtual_network_rules_get(self, resource_group): @@ -26,7 +38,7 @@ async def test_virtual_network_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,7 +60,7 @@ async def test_virtual_network_rules_begin_create_or_update(self, resource_group "type": "str", "virtualNetworkSubnetId": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -63,21 +75,9 @@ async def test_virtual_network_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_virtual_network_rules_list_by_server(self, resource_group): - response = self.client.virtual_network_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py index 84b8c20f9224..d3d9f71d4909 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py @@ -18,6 +18,20 @@ class TestSqlManagementWorkloadClassifiersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_workload_classifiers_list_by_workload_group(self, resource_group): + response = self.client.workload_classifiers.list_by_workload_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + workload_group_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_workload_classifiers_get(self, resource_group): @@ -27,7 +41,7 @@ def test_workload_classifiers_get(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,7 +67,7 @@ def test_workload_classifiers_begin_create_or_update(self, resource_group): "startTime": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -68,22 +82,8 @@ def test_workload_classifiers_begin_delete(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workload_classifiers_list_by_workload_group(self, resource_group): - response = self.client.workload_classifiers.list_by_workload_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - workload_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py index 1896b2b24d0a..1c721e750a22 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py @@ -19,6 +19,20 @@ class TestSqlManagementWorkloadClassifiersOperationsAsync(AzureMgmtRecordedTestC def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_workload_classifiers_list_by_workload_group(self, resource_group): + response = self.client.workload_classifiers.list_by_workload_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + workload_group_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_workload_classifiers_get(self, resource_group): @@ -28,7 +42,7 @@ async def test_workload_classifiers_get(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,7 +69,7 @@ async def test_workload_classifiers_begin_create_or_update(self, resource_group) "startTime": "str", "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -72,23 +86,9 @@ async def test_workload_classifiers_begin_delete(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workload_classifiers_list_by_workload_group(self, resource_group): - response = self.client.workload_classifiers.list_by_workload_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - workload_group_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py index fda6d8259f34..c356e0b77e98 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py @@ -18,6 +18,19 @@ class TestSqlManagementWorkloadGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_workload_groups_list_by_database(self, resource_group): + response = self.client.workload_groups.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_workload_groups_get(self, resource_group): @@ -26,7 +39,7 @@ def test_workload_groups_get(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,7 +64,7 @@ def test_workload_groups_begin_create_or_update(self, resource_group): "queryExecutionTimeout": 0, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -65,21 +78,8 @@ def test_workload_groups_begin_delete(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workload_groups_list_by_database(self, resource_group): - response = self.client.workload_groups.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py index 87d779ac223b..943a8bf3659b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py @@ -19,6 +19,19 @@ class TestSqlManagementWorkloadGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_workload_groups_list_by_database(self, resource_group): + response = self.client.workload_groups.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_workload_groups_get(self, resource_group): @@ -27,7 +40,7 @@ async def test_workload_groups_get(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,7 +66,7 @@ async def test_workload_groups_begin_create_or_update(self, resource_group): "queryExecutionTimeout": 0, "type": "str", }, - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -69,22 +82,9 @@ async def test_workload_groups_begin_delete(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2020-11-01-preview", + api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workload_groups_list_by_database(self, resource_group): - response = self.client.workload_groups.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2020-11-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/pyproject.toml b/sdk/sql/azure-mgmt-sql/pyproject.toml index bace00567842..6dd291c9eeeb 100644 --- a/sdk/sql/azure-mgmt-sql/pyproject.toml +++ b/sdk/sql/azure-mgmt-sql/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Sql Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 4 - Beta", + "Development Status :: 5 - Production/Stable", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -29,7 +29,7 @@ keywords = [ "azure sdk", ] dependencies = [ - "msrest>=0.7.1", + "isodate>=0.6.1", "azure-mgmt-core>=1.6.0", "typing-extensions>=4.6.0", ] @@ -54,8 +54,8 @@ content-type = "text/markdown" [tool.setuptools.packages.find] exclude = [ "tests*", - "samples*", "generated_tests*", + "samples*", "generated_samples*", "doc*", "azure", @@ -78,7 +78,7 @@ verifytypes = false package_name = "azure-mgmt-sql" package_pprint_name = "SQL Management" package_doc_id = "sql" -is_stable = false +is_stable = true sample_link = "" title = "SqlManagementClient" package_nspkg = "azure-mgmt-nspkg" From e42e42cd76aa17a259126a58c4d91d8a818a9d35 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 1 Apr 2026 18:00:14 +0800 Subject: [PATCH 2/3] generated from typespec:3256c6764d5edc188ae06b8e20a180ac484bbfb7 --- sdk/sql/azure-mgmt-sql/CHANGELOG.md | 4 + sdk/sql/azure-mgmt-sql/_metadata.json | 15 +- .../azure-mgmt-sql/apiview-properties.json | 3407 +- .../azure-mgmt-sql/azure/mgmt/sql/__init__.py | 6 +- .../{_sql_management_client.py => _client.py} | 765 +- .../azure/mgmt/sql/_configuration.py | 21 +- .../azure-mgmt-sql/azure/mgmt/sql/_patch.py | 39 +- .../azure/mgmt/sql/_utils/__init__.py | 2 +- .../azure/mgmt/sql/_utils/model_base.py | 1368 + .../azure/mgmt/sql/_utils/serialization.py | 2 +- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 4 +- .../azure/mgmt/sql/aio/__init__.py | 6 +- .../{_sql_management_client.py => _client.py} | 773 +- .../azure/mgmt/sql/aio/_configuration.py | 21 +- .../azure/mgmt/sql/aio/_patch.py | 39 +- .../azure/mgmt/sql/aio/operations/__init__.py | 447 +- ...hort_term_retention_policies_operations.py | 684 - .../operations/_capabilities_operations.py | 116 - .../_data_masking_policies_operations.py | 284 - .../_data_masking_rules_operations.py | 325 - ...ta_warehouse_user_activities_operations.py | 222 - ...d_threat_protection_settings_operations.py | 387 - .../_database_advisors_operations.py | 351 - .../_database_automatic_tuning_operations.py | 262 - ...abase_blob_auditing_policies_operations.py | 365 - .../_database_columns_operations.py | 362 - ...tabase_encryption_protectors_operations.py | 325 - .../_database_extensions_operations.py | 450 - .../_database_operations_operations.py | 209 - ...database_recommended_actions_operations.py | 365 - .../_database_schemas_operations.py | 222 - ...base_security_alert_policies_operations.py | 384 - ...ability_assessment_baselines_operations.py | 414 - ...lity_assessment_execute_scan_operations.py | 189 - ...ty_assessment_rule_baselines_operations.py | 509 - ...ility_assessment_scan_result_operations.py | 249 - ...lnerability_assessment_scans_operations.py | 237 - ...ability_assessments_settings_operations.py | 225 - .../operations/_database_tables_operations.py | 235 - .../operations/_database_usages_operations.py | 145 - ...ty_assessment_rule_baselines_operations.py | 409 - ...lnerability_assessment_scans_operations.py | 458 - ...se_vulnerability_assessments_operations.py | 459 - .../aio/operations/_databases_operations.py | 2026 - .../operations/_deleted_servers_operations.py | 399 - ...tributed_availability_groups_operations.py | 1205 - .../_elastic_pool_operations_operations.py | 210 - .../operations/_elastic_pools_operations.py | 887 - .../_encryption_protectors_operations.py | 563 - .../_endpoint_certificates_operations.py | 208 - ...abase_blob_auditing_policies_operations.py | 365 - ...erver_blob_auditing_policies_operations.py | 424 - .../operations/_failover_groups_operations.py | 1133 - .../operations/_firewall_rules_operations.py | 551 - .../_geo_backup_policies_operations.py | 383 - .../_instance_failover_groups_operations.py | 794 - .../_instance_pool_operations_operations.py | 208 - .../operations/_instance_pools_operations.py | 800 - .../_ipv6_firewall_rules_operations.py | 417 - .../aio/operations/_job_agents_operations.py | 759 - .../operations/_job_credentials_operations.py | 436 - .../operations/_job_executions_operations.py | 742 - .../_job_private_endpoints_operations.py | 572 - .../_job_step_executions_operations.py | 272 - .../aio/operations/_job_steps_operations.py | 651 - .../_job_target_executions_operations.py | 419 - .../_job_target_groups_operations.py | 436 - .../operations/_job_versions_operations.py | 225 - .../sql/aio/operations/_jobs_operations.py | 435 - .../_ledger_digest_uploads_operations.py | 591 - ..._long_term_retention_backups_operations.py | 3605 - ...ion_managed_instance_backups_operations.py | 1118 - ...long_term_retention_policies_operations.py | 452 - .../_maintenance_window_options_operations.py | 126 - .../_maintenance_windows_operations.py | 267 - ...hort_term_retention_policies_operations.py | 684 - ...d_threat_protection_settings_operations.py | 387 - .../_managed_database_columns_operations.py | 362 - ...ged_database_move_operations_operations.py | 222 - .../_managed_database_queries_operations.py | 234 - ...commended_sensitivity_labels_operations.py | 194 - ...ged_database_restore_details_operations.py | 125 - .../_managed_database_schemas_operations.py | 222 - ...base_security_alert_policies_operations.py | 384 - ...ged_database_security_events_operations.py | 168 - ..._database_sensitivity_labels_operations.py | 1017 - .../_managed_database_tables_operations.py | 235 - ..._transparent_data_encryption_operations.py | 384 - ...ty_assessment_rule_baselines_operations.py | 409 - ...lnerability_assessment_scans_operations.py | 458 - ...se_vulnerability_assessments_operations.py | 459 - .../_managed_databases_operations.py | 1797 - ...aged_instance_administrators_operations.py | 560 - ...d_threat_protection_settings_operations.py | 445 - ...zure_ad_only_authentications_operations.py | 576 - .../_managed_instance_dtcs_operations.py | 424 - ...stance_encryption_protectors_operations.py | 568 - .../_managed_instance_keys_operations.py | 553 - ...long_term_retention_policies_operations.py | 594 - ..._managed_instance_operations_operations.py | 273 - ...private_endpoint_connections_operations.py | 553 - ...tance_private_link_resources_operations.py | 212 - ...ed_instance_tde_certificates_operations.py | 251 - ...ce_vulnerability_assessments_operations.py | 444 - .../_managed_instances_operations.py | 1922 - ...anaged_ledger_digest_uploads_operations.py | 597 - ...hort_term_retention_policies_operations.py | 684 - .../_managed_server_dns_aliases_operations.py | 760 - ...rver_security_alert_policies_operations.py | 441 - ...ity_perimeter_configurations_operations.py | 342 - .../mgmt/sql/aio/operations/_operations.py | 76252 ++++++++- .../_outbound_firewall_rules_operations.py | 456 - .../azure/mgmt/sql/aio/operations/_patch.py | 13 +- ...private_endpoint_connections_operations.py | 547 - .../_private_link_resources_operations.py | 207 - ...commended_sensitivity_labels_operations.py | 194 - .../_recoverable_databases_operations.py | 220 - ...ecoverable_managed_databases_operations.py | 209 - .../_replication_links_operations.py | 1134 - ...restorable_dropped_databases_operations.py | 222 - ...le_dropped_managed_databases_operations.py | 212 - .../operations/_restore_points_operations.py | 498 - .../_sensitivity_labels_operations.py | 1017 - ...d_threat_protection_settings_operations.py | 445 - .../operations/_server_advisors_operations.py | 330 - .../_server_automatic_tuning_operations.py | 247 - ...rver_azure_ad_administrators_operations.py | 565 - ...zure_ad_only_authentications_operations.py | 574 - ...erver_blob_auditing_policies_operations.py | 419 - ...server_configuration_options_operations.py | 438 - .../_server_connection_policies_operations.py | 433 - ...erver_dev_ops_audit_settings_operations.py | 437 - .../_server_dns_aliases_operations.py | 668 - .../aio/operations/_server_keys_operations.py | 553 - .../_server_operations_operations.py | 142 - ...rver_security_alert_policies_operations.py | 438 - .../_server_trust_certificates_operations.py | 548 - .../_server_trust_groups_operations.py | 634 - .../operations/_server_usages_operations.py | 142 - ...er_vulnerability_assessments_operations.py | 443 - .../sql/aio/operations/_servers_operations.py | 1229 - .../aio/operations/_sql_agent_operations.py | 248 - ...rability_assessment_baseline_operations.py | 241 - ...ability_assessment_baselines_operations.py | 219 - ...lity_assessment_execute_scan_operations.py | 191 - ...ity_assessment_rule_baseline_operations.py | 425 - ...ty_assessment_rule_baselines_operations.py | 130 - ...ility_assessment_scan_result_operations.py | 249 - ...lnerability_assessment_scans_operations.py | 237 - ...ql_vulnerability_assessments_operations.py | 118 - ...ability_assessments_settings_operations.py | 367 - ...p_managed_instance_schedules_operations.py | 432 - .../_subscription_usages_operations.py | 195 - .../_synapse_link_workspaces_operations.py | 146 - .../aio/operations/_sync_agents_operations.py | 703 - .../aio/operations/_sync_groups_operations.py | 1344 - .../operations/_sync_members_operations.py | 1099 - .../_tde_certificates_operations.py | 251 - .../aio/operations/_time_zones_operations.py | 195 - ...transparent_data_encryptions_operations.py | 748 - .../sql/aio/operations/_usages_operations.py | 146 - .../_virtual_clusters_operations.py | 923 - .../_virtual_network_rules_operations.py | 546 - .../_workload_classifiers_operations.py | 617 - .../operations/_workload_groups_operations.py | 568 - .../azure/mgmt/sql/models/__init__.py | 526 +- ...l_management_client_enums.py => _enums.py} | 742 +- .../azure/mgmt/sql/models/_models.py | 25279 +++ .../azure/mgmt/sql/models/_models_py3.py | 23992 --- .../azure/mgmt/sql/models/_patch.py | 13 +- .../azure/mgmt/sql/operations/__init__.py | 447 +- ...hort_term_retention_policies_operations.py | 826 - .../operations/_capabilities_operations.py | 153 - .../_data_masking_policies_operations.py | 366 - .../_data_masking_rules_operations.py | 408 - ...ta_warehouse_user_activities_operations.py | 295 - ...d_threat_protection_settings_operations.py | 499 - .../_database_advisors_operations.py | 469 - .../_database_automatic_tuning_operations.py | 332 - ...abase_blob_auditing_policies_operations.py | 465 - .../_database_columns_operations.py | 498 - ...tabase_encryption_protectors_operations.py | 404 - .../_database_extensions_operations.py | 559 - .../_database_operations_operations.py | 292 - ...database_recommended_actions_operations.py | 485 - .../_database_schemas_operations.py | 302 - ...base_security_alert_policies_operations.py | 492 - ...ability_assessment_baselines_operations.py | 539 - ...lity_assessment_execute_scan_operations.py | 232 - ...ty_assessment_rule_baselines_operations.py | 683 - ...ility_assessment_scan_result_operations.py | 334 - ...lnerability_assessment_scans_operations.py | 318 - ...ability_assessments_settings_operations.py | 295 - .../operations/_database_tables_operations.py | 319 - .../operations/_database_usages_operations.py | 180 - ...ty_assessment_rule_baselines_operations.py | 543 - ...lnerability_assessment_scans_operations.py | 620 - ...se_vulnerability_assessments_operations.py | 610 - .../sql/operations/_databases_operations.py | 2485 - .../operations/_deleted_servers_operations.py | 506 - ...tributed_availability_groups_operations.py | 1480 - .../_elastic_pool_operations_operations.py | 282 - .../operations/_elastic_pools_operations.py | 1080 - .../_encryption_protectors_operations.py | 702 - .../_endpoint_certificates_operations.py | 273 - ...abase_blob_auditing_policies_operations.py | 465 - ...erver_blob_auditing_policies_operations.py | 516 - .../operations/_failover_groups_operations.py | 1386 - .../operations/_firewall_rules_operations.py | 713 - .../_geo_backup_policies_operations.py | 492 - .../_instance_failover_groups_operations.py | 983 - .../_instance_pool_operations_operations.py | 287 - .../operations/_instance_pools_operations.py | 973 - .../_ipv6_firewall_rules_operations.py | 546 - .../sql/operations/_job_agents_operations.py | 912 - .../operations/_job_credentials_operations.py | 582 - .../operations/_job_executions_operations.py | 1008 - .../_job_private_endpoints_operations.py | 718 - .../_job_step_executions_operations.py | 378 - .../sql/operations/_job_steps_operations.py | 884 - .../_job_target_executions_operations.py | 587 - .../_job_target_groups_operations.py | 582 - .../operations/_job_versions_operations.py | 300 - .../mgmt/sql/operations/_jobs_operations.py | 566 - .../_ledger_digest_uploads_operations.py | 737 - ..._long_term_retention_backups_operations.py | 4649 - ...ion_managed_instance_backups_operations.py | 1546 - ...long_term_retention_policies_operations.py | 561 - .../_maintenance_window_options_operations.py | 170 - .../_maintenance_windows_operations.py | 348 - ...hort_term_retention_policies_operations.py | 833 - ...d_threat_protection_settings_operations.py | 500 - .../_managed_database_columns_operations.py | 498 - ...ged_database_move_operations_operations.py | 298 - .../_managed_database_queries_operations.py | 322 - ...commended_sensitivity_labels_operations.py | 232 - ...ged_database_restore_details_operations.py | 166 - .../_managed_database_schemas_operations.py | 302 - ...base_security_alert_policies_operations.py | 492 - ...ged_database_security_events_operations.py | 220 - ..._database_sensitivity_labels_operations.py | 1400 - .../_managed_database_tables_operations.py | 319 - ..._transparent_data_encryption_operations.py | 492 - ...ty_assessment_rule_baselines_operations.py | 543 - ...lnerability_assessment_scans_operations.py | 620 - ...se_vulnerability_assessments_operations.py | 610 - .../_managed_databases_operations.py | 2154 - ...aged_instance_administrators_operations.py | 698 - ...d_threat_protection_settings_operations.py | 553 - ...zure_ad_only_authentications_operations.py | 715 - .../_managed_instance_dtcs_operations.py | 528 - ...stance_encryption_protectors_operations.py | 706 - .../_managed_instance_keys_operations.py | 687 - ...long_term_retention_policies_operations.py | 740 - ..._managed_instance_operations_operations.py | 365 - ...private_endpoint_connections_operations.py | 698 - ...tance_private_link_resources_operations.py | 273 - ...ed_instance_tde_certificates_operations.py | 288 - ...ce_vulnerability_assessments_operations.py | 589 - .../_managed_instances_operations.py | 2414 - ...anaged_ledger_digest_uploads_operations.py | 742 - ...hort_term_retention_policies_operations.py | 845 - .../_managed_server_dns_aliases_operations.py | 921 - ...rver_security_alert_policies_operations.py | 541 - ...ity_perimeter_configurations_operations.py | 435 - .../azure/mgmt/sql/operations/_operations.py | 93734 ++++++++++- .../_outbound_firewall_rules_operations.py | 580 - .../azure/mgmt/sql/operations/_patch.py | 13 +- ...private_endpoint_connections_operations.py | 691 - .../_private_link_resources_operations.py | 272 - ...commended_sensitivity_labels_operations.py | 232 - .../_recoverable_databases_operations.py | 296 - ...ecoverable_managed_databases_operations.py | 277 - .../_replication_links_operations.py | 1393 - ...restorable_dropped_databases_operations.py | 299 - ...le_dropped_managed_databases_operations.py | 279 - .../operations/_restore_points_operations.py | 638 - .../_sensitivity_labels_operations.py | 1400 - ...d_threat_protection_settings_operations.py | 549 - .../operations/_server_advisors_operations.py | 427 - .../_server_automatic_tuning_operations.py | 313 - ...rver_azure_ad_administrators_operations.py | 703 - ...zure_ad_only_authentications_operations.py | 709 - ...erver_blob_auditing_policies_operations.py | 514 - ...server_configuration_options_operations.py | 545 - .../_server_connection_policies_operations.py | 537 - ...erver_dev_ops_audit_settings_operations.py | 543 - .../_server_dns_aliases_operations.py | 826 - .../sql/operations/_server_keys_operations.py | 675 - .../_server_operations_operations.py | 176 - ...rver_security_alert_policies_operations.py | 541 - .../_server_trust_certificates_operations.py | 675 - .../_server_trust_groups_operations.py | 791 - .../operations/_server_usages_operations.py | 176 - ...er_vulnerability_assessments_operations.py | 587 - .../sql/operations/_servers_operations.py | 1494 - .../sql/operations/_sql_agent_operations.py | 314 - ...rability_assessment_baseline_operations.py | 326 - ...ability_assessment_baselines_operations.py | 269 - ...lity_assessment_execute_scan_operations.py | 236 - ...ity_assessment_rule_baseline_operations.py | 562 - ...ty_assessment_rule_baselines_operations.py | 179 - ...ility_assessment_scan_result_operations.py | 338 - ...lnerability_assessment_scans_operations.py | 322 - ...ql_vulnerability_assessments_operations.py | 159 - ...ability_assessments_settings_operations.py | 474 - ...p_managed_instance_schedules_operations.py | 570 - .../_subscription_usages_operations.py | 252 - .../_synapse_link_workspaces_operations.py | 181 - .../sql/operations/_sync_agents_operations.py | 887 - .../sql/operations/_sync_groups_operations.py | 1745 - .../operations/_sync_members_operations.py | 1369 - .../_tde_certificates_operations.py | 288 - .../sql/operations/_time_zones_operations.py | 252 - ...transparent_data_encryptions_operations.py | 930 - .../mgmt/sql/operations/_usages_operations.py | 187 - .../_virtual_clusters_operations.py | 1124 - .../_virtual_network_rules_operations.py | 673 - .../_workload_classifiers_operations.py | 775 - .../operations/_workload_groups_operations.py | 714 - .../azure-mgmt-sql/code_report_typespec.json | 125814 +++++++++++++++ .../administrator_create_or_update.py | 11 +- .../generated_samples/administrator_delete.py | 11 +- .../generated_samples/administrator_get.py | 11 +- .../generated_samples/administrator_list.py | 11 +- .../azure_ad_only_auth_create_or_update.py | 11 +- .../azure_ad_only_auth_delete.py | 11 +- .../azure_ad_only_auth_get.py | 11 +- .../azure_ad_only_auth_list.py | 11 +- .../cancel_database_operation.py | 11 +- .../cancel_elastic_pool_operation.py | 11 +- .../generated_samples/cancel_job_execution.py | 11 +- .../cancel_managed_instance_operation.py | 11 +- ..._long_term_retention_backup_access_tier.py | 11 +- ...name_availability_server_already_exists.py | 11 +- ...heck_name_availability_server_available.py | 11 +- .../check_name_availability_server_invalid.py | 11 +- .../column_sensitivity_label_create_max.py | 12 +- .../column_sensitivity_label_delete.py | 12 +- .../column_sensitivity_label_get.py | 11 +- .../columns_list_by_database_max.py | 11 +- .../columns_list_by_database_min.py | 11 +- ...se_configured_backup_storage_redundancy.py | 11 +- .../create_database_copy_mode.py | 10 +- .../create_database_default_enclave.py | 11 +- .../create_database_default_mode.py | 11 +- ...mode_with_keys_and_encryption_protector.py | 10 +- ...ys_and_versionless_encryption_protector.py | 10 +- .../create_database_ledger.py | 11 +- ...eate_database_maintenance_configuration.py | 10 +- .../generated_samples/create_database_min.py | 11 +- .../create_database_named_replica.py | 10 +- .../create_database_pitr_mode.py | 10 +- .../create_database_secondary_mode.py | 10 +- .../create_database_standby_mode.py | 10 +- .../create_database_vbs_enclave.py | 11 +- .../create_database_with_availability_zone.py | 11 +- ...with_encryption_protector_auto_rotation.py | 10 +- ...ate_dw_database_cross_subscription_pitr.py | 10 +- ...dw_database_cross_subscription_recovery.py | 10 +- ..._dw_database_cross_subscription_restore.py | 10 +- ...ate_elastic_pool_with_availability_zone.py | 11 +- .../generated_samples/create_job_execution.py | 11 +- .../create_managed_database_ledger.py | 11 +- ...ate_managed_short_term_retention_policy.py | 44 + ...erm_retention_policy_restorable_dropped.py | 44 + .../create_or_update_database_extensions.py | 13 +- .../create_or_update_instance_pool_max.py | 10 +- .../create_or_update_instance_pool_min.py | 10 +- .../create_or_update_job_agent.py | 10 +- ...reate_or_update_job_agent_with_identity.py | 10 +- .../create_or_update_job_agent_with_sku.py | 10 +- .../create_or_update_job_credential.py | 11 +- .../create_or_update_job_execution.py | 11 +- .../create_or_update_job_max.py | 11 +- .../create_or_update_job_min.py | 37 +- .../create_or_update_job_private_endpoint.py | 10 +- .../create_or_update_job_step_max.py | 10 +- .../create_or_update_job_step_min.py | 10 +- .../create_or_update_job_target_group_max.py | 10 +- .../create_or_update_job_target_group_min.py | 11 +- .../create_or_update_maintenance_windows.py | 13 +- ...reate_or_update_workload_classifier_max.py | 11 +- ...reate_or_update_workload_classifier_min.py | 11 +- .../create_or_update_workload_group_max.py | 11 +- .../create_or_update_workload_group_min.py | 11 +- .../create_short_term_retention_policy.py | 45 + ...ate_vcore_database_by_service_objective.py | 11 +- ...ate_vcore_database_by_sku_name_capacity.py | 11 +- ...ata_masking_policy_create_or_update_max.py | 11 +- ...ata_masking_policy_create_or_update_min.py | 11 +- .../data_masking_policy_get.py | 11 +- ...sking_rule_create_or_update_default_max.py | 11 +- ...sking_rule_create_or_update_default_min.py | 11 +- ...ta_masking_rule_create_or_update_number.py | 11 +- ...data_masking_rule_create_or_update_text.py | 11 +- .../data_masking_rule_list_by_database.py | 11 +- .../data_warehouse_restore_points_get.py | 11 +- ...rehouse_restore_points_list_by_database.py | 11 +- ...d_threat_protection_settings_create_max.py | 11 +- ...d_threat_protection_settings_create_min.py | 11 +- ...advanced_threat_protection_settings_get.py | 11 +- ...at_protection_settings_list_by_database.py | 11 +- .../generated_samples/database_advisor_get.py | 11 +- .../database_advisor_list.py | 11 +- .../database_advisor_update.py | 11 +- .../database_auditing_settings_list.py | 11 +- .../database_automatic_tuning_get.py | 11 +- .../database_automatic_tuning_update_max.py | 11 +- .../database_automatic_tuning_update_min.py | 11 +- ...abase_azure_monitor_auditing_create_min.py | 12 +- .../database_blob_auditing_create_max.py | 11 +- .../database_blob_auditing_create_min.py | 11 +- .../database_blob_auditing_get.py | 12 +- .../generated_samples/database_column_get.py | 11 +- .../database_column_list_by_table.py | 11 +- ...atabase_encryption_protector_revalidate.py | 14 +- .../database_encryption_protector_revert.py | 14 +- ...atabase_extended_auditing_settings_list.py | 11 +- .../database_recommended_action_get.py | 11 +- .../database_recommended_action_list.py | 11 +- ...database_recommended_action_list_expand.py | 11 +- .../database_recommended_action_update.py | 11 +- .../database_restore_points_delete.py | 11 +- .../database_restore_points_get.py | 11 +- ...atabase_restore_points_list_by_database.py | 11 +- .../database_restore_points_post.py | 11 +- .../generated_samples/database_schema_get.py | 11 +- .../database_schema_list_by_database.py | 11 +- .../database_security_alert_create_max.py | 12 +- .../database_security_alert_create_min.py | 13 +- .../database_security_alert_get.py | 13 +- ...atabase_security_alert_list_by_database.py | 11 +- ...l_vulnerability_assessment_baseline_add.py | 11 +- ...rability_assessment_baseline_add_latest.py | 11 +- ...l_vulnerability_assessment_baseline_get.py | 11 +- ...ne_list_by_sql_vulnerability_assessment.py | 11 +- ...tabase_sql_vulnerability_assessment_get.py | 11 +- ...lnerability_assessment_list_by_database.py | 11 +- ...erability_assessment_list_scans_results.py | 11 +- ...ability_assessment_rule_baseline_create.py | 11 +- ...ability_assessment_rule_baseline_delete.py | 11 +- ...nerability_assessment_rule_baseline_get.py | 11 +- ...sessment_rule_baseline_list_by_baseline.py | 11 +- ...abase_sql_vulnerability_assessment_scan.py | 11 +- ...ssessment_scan_records_list_by_database.py | 11 +- ..._vulnerability_assessment_scans_execute.py | 14 +- ..._vulnerability_assessment_scans_results.py | 11 +- .../generated_samples/database_table_get.py | 11 +- .../database_table_list_by_schema.py | 11 +- ...assessment_create_container_sas_key_min.py | 11 +- ...ase_vulnerability_assessment_create_max.py | 11 +- ...ssessment_create_storage_access_key_min.py | 11 +- ...atabase_vulnerability_assessment_delete.py | 11 +- .../database_vulnerability_assessment_get.py | 11 +- ...lnerability_assessment_list_by_database.py | 11 +- ...ability_assessment_rule_baseline_create.py | 11 +- ...ability_assessment_rule_baseline_delete.py | 11 +- ...nerability_assessment_rule_baseline_get.py | 11 +- ...se_vulnerability_assessment_scan_export.py | 11 +- ...lnerability_assessment_scan_records_get.py | 11 +- ...ssessment_scan_records_list_by_database.py | 11 +- ..._vulnerability_assessment_scans_execute.py | 14 +- .../generated_samples/delete_database.py | 11 +- .../generated_samples/delete_instance_pool.py | 11 +- .../generated_samples/delete_job.py | 10 +- .../generated_samples/delete_job_agent.py | 11 +- .../delete_job_credential.py | 11 +- .../delete_job_private_endpoint.py | 11 +- .../generated_samples/delete_job_step.py | 10 +- .../delete_job_target_group.py | 11 +- .../delete_workload_classifier.py | 11 +- .../delete_workload_group.py | 11 +- .../generated_samples/deleted_server_get.py | 11 +- .../generated_samples/deleted_server_list.py | 11 +- .../deleted_server_list_by_subscription.py | 11 +- .../deleted_server_recover.py | 11 +- ...tributed_availability_groups_create_max.py | 11 +- ...tributed_availability_groups_create_min.py | 11 +- .../distributed_availability_groups_delete.py | 11 +- ...istributed_availability_groups_failover.py | 11 +- .../distributed_availability_groups_get.py | 11 +- ...ed_availability_groups_list_by_instance.py | 11 +- ...istributed_availability_groups_set_role.py | 11 +- .../distributed_availability_groups_update.py | 11 +- .../elastic_pool_create_or_update_max.py | 11 +- .../elastic_pool_create_or_update_min.py | 11 +- ..._create_or_update_serverless_properties.py | 11 +- ...or_update_set_maintenance_configuration.py | 10 +- ...ate_with_default_preferred_enclave_type.py | 11 +- ..._create_with_vbs_preferred_enclave_type.py | 11 +- .../generated_samples/elastic_pool_delete.py | 11 +- .../generated_samples/elastic_pool_get.py | 11 +- ...ic_pool_get_with_preferred_enclave_type.py | 11 +- .../elastic_pool_list_by_server.py | 11 +- ...update_assign_maintenance_configuration.py | 10 +- .../elastic_pool_update_max.py | 11 +- .../elastic_pool_update_min.py | 34 +- ..._update_reset_maintenance_configuration.py | 10 +- ...astic_pool_update_serverless_properties.py | 11 +- ...ate_with_default_preferred_enclave_type.py | 11 +- ..._update_with_vbs_preferred_enclave_type.py | 11 +- ...on_protector_create_or_update_key_vault.py | 14 +- ...r_update_key_vault_with_versionless_key.py | 14 +- ...tector_create_or_update_service_managed.py | 14 +- .../encryption_protector_get.py | 11 +- ...tion_protector_get_with_versionless_key.py | 11 +- .../encryption_protector_list.py | 11 +- .../encryption_protector_revalidate.py | 14 +- .../endpoint_certificates_get.py | 11 +- .../endpoint_certificates_list_by_instance.py | 11 +- .../generated_samples/export_database.py | 11 +- ...port_database_using_database_extensions.py | 13 +- ...tabase_extensions_with_managed_identity.py | 13 +- .../export_database_with_managed_identity.py | 10 +- .../export_database_with_network_isolation.py | 10 +- ...abase_azure_monitor_auditing_create_min.py | 12 +- ...ended_database_blob_auditing_create_max.py | 11 +- ...ended_database_blob_auditing_create_min.py | 11 +- .../extended_database_blob_auditing_get.py | 12 +- ...xtended_server_blob_auditing_create_max.py | 14 +- ...xtended_server_blob_auditing_create_min.py | 14 +- .../extended_server_blob_auditing_get.py | 12 +- .../generated_samples/failover_database.py | 14 +- .../failover_elastic_pool.py | 14 +- .../failover_group_create_or_update.py | 10 +- ...roup_create_or_update_standby_secondary.py | 10 +- .../failover_group_delete.py | 11 +- .../failover_group_failover.py | 11 +- ...er_group_force_failover_allow_data_loss.py | 11 +- .../generated_samples/failover_group_get.py | 11 +- .../generated_samples/failover_group_list.py | 11 +- ...roup_try_planned_before_forced_failover.py | 11 +- .../failover_group_update.py | 10 +- ...failover_group_update_standby_secondary.py | 10 +- .../failover_managed_instance.py | 14 +- .../generated_samples/firewall_rule_create.py | 11 +- .../generated_samples/firewall_rule_delete.py | 11 +- .../generated_samples/firewall_rule_get.py | 11 +- .../generated_samples/firewall_rule_list.py | 11 +- .../firewall_rule_replace.py | 11 +- .../generated_samples/firewall_rule_update.py | 11 +- .../geo_backup_policies_create_or_update.py | 11 +- .../geo_backup_policies_get.py | 11 +- .../geo_backup_policies_list.py | 11 +- .../get_data_warehouse_user_activities.py | 11 +- .../get_database_extensions.py | 11 +- .../generated_samples/get_database_usages.py | 11 +- .../get_database_with_availability_zone.py | 11 +- ...get_elastic_pool_with_availability_zone.py | 11 +- ...elastic_pool_with_serverless_properties.py | 11 +- .../generated_samples/get_instance_pool.py | 11 +- .../get_instance_pool_operation.py | 11 +- .../generated_samples/get_job.py | 10 +- .../generated_samples/get_job_agent.py | 10 +- .../generated_samples/get_job_credential.py | 11 +- .../generated_samples/get_job_execution.py | 11 +- .../get_job_execution_step.py | 11 +- .../get_job_execution_target.py | 11 +- .../get_job_private_endpoint.py | 11 +- .../generated_samples/get_job_step_by_job.py | 11 +- .../get_job_step_by_version.py | 11 +- .../generated_samples/get_job_target_group.py | 11 +- .../generated_samples/get_job_version.py | 10 +- ...ist_managed_short_term_retention_policy.py | 11 +- ...erm_retention_policy_restorable_dropped.py | 10 +- .../get_maintenance_window_options.py | 11 +- .../get_maintenance_windows.py | 11 +- .../get_managed_instance_operation.py | 11 +- ...get_managed_short_term_retention_policy.py | 11 +- ...erm_retention_policy_restorable_dropped.py | 11 +- .../get_recoverable_managed_database.py | 11 +- .../get_restorable_dropped_database.py | 11 +- ...ropped_database_with_expand_equals_keys.py | 11 +- ...get_restorable_dropped_managed_database.py | 11 +- .../get_short_term_retention_policy.py | 11 +- .../generated_samples/get_vcore_database.py | 11 +- .../get_vcore_database_default_enclave.py | 11 +- .../get_vcore_database_vbs_enclave.py | 11 +- ..._vcore_database_with_expand_equals_keys.py | 11 +- ...xpand_equals_keys_with_versionless_keys.py | 11 +- .../get_workload_classifier.py | 11 +- .../get_workload_classifier_list.py | 11 +- .../generated_samples/get_workload_group.py | 11 +- .../get_workload_group_list.py | 11 +- ...ate_set_high_availability_replica_count.py | 11 +- .../hyperscale_elastic_pool_get.py | 11 +- ...ate_set_high_availability_replica_count.py | 11 +- .../generated_samples/import_database.py | 11 +- ...port_database_using_database_extensions.py | 13 +- .../import_database_with_managed_identity.py | 10 +- .../import_database_with_network_isolation.py | 10 +- .../generated_samples/import_new_database.py | 11 +- ...port_new_database_with_managed_identity.py | 10 +- ...ort_new_database_with_network_isolation.py | 10 +- ...naged_database_list_by_managed_instance.py | 11 +- ...nstance_failover_group_create_or_update.py | 10 +- .../instance_failover_group_delete.py | 11 +- .../instance_failover_group_failover.py | 11 +- ...er_group_force_failover_allow_data_loss.py | 11 +- .../instance_failover_group_get.py | 11 +- .../instance_failover_group_list.py | 11 +- .../ipv6_firewall_rule_create.py | 11 +- .../ipv6_firewall_rule_delete.py | 11 +- .../ipv6_firewall_rule_get.py | 11 +- .../ipv6_firewall_rule_list.py | 11 +- .../ipv6_firewall_rule_update.py | 11 +- .../ledger_digest_uploads_disable.py | 11 +- .../ledger_digest_uploads_enable.py | 14 +- .../ledger_digest_uploads_get.py | 11 +- .../ledger_digest_uploads_list.py | 11 +- .../list_data_warehouse_user_activities.py | 11 +- .../list_database_extensions.py | 11 +- .../list_database_operations.py | 13 +- .../list_databases_by_elastic_pool.py | 13 +- .../list_elastic_pool_operations.py | 11 +- .../list_instance_pool_operations.py | 11 +- .../list_instance_pool_operations_empty.py | 11 +- .../list_instance_pool_usage.py | 11 +- .../list_instance_pool_usage_expanded.py | 11 +- .../list_instance_pools_by_resource_group.py | 11 +- .../list_instance_pools_by_subscription_id.py | 11 +- .../list_job_agents_by_server.py | 11 +- .../list_job_credentials_by_agent.py | 11 +- .../list_job_execution_steps.py | 11 +- ...list_job_execution_targets_by_execution.py | 11 +- .../list_job_execution_targets_by_step.py | 11 +- .../list_job_executions_by_agent.py | 11 +- ...ist_job_executions_by_agent_with_filter.py | 11 +- .../list_job_executions_by_job.py | 11 +- .../list_job_private_endpoints_by_agent.py | 11 +- .../list_job_steps_by_job.py | 11 +- .../list_job_steps_by_version.py | 11 +- .../list_job_target_groups.py | 11 +- .../generated_samples/list_job_versions.py | 11 +- .../generated_samples/list_jobs_by_agent.py | 11 +- .../list_managed_instance_operations.py | 11 +- .../generated_samples/list_operations.py | 9 +- ...etwork_dependencies_by_managed_instance.py | 11 +- ...recoverable_managed_databases_by_server.py | 11 +- ..._restorable_dropped_databases_by_server.py | 11 +- .../list_server_operations.py | 11 +- ...ort_term_retention_policies_by_database.py | 11 +- .../list_vcore_databases_by_server.py | 11 +- ...st_vcore_databases_by_server_with_odata.py | 43 + ..._vcore_databases_enclave_type_by_server.py | 11 +- ..._vcore_inaccessible_databases_by_server.py | 11 +- .../location_capability_list_by_location.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- .../long_term_retention_backup_copy.py | 10 +- .../long_term_retention_backup_delete.py | 11 +- .../long_term_retention_backup_get.py | 11 +- ..._term_retention_backup_list_by_database.py | 11 +- ..._term_retention_backup_list_by_location.py | 11 +- ...ng_term_retention_backup_list_by_server.py | 11 +- .../long_term_retention_backup_update.py | 11 +- ..._term_retention_policy_create_or_update.py | 14 +- .../long_term_retention_policy_get.py | 11 +- ..._term_retention_policy_list_by_database.py | 11 +- .../managed_columns_list_by_database_max.py | 11 +- .../managed_columns_list_by_database_min.py | 11 +- ...d_threat_protection_settings_create_max.py | 11 +- ...d_threat_protection_settings_create_min.py | 11 +- ...advanced_threat_protection_settings_get.py | 11 +- ...at_protection_settings_list_by_database.py | 11 +- .../managed_database_cancel_move.py | 13 +- .../managed_database_column_get.py | 11 +- .../managed_database_column_list_by_table.py | 11 +- ...atabase_column_sensitivity_label_create.py | 12 +- ...atabase_column_sensitivity_label_delete.py | 12 +- ...d_database_column_sensitivity_label_get.py | 11 +- ...aged_database_complete_external_restore.py | 14 +- .../managed_database_complete_move.py | 13 +- ...ross_subscription_point_in_time_restore.py | 10 +- .../managed_database_create_max.py | 11 +- .../managed_database_create_min.py | 11 +- ...d_database_create_point_in_time_restore.py | 10 +- .../managed_database_create_recovery.py | 10 +- ...database_create_restore_external_backup.py | 11 +- ...estore_external_backup_managed_identity.py | 11 +- ...aged_database_create_restore_ltr_backup.py | 11 +- .../managed_database_delete.py | 11 +- .../generated_samples/managed_database_get.py | 11 +- ...naged_database_list_by_managed_instance.py | 11 +- ...aged_database_move_operation_result_get.py | 11 +- ...ged_database_move_operation_result_list.py | 11 +- ...e_operation_result_list_last_operations.py | 11 +- ...database_move_operation_result_list_max.py | 11 +- ...mended_column_sensitivity_label_disable.py | 12 +- ...mmended_column_sensitivity_label_enable.py | 12 +- ..._reevaluate_inaccessible_database_state.py | 11 +- .../managed_database_restore_details.py | 11 +- .../managed_database_schema_get.py | 11 +- ...anaged_database_schema_list_by_database.py | 11 +- ...aged_database_security_alert_create_max.py | 12 +- ...aged_database_security_alert_create_min.py | 13 +- .../managed_database_security_alert_get.py | 13 +- ...atabase_security_alert_list_by_database.py | 11 +- ...anaged_database_security_events_get_max.py | 11 +- ...anaged_database_security_events_get_min.py | 11 +- ...abase_sensitivity_labels_current_update.py | 11 +- ...ase_sensitivity_labels_list_by_database.py | 11 +- ...itivity_labels_list_by_database_current.py | 11 +- ...ity_labels_list_by_database_recommended.py | 11 +- ...e_sensitivity_labels_recommended_update.py | 11 +- .../managed_database_start_move_max.py | 13 +- .../managed_database_start_move_min.py | 13 +- .../managed_database_table_get.py | 11 +- .../managed_database_table_list_by_schema.py | 11 +- .../managed_database_update_max.py | 11 +- .../managed_database_update_min.py | 11 +- ...ase_vulnerability_assessment_create_max.py | 11 +- ...ase_vulnerability_assessment_create_min.py | 11 +- ...atabase_vulnerability_assessment_delete.py | 11 +- ...d_database_vulnerability_assessment_get.py | 11 +- ...lnerability_assessment_list_by_database.py | 11 +- ...ability_assessment_rule_baseline_create.py | 11 +- ...ability_assessment_rule_baseline_delete.py | 11 +- ...nerability_assessment_rule_baseline_get.py | 11 +- ...se_vulnerability_assessment_scan_export.py | 11 +- ...lnerability_assessment_scan_records_get.py | 11 +- ...ssessment_scan_records_list_by_database.py | 11 +- ..._vulnerability_assessment_scans_execute.py | 14 +- ...validate_azure_key_vault_encryption_key.py | 14 +- .../managed_instance_administrator_create.py | 11 +- .../managed_instance_administrator_delete.py | 11 +- .../managed_instance_administrator_get.py | 11 +- ...instance_administrator_list_by_instance.py | 11 +- .../managed_instance_administrator_update.py | 11 +- ...d_threat_protection_settings_create_max.py | 11 +- ...d_threat_protection_settings_create_min.py | 11 +- ...advanced_threat_protection_settings_get.py | 11 +- ...at_protection_settings_list_by_instance.py | 11 +- ...nce_azure_ad_only_auth_create_or_update.py | 11 +- ...aged_instance_azure_ad_only_auth_delete.py | 11 +- ...managed_instance_azure_ad_only_auth_get.py | 11 +- ...nce_azure_ad_only_auth_list_by_instance.py | 11 +- .../managed_instance_create_max.py | 10 +- .../managed_instance_create_min.py | 10 +- .../managed_instance_delete.py | 11 +- .../managed_instance_dtc_get.py | 11 +- .../managed_instance_dtc_list.py | 11 +- .../managed_instance_dtc_update_enable_dtc.py | 11 +- .../managed_instance_dtc_update_max.py | 11 +- ...on_protector_create_or_update_key_vault.py | 11 +- ...tector_create_or_update_service_managed.py | 11 +- ...naged_instance_encryption_protector_get.py | 11 +- ...aged_instance_encryption_protector_list.py | 11 +- ...nstance_encryption_protector_revalidate.py | 14 +- .../generated_samples/managed_instance_get.py | 11 +- .../managed_instance_get_while_updating.py | 11 +- ...e_get_with_expand_equals_administrators.py | 11 +- .../managed_instance_key_create_or_update.py | 11 +- .../managed_instance_key_delete.py | 11 +- .../managed_instance_key_get.py | 11 +- .../managed_instance_key_list.py | 11 +- .../managed_instance_list.py | 11 +- .../managed_instance_list_by_instance_pool.py | 11 +- ..._pool_with_expand_equals_administrators.py | 11 +- ...managed_instance_list_by_resource_group.py | 11 +- ...group_with_expand_equals_administrators.py | 11 +- ..._list_with_expand_equals_administrators.py | 11 +- ...tance_long_term_retention_backup_delete.py | 11 +- ...instance_long_term_retention_backup_get.py | 11 +- ..._term_retention_backup_list_by_database.py | 11 +- ..._term_retention_backup_list_by_instance.py | 11 +- ..._term_retention_backup_list_by_location.py | 11 +- ...m_retention_backup_list_by_location_max.py | 11 +- ..._term_retention_policy_create_or_update.py | 14 +- ...tance_long_term_retention_policy_delete.py | 14 +- ...instance_long_term_retention_policy_get.py | 11 +- ..._term_retention_policy_list_by_database.py | 11 +- ...ance_private_endpoint_connection_delete.py | 11 +- ...nstance_private_endpoint_connection_get.py | 11 +- ...stance_private_endpoint_connection_list.py | 11 +- ...ance_private_endpoint_connection_update.py | 16 +- ...ged_instance_private_link_resources_get.py | 11 +- ...ed_instance_private_link_resources_list.py | 11 +- .../managed_instance_query_get.py | 11 +- .../managed_instance_query_statistics_list.py | 11 +- ...aged_instance_query_statistics_list_max.py | 11 +- ...aged_instance_query_statistics_list_min.py | 11 +- ..._reevaluate_inaccessible_database_state.py | 14 +- ...ance_refresh_external_governance_status.py | 11 +- ...stance_remove_maintenance_configuration.py | 10 +- .../managed_instance_tde_certificate.py | 14 +- .../managed_instance_time_zone_get.py | 11 +- ...ged_instance_time_zone_list_by_location.py | 11 +- .../managed_instance_top_queries_list.py | 11 +- .../managed_instance_top_queries_list_max.py | 11 +- .../managed_instance_top_queries_list_min.py | 11 +- .../managed_instance_update_max.py | 10 +- .../managed_instance_update_min.py | 11 +- ...assessment_create_container_sas_key_min.py | 11 +- ...nce_vulnerability_assessment_create_max.py | 11 +- ...ssessment_create_storage_access_key_min.py | 11 +- ...nstance_vulnerability_assessment_delete.py | 11 +- ...d_instance_vulnerability_assessment_get.py | 11 +- ...lnerability_assessment_list_by_instance.py | 11 +- .../managed_ledger_digest_uploads_disable.py | 11 +- .../managed_ledger_digest_uploads_enable.py | 14 +- .../managed_ledger_digest_uploads_get.py | 11 +- .../managed_ledger_digest_uploads_list.py | 11 +- .../managed_server_dns_alias_acquire.py | 10 +- ...naged_server_dns_alias_create_or_update.py | 13 +- .../managed_server_dns_alias_delete.py | 11 +- .../managed_server_dns_alias_get.py | 11 +- .../managed_server_dns_alias_list.py | 11 +- ...anaged_server_security_alert_create_max.py | 10 +- ...anaged_server_security_alert_create_min.py | 11 +- .../managed_server_security_alert_get.py | 11 +- ..._server_security_alert_list_by_instance.py | 11 +- ...managed_transparent_data_encryption_get.py | 11 +- ...anaged_transparent_data_encryption_list.py | 11 +- ...aged_transparent_data_encryption_update.py | 11 +- ...k_security_perimeter_configurations_get.py | 11 +- ...perimeter_configurations_list_by_server.py | 11 +- ...rity_perimeter_configurations_reconcile.py | 11 +- .../outbound_firewall_rule_create.py | 11 +- .../outbound_firewall_rule_delete.py | 11 +- .../outbound_firewall_rule_get.py | 11 +- .../outbound_firewall_rule_list.py | 11 +- .../patch_database_default_enclave.py | 11 +- .../patch_database_vbs_enclave.py | 11 +- .../generated_samples/patch_instance_pool.py | 11 +- .../generated_samples/patch_vcore_database.py | 11 +- ...tabase_assign_maintenance_configuration.py | 10 +- ...atabase_reset_maintenance_configuration.py | 10 +- ...base_with_keys_and_encryption_protector.py | 10 +- .../generated_samples/pause_database.py | 10 +- .../private_endpoint_connection_delete.py | 11 +- .../private_endpoint_connection_get.py | 11 +- .../private_endpoint_connection_list.py | 11 +- .../private_endpoint_connection_update.py | 13 +- .../private_link_resources_get.py | 11 +- .../private_link_resources_list.py | 11 +- ...mended_column_sensitivity_label_disable.py | 12 +- ...mmended_column_sensitivity_label_enable.py | 12 +- .../recoverable_database_get.py | 11 +- ...le_database_get_with_expand_equals_keys.py | 11 +- .../recoverable_database_list.py | 11 +- .../refresh_external_governance_status.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- .../generated_samples/rename_database.py | 10 +- .../replication_link_create_or_update.py | 11 +- .../replication_link_delete.py | 11 +- .../replication_link_failover.py | 11 +- ...plication_link_failover_allow_data_loss.py | 11 +- .../generated_samples/replication_link_get.py | 11 +- .../replication_link_list_by_database.py | 11 +- .../replication_link_list_by_server.py | 11 +- .../replication_link_update.py | 11 +- ..._long_term_retention_backup_access_tier.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- ...p_based_long_term_retention_backup_copy.py | 10 +- ...based_long_term_retention_backup_delete.py | 11 +- ...up_based_long_term_retention_backup_get.py | 11 +- ..._term_retention_backup_list_by_database.py | 11 +- ..._term_retention_backup_list_by_location.py | 11 +- ...ng_term_retention_backup_list_by_server.py | 11 +- ...based_long_term_retention_backup_update.py | 11 +- ...tance_long_term_retention_backup_delete.py | 11 +- ...instance_long_term_retention_backup_get.py | 11 +- ..._term_retention_backup_list_by_database.py | 11 +- ..._term_retention_backup_list_by_instance.py | 11 +- ..._term_retention_backup_list_by_location.py | 11 +- ...m_retention_backup_list_by_location_max.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- ...naged_database_list_by_managed_instance.py | 11 +- .../generated_samples/resume_database.py | 11 +- ...sume_transparent_data_encryption_update.py | 11 +- .../sensitivity_labels_current_update.py | 11 +- .../sensitivity_labels_list_by_database.py | 11 +- ...ls_list_by_database_with_source_current.py | 11 +- ...ist_by_database_with_source_recommended.py | 11 +- .../sensitivity_labels_recommended_update.py | 11 +- ...d_threat_protection_settings_create_max.py | 11 +- ...d_threat_protection_settings_create_min.py | 11 +- ...advanced_threat_protection_settings_get.py | 11 +- ...reat_protection_settings_list_by_server.py | 11 +- .../generated_samples/server_advisor_get.py | 11 +- .../generated_samples/server_advisor_list.py | 11 +- .../server_advisor_update.py | 11 +- .../server_auditing_settings_list.py | 11 +- .../server_automatic_tuning_get.py | 11 +- .../server_automatic_tuning_update_max.py | 11 +- .../server_automatic_tuning_update_min.py | 11 +- .../server_blob_auditing_create_max.py | 11 +- .../server_blob_auditing_create_min.py | 11 +- .../server_blob_auditing_get.py | 12 +- .../server_configuration_option_get.py | 11 +- .../server_configuration_option_list.py | 11 +- .../server_configuration_option_update.py | 11 +- .../server_connection_policies_get.py | 11 +- .../server_connection_policies_list.py | 11 +- .../server_connection_policies_update.py | 11 +- .../generated_samples/server_create.py | 10 +- .../generated_samples/server_delete.py | 10 +- .../server_dev_ops_audit_create_max.py | 11 +- .../server_dev_ops_audit_create_min.py | 11 +- .../server_dev_ops_audit_get.py | 11 +- .../server_dev_ops_audit_list.py | 11 +- .../server_dns_alias_acquire.py | 10 +- .../server_dns_alias_create_or_update.py | 11 +- .../server_dns_alias_delete.py | 11 +- .../generated_samples/server_dns_alias_get.py | 11 +- .../server_dns_alias_list.py | 11 +- .../server_extended_auditing_settings_list.py | 11 +- .../generated_samples/server_get.py | 10 +- ...r_get_with_expand_equals_administrators.py | 11 +- .../server_key_create_or_update.py | 11 +- ...y_create_or_update_with_versionless_key.py | 11 +- .../generated_samples/server_key_delete.py | 11 +- .../generated_samples/server_key_get.py | 10 +- .../server_key_get_with_versionless_key.py | 11 +- .../generated_samples/server_key_list.py | 10 +- .../generated_samples/server_list.py | 10 +- .../server_list_by_resource_group.py | 11 +- ...group_with_expand_equals_administrators.py | 11 +- ..._list_with_expand_equals_administrators.py | 11 +- .../server_recommended_action_list_expand.py | 11 +- .../server_security_alerts_create_max.py | 10 +- .../server_security_alerts_create_min.py | 11 +- .../server_security_alerts_get.py | 11 +- .../server_security_alerts_list_by_server.py | 11 +- .../server_trust_certificates_create.py | 11 +- .../server_trust_certificates_delete.py | 11 +- .../server_trust_certificates_get.py | 11 +- ...ver_trust_certificates_list_by_instance.py | 11 +- .../server_trust_group_create.py | 10 +- .../server_trust_group_delete.py | 11 +- .../server_trust_group_get.py | 11 +- .../server_trust_group_list.py | 11 +- ...er_trust_group_list_by_managed_instance.py | 11 +- .../generated_samples/server_update.py | 10 +- .../generated_samples/server_usage_list.py | 11 +- ...assessment_create_container_sas_key_min.py | 11 +- ...ver_vulnerability_assessment_create_max.py | 11 +- ...ssessment_create_storage_access_key_min.py | 11 +- .../server_vulnerability_assessment_delete.py | 11 +- .../server_vulnerability_assessment_get.py | 11 +- ...vulnerability_assessment_list_by_server.py | 11 +- ...immutability_long_term_retention_backup.py | 11 +- .../sql_agent_configuration_get.py | 11 +- .../sql_agent_configuration_put.py | 11 +- .../sql_tde_certificate_create.py | 14 +- ...l_vulnerability_assessment_baseline_add.py | 12 +- ...rability_assessment_baseline_add_latest.py | 12 +- ...l_vulnerability_assessment_baseline_get.py | 12 +- ...ne_list_by_sql_vulnerability_assessment.py | 12 +- .../sql_vulnerability_assessment_create.py | 11 +- .../sql_vulnerability_assessment_delete.py | 11 +- .../sql_vulnerability_assessment_get.py | 11 +- ...vulnerability_assessment_list_by_server.py | 11 +- ...erability_assessment_list_scans_results.py | 12 +- ...ability_assessment_rule_baseline_create.py | 12 +- ...ability_assessment_rule_baseline_delete.py | 12 +- ...nerability_assessment_rule_baseline_get.py | 12 +- ...sessment_rule_baseline_list_by_baseline.py | 12 +- .../sql_vulnerability_assessment_scan.py | 12 +- ...ssessment_scan_records_list_by_database.py | 12 +- ..._vulnerability_assessment_scans_execute.py | 15 +- ..._vulnerability_assessment_scans_results.py | 12 +- .../start_managed_instance.py | 11 +- ..._instance_schedule_create_or_update_max.py | 11 +- ..._instance_schedule_create_or_update_min.py | 11 +- ...t_stop_managed_instance_schedule_delete.py | 11 +- ...tart_stop_managed_instance_schedule_get.py | 11 +- ...art_stop_managed_instance_schedule_list.py | 11 +- .../stop_managed_instance.py | 11 +- .../subscription_usage_get.py | 11 +- .../subscription_usage_list_by_location.py | 11 +- ...pend_transparent_data_encryption_update.py | 11 +- ...synapse_link_workspace_list_by_database.py | 11 +- .../generated_samples/sync_agent_create.py | 10 +- .../generated_samples/sync_agent_delete.py | 11 +- .../sync_agent_generate_key.py | 11 +- .../generated_samples/sync_agent_get.py | 10 +- .../sync_agent_get_linked_databases.py | 11 +- .../sync_agent_list_by_server.py | 11 +- .../generated_samples/sync_agent_update.py | 10 +- .../sync_group_cancel_sync.py | 11 +- .../generated_samples/sync_group_create.py | 10 +- .../sync_group_create_with_identity.py | 59 + .../generated_samples/sync_group_delete.py | 11 +- .../generated_samples/sync_group_get.py | 10 +- .../sync_group_get_hub_schema.py | 11 +- .../generated_samples/sync_group_get_log.py | 11 +- .../sync_group_get_sync_database_id.py | 11 +- .../sync_group_get_with_identity.py | 44 + .../sync_group_list_by_database.py | 11 +- .../generated_samples/sync_group_patch.py | 10 +- ...ync_group_patch_add_and_remove_identity.py | 60 + .../sync_group_patch_with_identity.py | 59 + .../sync_group_refresh_hub_schema.py | 14 +- .../sync_group_trigger_sync.py | 11 +- .../generated_samples/sync_group_update.py | 10 +- .../generated_samples/sync_member_create.py | 10 +- .../sync_member_create_with_identity.py | 62 + .../generated_samples/sync_member_delete.py | 11 +- .../generated_samples/sync_member_get.py | 10 +- .../sync_member_get_schema.py | 11 +- .../sync_member_get_with_identity.py | 45 + .../sync_member_list_by_sync_group.py | 11 +- .../generated_samples/sync_member_patch.py | 10 +- ...nc_member_patch_add_and_remove_identity.py | 63 + .../sync_member_patch_with_identity.py | 62 + .../sync_member_refresh_schema.py | 14 +- .../generated_samples/sync_member_update.py | 10 +- .../transparent_data_encryption_get.py | 11 +- .../transparent_data_encryption_list.py | 11 +- .../transparent_data_encryption_update.py | 11 +- ...se_hyperscale_migration_perform_cutover.py | 10 +- ...yperscale_migration_with_manual_cutover.py | 10 +- .../generated_samples/update_job_agent.py | 11 +- .../update_job_agent_with_identity.py | 10 +- .../update_job_agent_with_sku.py | 11 +- ...ate_managed_short_term_retention_policy.py | 13 +- ...erm_retention_policy_restorable_dropped.py | 13 +- .../update_short_term_retention_policy.py | 13 +- .../update_virtual_cluster_dns_servers.py | 11 +- .../upgrade_data_warehouse.py | 14 +- .../virtual_cluster_create.py | 11 +- .../virtual_cluster_delete.py | 11 +- .../generated_samples/virtual_cluster_get.py | 11 +- .../generated_samples/virtual_cluster_list.py | 11 +- .../virtual_cluster_list_by_resource_group.py | 11 +- .../virtual_cluster_update.py | 11 +- .../virtual_network_rules_create_or_update.py | 10 +- .../virtual_network_rules_delete.py | 11 +- .../virtual_network_rules_get.py | 11 +- .../virtual_network_rules_list.py | 11 +- .../generated_tests/conftest.py | 18 +- ...ort_term_retention_policies_operations.py} | 66 +- ...rm_retention_policies_operations_async.py} | 58 +- ...py => test_sql_capabilities_operations.py} | 9 +- ...test_sql_capabilities_operations_async.py} | 9 +- ...t_sql_data_masking_policies_operations.py} | 28 +- ...data_masking_policies_operations_async.py} | 28 +- ...test_sql_data_masking_rules_operations.py} | 35 +- ...ql_data_masking_rules_operations_async.py} | 35 +- ...a_warehouse_user_activities_operations.py} | 24 +- ...house_user_activities_operations_async.py} | 24 +- ..._threat_protection_settings_operations.py} | 38 +- ...t_protection_settings_operations_async.py} | 38 +- .../test_sql_database_advisors_operations.py | 149 + ..._sql_database_advisors_operations_async.py | 150 + ...l_database_automatic_tuning_operations.py} | 28 +- ...base_automatic_tuning_operations_async.py} | 28 +- ...base_blob_auditing_policies_operations.py} | 69 +- ...lob_auditing_policies_operations_async.py} | 69 +- ...> test_sql_database_columns_operations.py} | 29 +- ..._sql_database_columns_operations_async.py} | 29 +- ...abase_encryption_protectors_operations.py} | 10 +- ...encryption_protectors_operations_async.py} | 10 +- ...est_sql_database_extensions_operations.py} | 59 +- ...l_database_extensions_operations_async.py} | 59 +- ...est_sql_database_operations_operations.py} | 10 +- ...l_database_operations_operations_async.py} | 10 +- ...database_recommended_actions_operations.py | 124 + ...se_recommended_actions_operations_async.py | 125 + ...> test_sql_database_schemas_operations.py} | 24 +- ..._sql_database_schemas_operations_async.py} | 24 +- ...ase_security_alert_policies_operations.py} | 53 +- ...curity_alert_policies_operations_async.py} | 53 +- ...bility_assessment_baselines_operations.py} | 40 +- ..._assessment_baselines_operations_async.py} | 44 +- ...ity_assessment_execute_scan_operations.py} | 9 +- ...sessment_execute_scan_operations_async.py} | 9 +- ...y_assessment_rule_baselines_operations.py} | 43 +- ...ssment_rule_baselines_operations_async.py} | 43 +- ...lity_assessment_scan_result_operations.py} | 24 +- ...ssessment_scan_result_operations_async.py} | 24 +- ...nerability_assessment_scans_operations.py} | 24 +- ...lity_assessment_scans_operations_async.py} | 28 +- ...bility_assessments_settings_operations.py} | 24 +- ..._assessments_settings_operations_async.py} | 24 +- ...=> test_sql_database_tables_operations.py} | 24 +- ...t_sql_database_tables_operations_async.py} | 24 +- ...=> test_sql_database_usages_operations.py} | 9 +- ...t_sql_database_usages_operations_async.py} | 9 +- ...y_assessment_rule_baselines_operations.py} | 26 +- ...ssment_rule_baselines_operations_async.py} | 26 +- ...nerability_assessment_scans_operations.py} | 26 +- ...lity_assessment_scans_operations_async.py} | 26 +- ...e_vulnerability_assessments_operations.py} | 54 +- ...erability_assessments_operations_async.py} | 54 +- ...nc.py => test_sql_databases_operations.py} | 307 +- .../test_sql_databases_operations_async.py | 371 + ...=> test_sql_deleted_servers_operations.py} | 35 +- ...t_sql_deleted_servers_operations_async.py} | 39 +- ...ributed_availability_groups_operations.py} | 166 +- ...ed_availability_groups_operations_async.py | 221 + ...sql_elastic_pool_operations_operations.py} | 10 +- ...astic_pool_operations_operations_async.py} | 10 +- ...y => test_sql_elastic_pools_operations.py} | 110 +- ...est_sql_elastic_pools_operations_async.py} | 110 +- ...t_sql_encryption_protectors_operations.py} | 58 +- ...encryption_protectors_operations_async.py} | 58 +- ...t_sql_endpoint_certificates_operations.py} | 24 +- ...endpoint_certificates_operations_async.py} | 24 +- ...base_blob_auditing_policies_operations.py} | 71 +- ...lob_auditing_policies_operations_async.py} | 71 +- ...rver_blob_auditing_policies_operations.py} | 71 +- ...lob_auditing_policies_operations_async.py} | 71 +- ...=> test_sql_failover_groups_operations.py} | 88 +- ...t_sql_failover_groups_operations_async.py} | 88 +- ... => test_sql_firewall_rules_operations.py} | 57 +- ...st_sql_firewall_rules_operations_async.py} | 57 +- ...est_sql_geo_backup_policies_operations.py} | 46 +- ...l_geo_backup_policies_operations_async.py} | 46 +- ...ql_instance_failover_groups_operations.py} | 60 +- ...tance_failover_groups_operations_async.py} | 62 +- ...ql_instance_pool_operations_operations.py} | 24 +- ...tance_pool_operations_operations_async.py} | 24 +- ... => test_sql_instance_pools_operations.py} | 99 +- ...st_sql_instance_pools_operations_async.py} | 99 +- ...est_sql_ipv6_firewall_rules_operations.py} | 41 +- ...l_ipv6_firewall_rules_operations_async.py} | 41 +- ...s.py => test_sql_job_agents_operations.py} | 70 +- ...> test_sql_job_agents_operations_async.py} | 72 +- ...=> test_sql_job_credentials_operations.py} | 49 +- ...t_sql_job_credentials_operations_async.py} | 49 +- ... => test_sql_job_executions_operations.py} | 52 +- ...st_sql_job_executions_operations_async.py} | 64 +- ...t_sql_job_private_endpoints_operations.py} | 47 +- ...job_private_endpoints_operations_async.py} | 47 +- ...est_sql_job_step_executions_operations.py} | 24 +- ...l_job_step_executions_operations_async.py} | 24 +- ...ns.py => test_sql_job_steps_operations.py} | 94 +- ...=> test_sql_job_steps_operations_async.py} | 94 +- ...t_sql_job_target_executions_operations.py} | 25 +- ...job_target_executions_operations_async.py} | 25 +- ... test_sql_job_target_groups_operations.py} | 68 +- ...sql_job_target_groups_operations_async.py} | 68 +- ...py => test_sql_job_versions_operations.py} | 24 +- ...test_sql_job_versions_operations_async.py} | 24 +- ...rations.py => test_sql_jobs_operations.py} | 62 +- ...c.py => test_sql_jobs_operations_async.py} | 62 +- ...t_sql_ledger_digest_uploads_operations.py} | 49 +- ...ledger_digest_uploads_operations_async.py} | 51 +- ...long_term_retention_backups_operations.py} | 196 +- ...erm_retention_backups_operations_async.py} | 202 +- ...on_managed_instance_backups_operations.py} | 86 +- ...aged_instance_backups_operations_async.py} | 90 +- ...ong_term_retention_policies_operations.py} | 57 +- ...rm_retention_policies_operations_async.py} | 57 +- ..._maintenance_window_options_operations.py} | 9 +- ...enance_window_options_operations_async.py} | 9 +- ...est_sql_maintenance_windows_operations.py} | 22 +- ...l_maintenance_windows_operations_async.py} | 22 +- ...ort_term_retention_policies_operations.py} | 66 +- ...rm_retention_policies_operations_async.py} | 66 +- ..._threat_protection_settings_operations.py} | 38 +- ...t_protection_settings_operations_async.py} | 38 +- ...ql_managed_database_columns_operations.py} | 29 +- ...aged_database_columns_operations_async.py} | 29 +- ...ed_database_move_operations_operations.py} | 24 +- ...abase_move_operations_operations_async.py} | 24 +- ...ql_managed_database_queries_operations.py} | 10 +- ...aged_database_queries_operations_async.py} | 10 +- ...ommended_sensitivity_labels_operations.py} | 14 +- ...ed_sensitivity_labels_operations_async.py} | 14 +- ...ed_database_restore_details_operations.py} | 9 +- ...abase_restore_details_operations_async.py} | 9 +- ...ql_managed_database_schemas_operations.py} | 24 +- ...aged_database_schemas_operations_async.py} | 24 +- ...ase_security_alert_policies_operations.py} | 61 +- ...curity_alert_policies_operations_async.py} | 61 +- ...ed_database_security_events_operations.py} | 9 +- ...abase_security_events_operations_async.py} | 9 +- ...database_sensitivity_labels_operations.py} | 191 +- ...se_sensitivity_labels_operations_async.py} | 191 +- ...sql_managed_database_tables_operations.py} | 24 +- ...naged_database_tables_operations_async.py} | 24 +- ...transparent_data_encryption_operations.py} | 44 +- ...arent_data_encryption_operations_async.py} | 44 +- ...y_assessment_rule_baselines_operations.py} | 26 +- ...ssment_rule_baselines_operations_async.py} | 26 +- ...nerability_assessment_scans_operations.py} | 26 +- ...lity_assessment_scans_operations_async.py} | 26 +- ...e_vulnerability_assessments_operations.py} | 54 +- ...erability_assessments_operations_async.py} | 54 +- ... test_sql_managed_databases_operations.py} | 179 +- ...sql_managed_databases_operations_async.py} | 179 +- ...ged_instance_administrators_operations.py} | 47 +- ...stance_administrators_operations_async.py} | 47 +- ..._threat_protection_settings_operations.py} | 36 +- ...t_protection_settings_operations_async.py} | 36 +- ...ure_ad_only_authentications_operations.py} | 49 +- ..._only_authentications_operations_async.py} | 49 +- ...t_sql_managed_instance_dtcs_operations.py} | 70 +- ...managed_instance_dtcs_operations_async.py} | 70 +- ...tance_encryption_protectors_operations.py} | 54 +- ...encryption_protectors_operations_async.py} | 54 +- ...t_sql_managed_instance_keys_operations.py} | 54 +- ...managed_instance_keys_operations_async.py} | 54 +- ...ong_term_retention_policies_operations.py} | 56 +- ...rm_retention_policies_operations_async.py} | 56 +- ...managed_instance_operations_operations.py} | 25 +- ...d_instance_operations_operations_async.py} | 25 +- ...rivate_endpoint_connections_operations.py} | 54 +- ..._endpoint_connections_operations_async.py} | 56 +- ...ance_private_link_resources_operations.py} | 24 +- ...rivate_link_resources_operations_async.py} | 24 +- ...d_instance_tde_certificates_operations.py} | 16 +- ...ance_tde_certificates_operations_async.py} | 16 +- ...e_vulnerability_assessments_operations.py} | 52 +- ...erability_assessments_operations_async.py} | 52 +- ... test_sql_managed_instances_operations.py} | 279 +- ..._sql_managed_instances_operations_async.py | 360 + ...naged_ledger_digest_uploads_operations.py} | 49 +- ...ledger_digest_uploads_operations_async.py} | 51 +- ...ort_term_retention_policies_operations.py} | 72 +- ...rm_retention_policies_operations_async.py} | 72 +- ..._managed_server_dns_aliases_operations.py} | 37 +- ...ed_server_dns_aliases_operations_async.py} | 37 +- ...ver_security_alert_policies_operations.py} | 51 +- ...curity_alert_policies_operations_async.py} | 51 +- ...management_database_advisors_operations.py | 132 - ...ment_database_advisors_operations_async.py | 133 - ...database_recommended_actions_operations.py | 117 - ...se_recommended_actions_operations_async.py | 118 - ...est_sql_management_databases_operations.py | 352 - ...tributed_availability_groups_operations.py | 191 - ...ment_elastic_pool_activities_operations.py | 32 - ...lastic_pool_activities_operations_async.py | 33 - ...tic_pool_database_activities_operations.py | 32 - ...ol_database_activities_operations_async.py | 33 - ...management_managed_instances_operations.py | 345 - ...l_management_server_advisors_operations.py | 129 - ...gement_server_advisors_operations_async.py | 130 - ...t_server_communication_links_operations.py | 79 - ...er_communication_links_operations_async.py | 82 - .../test_sql_management_servers_operations.py | 237 - ...anagement_service_objectives_operations.py | 44 - ...ent_service_objectives_operations_async.py | 45 - ...ty_perimeter_configurations_operations.py} | 25 +- ...imeter_configurations_operations_async.py} | 25 +- ...t_operations.py => test_sql_operations.py} | 12 +- ..._async.py => test_sql_operations_async.py} | 12 +- ...sql_outbound_firewall_rules_operations.py} | 34 +- ...tbound_firewall_rules_operations_async.py} | 34 +- ...rivate_endpoint_connections_operations.py} | 56 +- ..._endpoint_connections_operations_async.py} | 58 +- ..._sql_private_link_resources_operations.py} | 24 +- ...rivate_link_resources_operations_async.py} | 24 +- ...ommended_sensitivity_labels_operations.py} | 14 +- ...ed_sensitivity_labels_operations_async.py} | 14 +- ...t_sql_recoverable_databases_operations.py} | 24 +- ...recoverable_databases_operations_async.py} | 24 +- ...coverable_managed_databases_operations.py} | 24 +- ...ble_managed_databases_operations_async.py} | 24 +- ... test_sql_replication_links_operations.py} | 84 +- ...sql_replication_links_operations_async.py} | 84 +- ...estorable_dropped_databases_operations.py} | 24 +- ...ble_dropped_databases_operations_async.py} | 24 +- ...e_dropped_managed_databases_operations.py} | 24 +- ...ped_managed_databases_operations_async.py} | 24 +- ... => test_sql_restore_points_operations.py} | 42 +- ...st_sql_restore_points_operations_async.py} | 56 +- ...test_sql_sensitivity_labels_operations.py} | 129 +- ...ql_sensitivity_labels_operations_async.py} | 129 +- ..._threat_protection_settings_operations.py} | 36 +- ...t_protection_settings_operations_async.py} | 36 +- .../test_sql_server_advisors_operations.py | 146 + ...st_sql_server_advisors_operations_async.py | 147 + ...sql_server_automatic_tuning_operations.py} | 28 +- ...rver_automatic_tuning_operations_async.py} | 28 +- ...ver_azure_ad_administrators_operations.py} | 54 +- ...ure_ad_administrators_operations_async.py} | 54 +- ...ure_ad_only_authentications_operations.py} | 49 +- ..._only_authentications_operations_async.py} | 49 +- ...rver_blob_auditing_policies_operations.py} | 69 +- ...lob_auditing_policies_operations_async.py} | 69 +- ...erver_configuration_options_operations.py} | 44 +- ...configuration_options_operations_async.py} | 44 +- ..._server_connection_policies_operations.py} | 43 +- ...r_connection_policies_operations_async.py} | 43 +- ...rver_dev_ops_audit_settings_operations.py} | 47 +- ...ev_ops_audit_settings_operations_async.py} | 47 +- ...test_sql_server_dns_aliases_operations.py} | 35 +- ...ql_server_dns_aliases_operations_async.py} | 35 +- ....py => test_sql_server_keys_operations.py} | 58 +- ... test_sql_server_keys_operations_async.py} | 58 +- ... test_sql_server_operations_operations.py} | 9 +- ...sql_server_operations_operations_async.py} | 9 +- ...ver_security_alert_policies_operations.py} | 51 +- ...curity_alert_policies_operations_async.py} | 51 +- ...l_server_trust_certificates_operations.py} | 46 +- ...er_trust_certificates_operations_async.py} | 46 +- ...est_sql_server_trust_groups_operations.py} | 46 +- ...l_server_trust_groups_operations_async.py} | 46 +- ...y => test_sql_server_usages_operations.py} | 9 +- ...est_sql_server_usages_operations_async.py} | 9 +- ...r_vulnerability_assessments_operations.py} | 52 +- ...erability_assessments_operations_async.py} | 52 +- ...sync.py => test_sql_servers_operations.py} | 235 +- .../test_sql_servers_operations_async.py | 250 + ...ns.py => test_sql_sql_agent_operations.py} | 25 +- ...=> test_sql_sql_agent_operations_async.py} | 25 +- ...ability_assessment_baseline_operations.py} | 28 +- ...y_assessment_baseline_operations_async.py} | 28 +- ...bility_assessment_baselines_operations.py} | 14 +- ..._assessment_baselines_operations_async.py} | 14 +- ...ity_assessment_execute_scan_operations.py} | 11 +- ...sessment_execute_scan_operations_async.py} | 11 +- ...ty_assessment_rule_baseline_operations.py} | 46 +- ...essment_rule_baseline_operations_async.py} | 46 +- ...y_assessment_rule_baselines_operations.py} | 11 +- ...ssment_rule_baselines_operations_async.py} | 11 +- ...lity_assessment_scan_result_operations.py} | 28 +- ...ssessment_scan_result_operations_async.py} | 28 +- ...nerability_assessment_scans_operations.py} | 28 +- ...lity_assessment_scans_operations_async.py} | 28 +- ...l_vulnerability_assessments_operations.py} | 9 +- ...erability_assessments_operations_async.py} | 9 +- ...bility_assessments_settings_operations.py} | 35 +- ..._assessments_settings_operations_async.py} | 35 +- ..._managed_instance_schedules_operations.py} | 46 +- ...ed_instance_schedules_operations_async.py} | 46 +- ...est_sql_subscription_usages_operations.py} | 24 +- ...l_subscription_usages_operations_async.py} | 24 +- ...sql_synapse_link_workspaces_operations.py} | 9 +- ...napse_link_workspaces_operations_async.py} | 9 +- ....py => test_sql_sync_agents_operations.py} | 59 +- ... test_sql_sync_agents_operations_async.py} | 59 +- ....py => test_sql_sync_groups_operations.py} | 179 +- ... test_sql_sync_groups_operations_async.py} | 191 +- ...py => test_sql_sync_members_operations.py} | 129 +- ...test_sql_sync_members_operations_async.py} | 137 +- ...> test_sql_tde_certificates_operations.py} | 16 +- ..._sql_tde_certificates_operations_async.py} | 16 +- ...s.py => test_sql_time_zones_operations.py} | 24 +- ...> test_sql_time_zones_operations_async.py} | 24 +- ...ransparent_data_encryptions_operations.py} | 50 +- ...rent_data_encryptions_operations_async.py} | 52 +- ...tions.py => test_sql_usages_operations.py} | 9 +- ...py => test_sql_usages_operations_async.py} | 9 +- ...> test_sql_virtual_clusters_operations.py} | 77 +- ..._sql_virtual_clusters_operations_async.py} | 77 +- ...t_sql_virtual_network_rules_operations.py} | 50 +- ...virtual_network_rules_operations_async.py} | 50 +- ...st_sql_workload_classifiers_operations.py} | 60 +- ..._workload_classifiers_operations_async.py} | 60 +- ...=> test_sql_workload_groups_operations.py} | 58 +- ...t_sql_workload_groups_operations_async.py} | 58 +- sdk/sql/azure-mgmt-sql/pyproject.toml | 4 +- .../tests/disable_test_cli_mgmt_sql.py | 1 + .../tests/disable_test_cli_mgmt_sql_auth.py | 1 + .../disable_test_cli_mgmt_sql_database.py | 1 + .../disable_test_cli_mgmt_sql_elastic_pool.py | 1 + ...isable_test_cli_mgmt_sql_failover_group.py | 1 + .../tests/disable_test_cli_mgmt_sql_job.py | 1 + .../disable_test_cli_mgmt_sql_managed_db.py | 1 + .../tests/disable_test_cli_mgmt_sql_server.py | 1 + .../tests/disable_test_cli_mgmt_sql_sync.py | 1 + ...t_cli_mgmt_sql_vulnerability_assessment.py | 1 + .../tests/disable_test_mgmt_sql.py | 1 + .../test_cli_mgmt_sql_managed_instance.py | 1 + sdk/sql/azure-mgmt-sql/tsp-location.yaml | 4 + 1364 files changed, 339839 insertions(+), 205015 deletions(-) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/{_sql_management_client.py => _client.py} (97%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/model_base.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/{_sql_management_client.py => _client.py} (97%) delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pool_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_network_security_perimeter_configurations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/{_sql_management_client_enums.py => _enums.py} (74%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_network_security_perimeter_configurations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/code_report_typespec.json create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy_restorable_dropped.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/create_short_term_retention_policy.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server_with_odata.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_add_and_remove_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_with_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_add_and_remove_identity.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_with_identity.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_backup_short_term_retention_policies_operations.py => test_sql_backup_short_term_retention_policies_operations.py} (67%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_backup_short_term_retention_policies_operations_async.py => test_sql_backup_short_term_retention_policies_operations_async.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_capabilities_operations.py => test_sql_capabilities_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_capabilities_operations_async.py => test_sql_capabilities_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_masking_policies_operations.py => test_sql_data_masking_policies_operations.py} (69%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_masking_policies_operations_async.py => test_sql_data_masking_policies_operations_async.py} (69%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_masking_rules_operations.py => test_sql_data_masking_rules_operations.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_masking_rules_operations_async.py => test_sql_data_masking_rules_operations_async.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_warehouse_user_activities_operations.py => test_sql_data_warehouse_user_activities_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_data_warehouse_user_activities_operations_async.py => test_sql_data_warehouse_user_activities_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_advanced_threat_protection_settings_operations.py => test_sql_database_advanced_threat_protection_settings_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_advanced_threat_protection_settings_operations_async.py => test_sql_database_advanced_threat_protection_settings_operations_async.py} (84%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_automatic_tuning_operations.py => test_sql_database_automatic_tuning_operations.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_automatic_tuning_operations_async.py => test_sql_database_automatic_tuning_operations_async.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_blob_auditing_policies_operations.py => test_sql_database_blob_auditing_policies_operations.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_blob_auditing_policies_operations_async.py => test_sql_database_blob_auditing_policies_operations_async.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_columns_operations.py => test_sql_database_columns_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_columns_operations_async.py => test_sql_database_columns_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_encryption_protectors_operations.py => test_sql_database_encryption_protectors_operations.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_encryption_protectors_operations_async.py => test_sql_database_encryption_protectors_operations_async.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_extensions_operations.py => test_sql_database_extensions_operations.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_extensions_operations_async.py => test_sql_database_extensions_operations_async.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_operations_operations.py => test_sql_database_operations_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_operations_operations_async.py => test_sql_database_operations_operations_async.py} (82%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_schemas_operations.py => test_sql_database_schemas_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_schemas_operations_async.py => test_sql_database_schemas_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_security_alert_policies_operations.py => test_sql_database_security_alert_policies_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_security_alert_policies_operations_async.py => test_sql_database_security_alert_policies_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py => test_sql_database_sql_vulnerability_assessment_baselines_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py => test_sql_database_sql_vulnerability_assessment_baselines_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py => test_sql_database_sql_vulnerability_assessment_execute_scan_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py => test_sql_database_sql_vulnerability_assessment_execute_scan_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py => test_sql_database_sql_vulnerability_assessment_rule_baselines_operations.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py => test_sql_database_sql_vulnerability_assessment_rule_baselines_operations_async.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py => test_sql_database_sql_vulnerability_assessment_scan_result_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py => test_sql_database_sql_vulnerability_assessment_scan_result_operations_async.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_scans_operations.py => test_sql_database_sql_vulnerability_assessment_scans_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py => test_sql_database_sql_vulnerability_assessment_scans_operations_async.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessments_settings_operations.py => test_sql_database_sql_vulnerability_assessments_settings_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py => test_sql_database_sql_vulnerability_assessments_settings_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_tables_operations.py => test_sql_database_tables_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_tables_operations_async.py => test_sql_database_tables_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_usages_operations.py => test_sql_database_usages_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_usages_operations_async.py => test_sql_database_usages_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py => test_sql_database_vulnerability_assessment_rule_baselines_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py => test_sql_database_vulnerability_assessment_rule_baselines_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessment_scans_operations.py => test_sql_database_vulnerability_assessment_scans_operations.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessment_scans_operations_async.py => test_sql_database_vulnerability_assessment_scans_operations_async.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessments_operations.py => test_sql_database_vulnerability_assessments_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_database_vulnerability_assessments_operations_async.py => test_sql_database_vulnerability_assessments_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_databases_operations_async.py => test_sql_databases_operations.py} (60%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_deleted_servers_operations.py => test_sql_deleted_servers_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_deleted_servers_operations_async.py => test_sql_deleted_servers_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_distributed_availability_groups_operations_async.py => test_sql_distributed_availability_groups_operations.py} (64%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_elastic_pool_operations_operations.py => test_sql_elastic_pool_operations_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_elastic_pool_operations_operations_async.py => test_sql_elastic_pool_operations_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_elastic_pools_operations.py => test_sql_elastic_pools_operations.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_elastic_pools_operations_async.py => test_sql_elastic_pools_operations_async.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_encryption_protectors_operations.py => test_sql_encryption_protectors_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_encryption_protectors_operations_async.py => test_sql_encryption_protectors_operations_async.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_endpoint_certificates_operations.py => test_sql_endpoint_certificates_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_endpoint_certificates_operations_async.py => test_sql_endpoint_certificates_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_extended_database_blob_auditing_policies_operations.py => test_sql_extended_database_blob_auditing_policies_operations.py} (63%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_extended_database_blob_auditing_policies_operations_async.py => test_sql_extended_database_blob_auditing_policies_operations_async.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_extended_server_blob_auditing_policies_operations.py => test_sql_extended_server_blob_auditing_policies_operations.py} (62%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_extended_server_blob_auditing_policies_operations_async.py => test_sql_extended_server_blob_auditing_policies_operations_async.py} (62%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_failover_groups_operations.py => test_sql_failover_groups_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_failover_groups_operations_async.py => test_sql_failover_groups_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_firewall_rules_operations.py => test_sql_firewall_rules_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_firewall_rules_operations_async.py => test_sql_firewall_rules_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_geo_backup_policies_operations.py => test_sql_geo_backup_policies_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_geo_backup_policies_operations_async.py => test_sql_geo_backup_policies_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_failover_groups_operations.py => test_sql_instance_failover_groups_operations.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_failover_groups_operations_async.py => test_sql_instance_failover_groups_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_pool_operations_operations.py => test_sql_instance_pool_operations_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_pool_operations_operations_async.py => test_sql_instance_pool_operations_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_pools_operations.py => test_sql_instance_pools_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_instance_pools_operations_async.py => test_sql_instance_pools_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_ipv6_firewall_rules_operations.py => test_sql_ipv6_firewall_rules_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_ipv6_firewall_rules_operations_async.py => test_sql_ipv6_firewall_rules_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_agents_operations.py => test_sql_job_agents_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_agents_operations_async.py => test_sql_job_agents_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_credentials_operations.py => test_sql_job_credentials_operations.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_credentials_operations_async.py => test_sql_job_credentials_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_executions_operations.py => test_sql_job_executions_operations.py} (88%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_executions_operations_async.py => test_sql_job_executions_operations_async.py} (88%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_private_endpoints_operations.py => test_sql_job_private_endpoints_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_private_endpoints_operations_async.py => test_sql_job_private_endpoints_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_step_executions_operations.py => test_sql_job_step_executions_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_step_executions_operations_async.py => test_sql_job_step_executions_operations_async.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_steps_operations.py => test_sql_job_steps_operations.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_steps_operations_async.py => test_sql_job_steps_operations_async.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_target_executions_operations.py => test_sql_job_target_executions_operations.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_target_executions_operations_async.py => test_sql_job_target_executions_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_target_groups_operations.py => test_sql_job_target_groups_operations.py} (70%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_target_groups_operations_async.py => test_sql_job_target_groups_operations_async.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_versions_operations.py => test_sql_job_versions_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_job_versions_operations_async.py => test_sql_job_versions_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_jobs_operations.py => test_sql_jobs_operations.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_jobs_operations_async.py => test_sql_jobs_operations_async.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_ledger_digest_uploads_operations.py => test_sql_ledger_digest_uploads_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_ledger_digest_uploads_operations_async.py => test_sql_ledger_digest_uploads_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_backups_operations.py => test_sql_long_term_retention_backups_operations.py} (88%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_backups_operations_async.py => test_sql_long_term_retention_backups_operations_async.py} (88%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_managed_instance_backups_operations.py => test_sql_long_term_retention_managed_instance_backups_operations.py} (90%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_managed_instance_backups_operations_async.py => test_sql_long_term_retention_managed_instance_backups_operations_async.py} (90%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_policies_operations.py => test_sql_long_term_retention_policies_operations.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_long_term_retention_policies_operations_async.py => test_sql_long_term_retention_policies_operations_async.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_maintenance_window_options_operations.py => test_sql_maintenance_window_options_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_maintenance_window_options_operations_async.py => test_sql_maintenance_window_options_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_maintenance_windows_operations.py => test_sql_maintenance_windows_operations.py} (71%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_maintenance_windows_operations_async.py => test_sql_maintenance_windows_operations_async.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_backup_short_term_retention_policies_operations.py => test_sql_managed_backup_short_term_retention_policies_operations.py} (68%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_backup_short_term_retention_policies_operations_async.py => test_sql_managed_backup_short_term_retention_policies_operations_async.py} (68%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_advanced_threat_protection_settings_operations.py => test_sql_managed_database_advanced_threat_protection_settings_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py => test_sql_managed_database_advanced_threat_protection_settings_operations_async.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_columns_operations.py => test_sql_managed_database_columns_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_columns_operations_async.py => test_sql_managed_database_columns_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_move_operations_operations.py => test_sql_managed_database_move_operations_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_move_operations_operations_async.py => test_sql_managed_database_move_operations_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_queries_operations.py => test_sql_managed_database_queries_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_queries_operations_async.py => test_sql_managed_database_queries_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_recommended_sensitivity_labels_operations.py => test_sql_managed_database_recommended_sensitivity_labels_operations.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py => test_sql_managed_database_recommended_sensitivity_labels_operations_async.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_restore_details_operations.py => test_sql_managed_database_restore_details_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_restore_details_operations_async.py => test_sql_managed_database_restore_details_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_schemas_operations.py => test_sql_managed_database_schemas_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_schemas_operations_async.py => test_sql_managed_database_schemas_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_security_alert_policies_operations.py => test_sql_managed_database_security_alert_policies_operations.py} (69%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_security_alert_policies_operations_async.py => test_sql_managed_database_security_alert_policies_operations_async.py} (70%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_security_events_operations.py => test_sql_managed_database_security_events_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_security_events_operations_async.py => test_sql_managed_database_security_events_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_sensitivity_labels_operations.py => test_sql_managed_database_sensitivity_labels_operations.py} (67%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_sensitivity_labels_operations_async.py => test_sql_managed_database_sensitivity_labels_operations_async.py} (68%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_tables_operations.py => test_sql_managed_database_tables_operations.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_tables_operations_async.py => test_sql_managed_database_tables_operations_async.py} (83%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_transparent_data_encryption_operations.py => test_sql_managed_database_transparent_data_encryption_operations.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_transparent_data_encryption_operations_async.py => test_sql_managed_database_transparent_data_encryption_operations_async.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py => test_sql_managed_database_vulnerability_assessment_rule_baselines_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py => test_sql_managed_database_vulnerability_assessment_rule_baselines_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessment_scans_operations.py => test_sql_managed_database_vulnerability_assessment_scans_operations.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py => test_sql_managed_database_vulnerability_assessment_scans_operations_async.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessments_operations.py => test_sql_managed_database_vulnerability_assessments_operations.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_database_vulnerability_assessments_operations_async.py => test_sql_managed_database_vulnerability_assessments_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_databases_operations.py => test_sql_managed_databases_operations.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_databases_operations_async.py => test_sql_managed_databases_operations_async.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_administrators_operations.py => test_sql_managed_instance_administrators_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_administrators_operations_async.py => test_sql_managed_instance_administrators_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py => test_sql_managed_instance_advanced_threat_protection_settings_operations.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py => test_sql_managed_instance_advanced_threat_protection_settings_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_azure_ad_only_authentications_operations.py => test_sql_managed_instance_azure_ad_only_authentications_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py => test_sql_managed_instance_azure_ad_only_authentications_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_dtcs_operations.py => test_sql_managed_instance_dtcs_operations.py} (61%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_dtcs_operations_async.py => test_sql_managed_instance_dtcs_operations_async.py} (61%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_encryption_protectors_operations.py => test_sql_managed_instance_encryption_protectors_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_encryption_protectors_operations_async.py => test_sql_managed_instance_encryption_protectors_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_keys_operations.py => test_sql_managed_instance_keys_operations.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_keys_operations_async.py => test_sql_managed_instance_keys_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_long_term_retention_policies_operations.py => test_sql_managed_instance_long_term_retention_policies_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_long_term_retention_policies_operations_async.py => test_sql_managed_instance_long_term_retention_policies_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_operations_operations.py => test_sql_managed_instance_operations_operations.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_operations_operations_async.py => test_sql_managed_instance_operations_operations_async.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_private_endpoint_connections_operations.py => test_sql_managed_instance_private_endpoint_connections_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_private_endpoint_connections_operations_async.py => test_sql_managed_instance_private_endpoint_connections_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_private_link_resources_operations.py => test_sql_managed_instance_private_link_resources_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_private_link_resources_operations_async.py => test_sql_managed_instance_private_link_resources_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_tde_certificates_operations.py => test_sql_managed_instance_tde_certificates_operations.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_tde_certificates_operations_async.py => test_sql_managed_instance_tde_certificates_operations_async.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_vulnerability_assessments_operations.py => test_sql_managed_instance_vulnerability_assessments_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instance_vulnerability_assessments_operations_async.py => test_sql_managed_instance_vulnerability_assessments_operations_async.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_instances_operations_async.py => test_sql_managed_instances_operations.py} (63%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_ledger_digest_uploads_operations.py => test_sql_managed_ledger_digest_uploads_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_ledger_digest_uploads_operations_async.py => test_sql_managed_ledger_digest_uploads_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py => test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py} (70%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py => test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py} (70%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_server_dns_aliases_operations.py => test_sql_managed_server_dns_aliases_operations.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_server_dns_aliases_operations_async.py => test_sql_managed_server_dns_aliases_operations_async.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_server_security_alert_policies_operations.py => test_sql_managed_server_security_alert_policies_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_managed_server_security_alert_policies_operations_async.py => test_sql_managed_server_security_alert_policies_operations_async.py} (78%) delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations_async.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_network_security_perimeter_configurations_operations.py => test_sql_network_security_perimeter_configurations_operations.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_network_security_perimeter_configurations_operations_async.py => test_sql_network_security_perimeter_configurations_operations_async.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_operations.py => test_sql_operations.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_operations_async.py => test_sql_operations_async.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_outbound_firewall_rules_operations.py => test_sql_outbound_firewall_rules_operations.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_outbound_firewall_rules_operations_async.py => test_sql_outbound_firewall_rules_operations_async.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_private_endpoint_connections_operations.py => test_sql_private_endpoint_connections_operations.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_private_endpoint_connections_operations_async.py => test_sql_private_endpoint_connections_operations_async.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_private_link_resources_operations.py => test_sql_private_link_resources_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_private_link_resources_operations_async.py => test_sql_private_link_resources_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recommended_sensitivity_labels_operations.py => test_sql_recommended_sensitivity_labels_operations.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recommended_sensitivity_labels_operations_async.py => test_sql_recommended_sensitivity_labels_operations_async.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recoverable_databases_operations.py => test_sql_recoverable_databases_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recoverable_databases_operations_async.py => test_sql_recoverable_databases_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recoverable_managed_databases_operations.py => test_sql_recoverable_managed_databases_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_recoverable_managed_databases_operations_async.py => test_sql_recoverable_managed_databases_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_replication_links_operations.py => test_sql_replication_links_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_replication_links_operations_async.py => test_sql_replication_links_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restorable_dropped_databases_operations.py => test_sql_restorable_dropped_databases_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restorable_dropped_databases_operations_async.py => test_sql_restorable_dropped_databases_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restorable_dropped_managed_databases_operations.py => test_sql_restorable_dropped_managed_databases_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restorable_dropped_managed_databases_operations_async.py => test_sql_restorable_dropped_managed_databases_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restore_points_operations.py => test_sql_restore_points_operations.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_restore_points_operations_async.py => test_sql_restore_points_operations_async.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sensitivity_labels_operations.py => test_sql_sensitivity_labels_operations.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sensitivity_labels_operations_async.py => test_sql_sensitivity_labels_operations_async.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_advanced_threat_protection_settings_operations.py => test_sql_server_advanced_threat_protection_settings_operations.py} (84%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_advanced_threat_protection_settings_operations_async.py => test_sql_server_advanced_threat_protection_settings_operations_async.py} (84%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_automatic_tuning_operations.py => test_sql_server_automatic_tuning_operations.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_automatic_tuning_operations_async.py => test_sql_server_automatic_tuning_operations_async.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_azure_ad_administrators_operations.py => test_sql_server_azure_ad_administrators_operations.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_azure_ad_administrators_operations_async.py => test_sql_server_azure_ad_administrators_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_azure_ad_only_authentications_operations.py => test_sql_server_azure_ad_only_authentications_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_azure_ad_only_authentications_operations_async.py => test_sql_server_azure_ad_only_authentications_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_blob_auditing_policies_operations.py => test_sql_server_blob_auditing_policies_operations.py} (62%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_blob_auditing_policies_operations_async.py => test_sql_server_blob_auditing_policies_operations_async.py} (62%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_configuration_options_operations.py => test_sql_server_configuration_options_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_configuration_options_operations_async.py => test_sql_server_configuration_options_operations_async.py} (76%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_connection_policies_operations.py => test_sql_server_connection_policies_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_connection_policies_operations_async.py => test_sql_server_connection_policies_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_dev_ops_audit_settings_operations.py => test_sql_server_dev_ops_audit_settings_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_dev_ops_audit_settings_operations_async.py => test_sql_server_dev_ops_audit_settings_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_dns_aliases_operations.py => test_sql_server_dns_aliases_operations.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_dns_aliases_operations_async.py => test_sql_server_dns_aliases_operations_async.py} (87%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_keys_operations.py => test_sql_server_keys_operations.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_keys_operations_async.py => test_sql_server_keys_operations_async.py} (73%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_operations_operations.py => test_sql_server_operations_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_operations_operations_async.py => test_sql_server_operations_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_security_alert_policies_operations.py => test_sql_server_security_alert_policies_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_security_alert_policies_operations_async.py => test_sql_server_security_alert_policies_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_trust_certificates_operations.py => test_sql_server_trust_certificates_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_trust_certificates_operations_async.py => test_sql_server_trust_certificates_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_trust_groups_operations.py => test_sql_server_trust_groups_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_trust_groups_operations_async.py => test_sql_server_trust_groups_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_usages_operations.py => test_sql_server_usages_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_usages_operations_async.py => test_sql_server_usages_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_vulnerability_assessments_operations.py => test_sql_server_vulnerability_assessments_operations.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_server_vulnerability_assessments_operations_async.py => test_sql_server_vulnerability_assessments_operations_async.py} (74%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_servers_operations_async.py => test_sql_servers_operations.py} (58%) create mode 100644 sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations_async.py rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_agent_operations.py => test_sql_sql_agent_operations.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_agent_operations_async.py => test_sql_sql_agent_operations_async.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_baseline_operations.py => test_sql_sql_vulnerability_assessment_baseline_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py => test_sql_sql_vulnerability_assessment_baseline_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_baselines_operations.py => test_sql_sql_vulnerability_assessment_baselines_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py => test_sql_sql_vulnerability_assessment_baselines_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py => test_sql_sql_vulnerability_assessment_execute_scan_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py => test_sql_sql_vulnerability_assessment_execute_scan_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py => test_sql_sql_vulnerability_assessment_rule_baseline_operations.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py => test_sql_sql_vulnerability_assessment_rule_baseline_operations_async.py} (82%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py => test_sql_sql_vulnerability_assessment_rule_baselines_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py => test_sql_sql_vulnerability_assessment_rule_baselines_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_scan_result_operations.py => test_sql_sql_vulnerability_assessment_scan_result_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py => test_sql_sql_vulnerability_assessment_scan_result_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_scans_operations.py => test_sql_sql_vulnerability_assessment_scans_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessment_scans_operations_async.py => test_sql_sql_vulnerability_assessment_scans_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessments_operations.py => test_sql_sql_vulnerability_assessments_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessments_operations_async.py => test_sql_sql_vulnerability_assessments_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessments_settings_operations.py => test_sql_sql_vulnerability_assessments_settings_operations.py} (86%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sql_vulnerability_assessments_settings_operations_async.py => test_sql_sql_vulnerability_assessments_settings_operations_async.py} (85%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_start_stop_managed_instance_schedules_operations.py => test_sql_start_stop_managed_instance_schedules_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_start_stop_managed_instance_schedules_operations_async.py => test_sql_start_stop_managed_instance_schedules_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_subscription_usages_operations.py => test_sql_subscription_usages_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_subscription_usages_operations_async.py => test_sql_subscription_usages_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_synapse_link_workspaces_operations.py => test_sql_synapse_link_workspaces_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_synapse_link_workspaces_operations_async.py => test_sql_synapse_link_workspaces_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_agents_operations.py => test_sql_sync_agents_operations.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_agents_operations_async.py => test_sql_sync_agents_operations_async.py} (78%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_groups_operations.py => test_sql_sync_groups_operations.py} (66%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_groups_operations_async.py => test_sql_sync_groups_operations_async.py} (65%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_members_operations.py => test_sql_sync_members_operations.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_sync_members_operations_async.py => test_sql_sync_members_operations_async.py} (64%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_tde_certificates_operations.py => test_sql_tde_certificates_operations.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_tde_certificates_operations_async.py => test_sql_tde_certificates_operations_async.py} (72%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_time_zones_operations.py => test_sql_time_zones_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_time_zones_operations_async.py => test_sql_time_zones_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_transparent_data_encryptions_operations.py => test_sql_transparent_data_encryptions_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_transparent_data_encryptions_operations_async.py => test_sql_transparent_data_encryptions_operations_async.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_usages_operations.py => test_sql_usages_operations.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_usages_operations_async.py => test_sql_usages_operations_async.py} (79%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_virtual_clusters_operations.py => test_sql_virtual_clusters_operations.py} (80%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_virtual_clusters_operations_async.py => test_sql_virtual_clusters_operations_async.py} (81%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_virtual_network_rules_operations.py => test_sql_virtual_network_rules_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_virtual_network_rules_operations_async.py => test_sql_virtual_network_rules_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_workload_classifiers_operations.py => test_sql_workload_classifiers_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_workload_classifiers_operations_async.py => test_sql_workload_classifiers_operations_async.py} (77%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_workload_groups_operations.py => test_sql_workload_groups_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/generated_tests/{test_sql_management_workload_groups_operations_async.py => test_sql_workload_groups_operations_async.py} (75%) create mode 100644 sdk/sql/azure-mgmt-sql/tsp-location.yaml diff --git a/sdk/sql/azure-mgmt-sql/CHANGELOG.md b/sdk/sql/azure-mgmt-sql/CHANGELOG.md index 73a7ca205370..fefef261667c 100644 --- a/sdk/sql/azure-mgmt-sql/CHANGELOG.md +++ b/sdk/sql/azure-mgmt-sql/CHANGELOG.md @@ -1,5 +1,9 @@ # Release History +## 4.0.0b25 (2026-04-01) + +skip changelog generation + ## 3.1.0 (2026-04-01) skip changelog generation diff --git a/sdk/sql/azure-mgmt-sql/_metadata.json b/sdk/sql/azure-mgmt-sql/_metadata.json index 90fe74de03ad..d51d0ff18f40 100644 --- a/sdk/sql/azure-mgmt-sql/_metadata.json +++ b/sdk/sql/azure-mgmt-sql/_metadata.json @@ -1,11 +1,10 @@ { - "commit": "347957f6f5b15889f48000bbca92b7ed1d759dca", + "apiVersion": "2025-02-01-preview", + "apiVersions": { + "Microsoft.Sql": "2025-02-01-preview" + }, + "commit": "3256c6764d5edc188ae06b8e20a180ac484bbfb7", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest": "3.10.2", - "use": [ - "@autorest/python@6.50.0", - "@autorest/modelerfour@4.27.0" - ], - "autorest_command": "autorest specification/sql/resource-manager/Microsoft.Sql/SQL/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --package-mode=azure-mgmt --python --python-sdks-folder=/home/v-chenjiang/spec/worktrees/sdk-azure-mgmt-sql/sdk --use=@autorest/python@6.50.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", - "readme": "specification/sql/resource-manager/Microsoft.Sql/SQL/readme.md" + "typespec_src": "specification/sql/resource-manager/Microsoft.Sql/SQL", + "emitterVersion": "0.61.2" } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/apiview-properties.json b/sdk/sql/azure-mgmt-sql/apiview-properties.json index 7c0c62ef739f..b26bfc4651ab 100644 --- a/sdk/sql/azure-mgmt-sql/apiview-properties.json +++ b/sdk/sql/azure-mgmt-sql/apiview-properties.json @@ -1,1699 +1,1716 @@ { - "CrossLanguagePackageId": null, + "CrossLanguagePackageId": "Microsoft.Sql", "CrossLanguageDefinitionId": { - "azure.mgmt.sql.models.AdministratorListResult": null, - "azure.mgmt.sql.models.Resource": null, - "azure.mgmt.sql.models.ProxyResource": null, - "azure.mgmt.sql.models.Advisor": null, - "azure.mgmt.sql.models.AutomaticTuningOptions": null, - "azure.mgmt.sql.models.AutomaticTuningServerOptions": null, - "azure.mgmt.sql.models.AutoPauseDelayTimeRange": null, - "azure.mgmt.sql.models.AzureADOnlyAuthListResult": null, - "azure.mgmt.sql.models.BackupShortTermRetentionPolicy": null, - "azure.mgmt.sql.models.BackupShortTermRetentionPolicyListResult": null, - "azure.mgmt.sql.models.Baseline": null, - "azure.mgmt.sql.models.BaselineAdjustedResult": null, - "azure.mgmt.sql.models.BenchmarkReference": null, - "azure.mgmt.sql.models.CertificateInfo": null, - "azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters": null, - "azure.mgmt.sql.models.CheckNameAvailabilityRequest": null, - "azure.mgmt.sql.models.CheckNameAvailabilityResponse": null, - "azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition": null, - "azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters": null, - "azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition": null, - "azure.mgmt.sql.models.TrackedResource": null, - "azure.mgmt.sql.models.Database": null, - "azure.mgmt.sql.models.DatabaseAdvancedThreatProtection": null, - "azure.mgmt.sql.models.DatabaseAdvancedThreatProtectionListResult": null, - "azure.mgmt.sql.models.DatabaseAutomaticTuning": null, - "azure.mgmt.sql.models.DatabaseBlobAuditingPolicy": null, - "azure.mgmt.sql.models.DatabaseBlobAuditingPolicyListResult": null, - "azure.mgmt.sql.models.DatabaseColumn": null, - "azure.mgmt.sql.models.DatabaseColumnListResult": null, - "azure.mgmt.sql.models.DatabaseExtensions": null, - "azure.mgmt.sql.models.DatabaseIdentity": null, - "azure.mgmt.sql.models.DatabaseKey": null, - "azure.mgmt.sql.models.DatabaseListResult": null, - "azure.mgmt.sql.models.DatabaseOperation": null, - "azure.mgmt.sql.models.DatabaseOperationListResult": null, - "azure.mgmt.sql.models.DatabaseSchema": null, - "azure.mgmt.sql.models.DatabaseSchemaListResult": null, - "azure.mgmt.sql.models.DatabaseSecurityAlertListResult": null, - "azure.mgmt.sql.models.DatabaseSecurityAlertPolicy": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput": null, - "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult": null, - "azure.mgmt.sql.models.DatabaseTable": null, - "azure.mgmt.sql.models.DatabaseTableListResult": null, - "azure.mgmt.sql.models.DatabaseUpdate": null, - "azure.mgmt.sql.models.DatabaseUsage": null, - "azure.mgmt.sql.models.DatabaseUsageListResult": null, - "azure.mgmt.sql.models.DatabaseUserIdentity": null, - "azure.mgmt.sql.models.DatabaseVulnerabilityAssessment": null, - "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentListResult": null, - "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline": null, - "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem": null, - "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport": null, - "azure.mgmt.sql.models.DataMaskingPolicy": null, - "azure.mgmt.sql.models.DataMaskingRule": null, - "azure.mgmt.sql.models.DataMaskingRuleListResult": null, - "azure.mgmt.sql.models.DataWarehouseUserActivities": null, - "azure.mgmt.sql.models.DataWarehouseUserActivitiesListResult": null, - "azure.mgmt.sql.models.DeletedServer": null, - "azure.mgmt.sql.models.DeletedServerListResult": null, - "azure.mgmt.sql.models.DistributedAvailabilityGroup": null, - "azure.mgmt.sql.models.DistributedAvailabilityGroupDatabase": null, - "azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole": null, - "azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest": null, - "azure.mgmt.sql.models.DistributedAvailabilityGroupsListResult": null, - "azure.mgmt.sql.models.EditionCapability": null, - "azure.mgmt.sql.models.ElasticPool": null, - "azure.mgmt.sql.models.ElasticPoolEditionCapability": null, - "azure.mgmt.sql.models.ElasticPoolListResult": null, - "azure.mgmt.sql.models.ElasticPoolOperation": null, - "azure.mgmt.sql.models.ElasticPoolOperationListResult": null, - "azure.mgmt.sql.models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability": null, - "azure.mgmt.sql.models.ElasticPoolPerDatabaseMinPerformanceLevelCapability": null, - "azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings": null, - "azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability": null, - "azure.mgmt.sql.models.ElasticPoolUpdate": null, - "azure.mgmt.sql.models.EncryptionProtector": null, - "azure.mgmt.sql.models.EncryptionProtectorListResult": null, - "azure.mgmt.sql.models.EndpointCertificate": null, - "azure.mgmt.sql.models.EndpointCertificateListResult": null, - "azure.mgmt.sql.models.EndpointDependency": null, - "azure.mgmt.sql.models.EndpointDetail": null, - "azure.mgmt.sql.models.ErrorAdditionalInfo": null, - "azure.mgmt.sql.models.ErrorDetail": null, - "azure.mgmt.sql.models.ErrorResponse": null, - "azure.mgmt.sql.models.ExportDatabaseDefinition": null, - "azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy": null, - "azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicyListResult": null, - "azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy": null, - "azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicyListResult": null, - "azure.mgmt.sql.models.FailoverGroup": null, - "azure.mgmt.sql.models.FailoverGroupListResult": null, - "azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint": null, - "azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint": null, - "azure.mgmt.sql.models.FailoverGroupUpdate": null, - "azure.mgmt.sql.models.ResourceWithWritableName": null, - "azure.mgmt.sql.models.ProxyResourceWithWritableName": null, - "azure.mgmt.sql.models.FirewallRule": null, - "azure.mgmt.sql.models.FirewallRuleList": null, - "azure.mgmt.sql.models.FirewallRuleListResult": null, - "azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability": null, - "azure.mgmt.sql.models.GeoBackupPolicy": null, - "azure.mgmt.sql.models.GeoBackupPolicyListResult": null, - "azure.mgmt.sql.models.ImportExistingDatabaseDefinition": null, - "azure.mgmt.sql.models.ImportExportExtensionsOperationListResult": null, - "azure.mgmt.sql.models.ImportExportExtensionsOperationResult": null, - "azure.mgmt.sql.models.ImportExportOperationResult": null, - "azure.mgmt.sql.models.ImportNewDatabaseDefinition": null, - "azure.mgmt.sql.models.InstanceFailoverGroup": null, - "azure.mgmt.sql.models.InstanceFailoverGroupListResult": null, - "azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint": null, - "azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint": null, - "azure.mgmt.sql.models.InstancePool": null, - "azure.mgmt.sql.models.InstancePoolEditionCapability": null, - "azure.mgmt.sql.models.InstancePoolFamilyCapability": null, - "azure.mgmt.sql.models.InstancePoolListResult": null, - "azure.mgmt.sql.models.InstancePoolOperation": null, - "azure.mgmt.sql.models.InstancePoolOperationListResult": null, - "azure.mgmt.sql.models.InstancePoolUpdate": null, - "azure.mgmt.sql.models.InstancePoolVcoresCapability": null, - "azure.mgmt.sql.models.IPv6FirewallRule": null, - "azure.mgmt.sql.models.IPv6FirewallRuleListResult": null, - "azure.mgmt.sql.models.Job": null, - "azure.mgmt.sql.models.JobAgent": null, - "azure.mgmt.sql.models.JobAgentEditionCapability": null, - "azure.mgmt.sql.models.JobAgentIdentity": null, - "azure.mgmt.sql.models.JobAgentListResult": null, - "azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability": null, - "azure.mgmt.sql.models.JobAgentUpdate": null, - "azure.mgmt.sql.models.JobAgentUserAssignedIdentity": null, - "azure.mgmt.sql.models.JobAgentVersionCapability": null, - "azure.mgmt.sql.models.JobCredential": null, - "azure.mgmt.sql.models.JobCredentialListResult": null, - "azure.mgmt.sql.models.JobExecution": null, - "azure.mgmt.sql.models.JobExecutionListResult": null, - "azure.mgmt.sql.models.JobExecutionTarget": null, - "azure.mgmt.sql.models.JobListResult": null, - "azure.mgmt.sql.models.JobPrivateEndpoint": null, - "azure.mgmt.sql.models.JobPrivateEndpointListResult": null, - "azure.mgmt.sql.models.JobSchedule": null, - "azure.mgmt.sql.models.JobStep": null, - "azure.mgmt.sql.models.JobStepAction": null, - "azure.mgmt.sql.models.JobStepExecutionOptions": null, - "azure.mgmt.sql.models.JobStepListResult": null, - "azure.mgmt.sql.models.JobStepOutput": null, - "azure.mgmt.sql.models.JobTarget": null, - "azure.mgmt.sql.models.JobTargetGroup": null, - "azure.mgmt.sql.models.JobTargetGroupListResult": null, - "azure.mgmt.sql.models.JobVersion": null, - "azure.mgmt.sql.models.JobVersionListResult": null, - "azure.mgmt.sql.models.LedgerDigestUploads": null, - "azure.mgmt.sql.models.LedgerDigestUploadsListResult": null, - "azure.mgmt.sql.models.LicenseTypeCapability": null, - "azure.mgmt.sql.models.LocationCapabilities": null, - "azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption": null, - "azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionListResult": null, - "azure.mgmt.sql.models.LogicalServerAdvancedThreatProtectionListResult": null, - "azure.mgmt.sql.models.LogicalServerSecurityAlertPolicyListResult": null, - "azure.mgmt.sql.models.LogSizeCapability": null, - "azure.mgmt.sql.models.LongTermRetentionBackup": null, - "azure.mgmt.sql.models.LongTermRetentionBackupListResult": null, - "azure.mgmt.sql.models.LongTermRetentionBackupOperationResult": null, - "azure.mgmt.sql.models.LongTermRetentionPolicy": null, - "azure.mgmt.sql.models.LongTermRetentionPolicyListResult": null, - "azure.mgmt.sql.models.MaintenanceConfigurationCapability": null, - "azure.mgmt.sql.models.MaintenanceWindowOptions": null, - "azure.mgmt.sql.models.MaintenanceWindows": null, - "azure.mgmt.sql.models.MaintenanceWindowTimeRange": null, - "azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy": null, - "azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicyListResult": null, - "azure.mgmt.sql.models.ManagedDatabase": null, - "azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection": null, - "azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtectionListResult": null, - "azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo": null, - "azure.mgmt.sql.models.ManagedDatabaseListResult": null, - "azure.mgmt.sql.models.ManagedDatabaseMoveDefinition": null, - "azure.mgmt.sql.models.ManagedDatabaseMoveOperationListResult": null, - "azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult": null, - "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties": null, - "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult": null, - "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties": null, - "azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy": null, - "azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicyListResult": null, - "azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition": null, - "azure.mgmt.sql.models.ManagedDatabaseUpdate": null, - "azure.mgmt.sql.models.ManagedInstance": null, - "azure.mgmt.sql.models.ManagedInstanceAdministrator": null, - "azure.mgmt.sql.models.ManagedInstanceAdministratorListResult": null, - "azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection": null, - "azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtectionListResult": null, - "azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication": null, - "azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthListResult": null, - "azure.mgmt.sql.models.ManagedInstanceDtc": null, - "azure.mgmt.sql.models.ManagedInstanceDtcListResult": null, - "azure.mgmt.sql.models.ManagedInstanceDtcSecuritySettings": null, - "azure.mgmt.sql.models.ManagedInstanceDtcTransactionManagerCommunicationSettings": null, - "azure.mgmt.sql.models.ManagedInstanceEditionCapability": null, - "azure.mgmt.sql.models.ManagedInstanceEncryptionProtector": null, - "azure.mgmt.sql.models.ManagedInstanceEncryptionProtectorListResult": null, - "azure.mgmt.sql.models.ManagedInstanceExternalAdministrator": null, - "azure.mgmt.sql.models.ManagedInstanceFamilyCapability": null, - "azure.mgmt.sql.models.ManagedInstanceKey": null, - "azure.mgmt.sql.models.ManagedInstanceKeyListResult": null, - "azure.mgmt.sql.models.ManagedInstanceListResult": null, - "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup": null, - "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackupListResult": null, - "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy": null, - "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyListResult": null, - "azure.mgmt.sql.models.ManagedInstanceMaintenanceConfigurationCapability": null, - "azure.mgmt.sql.models.ManagedInstanceOperation": null, - "azure.mgmt.sql.models.ManagedInstanceOperationListResult": null, - "azure.mgmt.sql.models.ManagedInstanceOperationParametersPair": null, - "azure.mgmt.sql.models.ManagedInstanceOperationSteps": null, - "azure.mgmt.sql.models.ManagedInstancePairInfo": null, - "azure.mgmt.sql.models.ManagedInstancePecProperty": null, - "azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection": null, - "azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionListResult": null, - "azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionProperties": null, - "azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty": null, - "azure.mgmt.sql.models.ManagedInstancePrivateLink": null, - "azure.mgmt.sql.models.ManagedInstancePrivateLinkListResult": null, - "azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties": null, - "azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty": null, - "azure.mgmt.sql.models.ManagedInstanceQuery": null, - "azure.mgmt.sql.models.ManagedInstanceQueryStatistics": null, - "azure.mgmt.sql.models.ManagedInstanceUpdate": null, - "azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest": null, - "azure.mgmt.sql.models.ManagedInstanceVcoresCapability": null, - "azure.mgmt.sql.models.ManagedInstanceVersionCapability": null, - "azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment": null, - "azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessmentListResult": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploads": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploadsListResult": null, - "azure.mgmt.sql.models.ManagedServerDnsAlias": null, - "azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition": null, - "azure.mgmt.sql.models.ManagedServerDnsAliasCreation": null, - "azure.mgmt.sql.models.ManagedServerDnsAliasListResult": null, - "azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy": null, - "azure.mgmt.sql.models.ManagedServerSecurityAlertPolicyListResult": null, - "azure.mgmt.sql.models.ManagedTransparentDataEncryption": null, - "azure.mgmt.sql.models.ManagedTransparentDataEncryptionListResult": null, - "azure.mgmt.sql.models.MaxLimitRangeCapability": null, - "azure.mgmt.sql.models.MaxSizeCapability": null, - "azure.mgmt.sql.models.MaxSizeRangeCapability": null, - "azure.mgmt.sql.models.MinCapacityCapability": null, - "azure.mgmt.sql.models.Name": null, - "azure.mgmt.sql.models.NetworkIsolationSettings": null, - "azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated": null, - "azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration": null, - "azure.mgmt.sql.models.NetworkSecurityPerimeterConfigurationListResult": null, - "azure.mgmt.sql.models.NSPConfigAccessRule": null, - "azure.mgmt.sql.models.NSPConfigAccessRuleProperties": null, - "azure.mgmt.sql.models.NSPConfigAssociation": null, - "azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule": null, - "azure.mgmt.sql.models.NSPConfigPerimeter": null, - "azure.mgmt.sql.models.NSPConfigProfile": null, - "azure.mgmt.sql.models.NSPProvisioningIssue": null, - "azure.mgmt.sql.models.NSPProvisioningIssueProperties": null, - "azure.mgmt.sql.models.Operation": null, - "azure.mgmt.sql.models.OperationDisplay": null, - "azure.mgmt.sql.models.OperationListResult": null, - "azure.mgmt.sql.models.OutboundEnvironmentEndpoint": null, - "azure.mgmt.sql.models.OutboundEnvironmentEndpointCollection": null, - "azure.mgmt.sql.models.OutboundFirewallRule": null, - "azure.mgmt.sql.models.OutboundFirewallRuleListResult": null, - "azure.mgmt.sql.models.PartnerInfo": null, - "azure.mgmt.sql.models.PartnerRegionInfo": null, - "azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange": null, - "azure.mgmt.sql.models.PerformanceLevelCapability": null, - "azure.mgmt.sql.models.PhaseDetails": null, - "azure.mgmt.sql.models.PrivateEndpointConnection": null, - "azure.mgmt.sql.models.PrivateEndpointConnectionListResult": null, - "azure.mgmt.sql.models.PrivateEndpointConnectionProperties": null, - "azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus": null, - "azure.mgmt.sql.models.PrivateEndpointProperty": null, - "azure.mgmt.sql.models.PrivateLinkResource": null, - "azure.mgmt.sql.models.PrivateLinkResourceListResult": null, - "azure.mgmt.sql.models.PrivateLinkResourceProperties": null, - "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty": null, - "azure.mgmt.sql.models.QueryCheck": null, - "azure.mgmt.sql.models.QueryMetricInterval": null, - "azure.mgmt.sql.models.QueryMetricProperties": null, - "azure.mgmt.sql.models.QueryStatistics": null, - "azure.mgmt.sql.models.QueryStatisticsProperties": null, - "azure.mgmt.sql.models.ReadScaleCapability": null, - "azure.mgmt.sql.models.RecommendedAction": null, - "azure.mgmt.sql.models.RecommendedActionAutoGenerated": null, - "azure.mgmt.sql.models.RecommendedActionErrorInfo": null, - "azure.mgmt.sql.models.RecommendedActionImpactRecord": null, - "azure.mgmt.sql.models.RecommendedActionImplementationInfo": null, - "azure.mgmt.sql.models.RecommendedActionMetricInfo": null, - "azure.mgmt.sql.models.RecommendedActionStateInfo": null, - "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate": null, - "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList": null, - "azure.mgmt.sql.models.RecoverableDatabase": null, - "azure.mgmt.sql.models.RecoverableDatabaseListResult": null, - "azure.mgmt.sql.models.RecoverableManagedDatabase": null, - "azure.mgmt.sql.models.RecoverableManagedDatabaseListResult": null, - "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult": null, - "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI": null, - "azure.mgmt.sql.models.Remediation": null, - "azure.mgmt.sql.models.ReplicationLink": null, - "azure.mgmt.sql.models.ReplicationLinkListResult": null, - "azure.mgmt.sql.models.ReplicationLinkUpdate": null, - "azure.mgmt.sql.models.ResourceIdentity": null, - "azure.mgmt.sql.models.ResourceMoveDefinition": null, - "azure.mgmt.sql.models.RestorableDroppedDatabase": null, - "azure.mgmt.sql.models.RestorableDroppedDatabaseListResult": null, - "azure.mgmt.sql.models.RestorableDroppedManagedDatabase": null, - "azure.mgmt.sql.models.RestorableDroppedManagedDatabaseListResult": null, - "azure.mgmt.sql.models.RestorePoint": null, - "azure.mgmt.sql.models.RestorePointListResult": null, - "azure.mgmt.sql.models.ScheduleItem": null, - "azure.mgmt.sql.models.SecurityEvent": null, - "azure.mgmt.sql.models.SecurityEventCollection": null, - "azure.mgmt.sql.models.SecurityEventsFilterParameters": null, - "azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties": null, - "azure.mgmt.sql.models.SensitivityLabel": null, - "azure.mgmt.sql.models.SensitivityLabelListResult": null, - "azure.mgmt.sql.models.SensitivityLabelUpdate": null, - "azure.mgmt.sql.models.SensitivityLabelUpdateList": null, - "azure.mgmt.sql.models.Server": null, - "azure.mgmt.sql.models.ServerAdvancedThreatProtection": null, - "azure.mgmt.sql.models.ServerAutomaticTuning": null, - "azure.mgmt.sql.models.ServerAzureADAdministrator": null, - "azure.mgmt.sql.models.ServerAzureADOnlyAuthentication": null, - "azure.mgmt.sql.models.ServerBlobAuditingPolicy": null, - "azure.mgmt.sql.models.ServerBlobAuditingPolicyListResult": null, - "azure.mgmt.sql.models.ServerConfigurationOption": null, - "azure.mgmt.sql.models.ServerConfigurationOptionListResult": null, - "azure.mgmt.sql.models.ServerConnectionPolicy": null, - "azure.mgmt.sql.models.ServerConnectionPolicyListResult": null, - "azure.mgmt.sql.models.ServerDevOpsAuditingSettings": null, - "azure.mgmt.sql.models.ServerDevOpsAuditSettingsListResult": null, - "azure.mgmt.sql.models.ServerDnsAlias": null, - "azure.mgmt.sql.models.ServerDnsAliasAcquisition": null, - "azure.mgmt.sql.models.ServerDnsAliasListResult": null, - "azure.mgmt.sql.models.ServerExternalAdministrator": null, - "azure.mgmt.sql.models.ServerInfo": null, - "azure.mgmt.sql.models.ServerKey": null, - "azure.mgmt.sql.models.ServerKeyListResult": null, - "azure.mgmt.sql.models.ServerListResult": null, - "azure.mgmt.sql.models.ServerOperation": null, - "azure.mgmt.sql.models.ServerOperationListResult": null, - "azure.mgmt.sql.models.ServerPrivateEndpointConnection": null, - "azure.mgmt.sql.models.ServerSecurityAlertPolicy": null, - "azure.mgmt.sql.models.ServerTrustCertificate": null, - "azure.mgmt.sql.models.ServerTrustCertificatesListResult": null, - "azure.mgmt.sql.models.ServerTrustGroup": null, - "azure.mgmt.sql.models.ServerTrustGroupListResult": null, - "azure.mgmt.sql.models.ServerUpdate": null, - "azure.mgmt.sql.models.ServerUsage": null, - "azure.mgmt.sql.models.ServerUsageListResult": null, - "azure.mgmt.sql.models.ServerVersionCapability": null, - "azure.mgmt.sql.models.ServerVulnerabilityAssessment": null, - "azure.mgmt.sql.models.ServerVulnerabilityAssessmentListResult": null, - "azure.mgmt.sql.models.ServiceObjectiveCapability": null, - "azure.mgmt.sql.models.ServicePrincipal": null, - "azure.mgmt.sql.models.Sku": null, - "azure.mgmt.sql.models.SqlAgentConfiguration": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessment": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentListResult": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanError": null, - "azure.mgmt.sql.models.SQLVulnerabilityAssessmentScanListResult": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecordListResult": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults": null, - "azure.mgmt.sql.models.StartStopManagedInstanceSchedule": null, - "azure.mgmt.sql.models.StartStopManagedInstanceScheduleListResult": null, - "azure.mgmt.sql.models.StorageCapability": null, - "azure.mgmt.sql.models.SubscriptionUsage": null, - "azure.mgmt.sql.models.SubscriptionUsageListResult": null, - "azure.mgmt.sql.models.SynapseLinkWorkspace": null, - "azure.mgmt.sql.models.SynapseLinkWorkspaceInfoProperties": null, - "azure.mgmt.sql.models.SynapseLinkWorkspaceListResult": null, - "azure.mgmt.sql.models.SyncAgent": null, - "azure.mgmt.sql.models.SyncAgentKeyProperties": null, - "azure.mgmt.sql.models.SyncAgentLinkedDatabase": null, - "azure.mgmt.sql.models.SyncAgentLinkedDatabaseListResult": null, - "azure.mgmt.sql.models.SyncAgentListResult": null, - "azure.mgmt.sql.models.SyncDatabaseIdListResult": null, - "azure.mgmt.sql.models.SyncDatabaseIdProperties": null, - "azure.mgmt.sql.models.SyncFullSchemaProperties": null, - "azure.mgmt.sql.models.SyncFullSchemaPropertiesListResult": null, - "azure.mgmt.sql.models.SyncFullSchemaTable": null, - "azure.mgmt.sql.models.SyncFullSchemaTableColumn": null, - "azure.mgmt.sql.models.SyncGroup": null, - "azure.mgmt.sql.models.SyncGroupListResult": null, - "azure.mgmt.sql.models.SyncGroupLogListResult": null, - "azure.mgmt.sql.models.SyncGroupLogProperties": null, - "azure.mgmt.sql.models.SyncGroupSchema": null, - "azure.mgmt.sql.models.SyncGroupSchemaTable": null, - "azure.mgmt.sql.models.SyncGroupSchemaTableColumn": null, - "azure.mgmt.sql.models.SyncMember": null, - "azure.mgmt.sql.models.SyncMemberListResult": null, - "azure.mgmt.sql.models.SystemData": null, - "azure.mgmt.sql.models.TdeCertificate": null, - "azure.mgmt.sql.models.TimeZone": null, - "azure.mgmt.sql.models.TimeZoneListResult": null, - "azure.mgmt.sql.models.TopQueries": null, - "azure.mgmt.sql.models.TopQueriesListResult": null, - "azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters": null, - "azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation": null, - "azure.mgmt.sql.models.UpsertManagedServerOperationParameters": null, - "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration": null, - "azure.mgmt.sql.models.Usage": null, - "azure.mgmt.sql.models.UsageListResult": null, - "azure.mgmt.sql.models.UserIdentity": null, - "azure.mgmt.sql.models.VaRule": null, - "azure.mgmt.sql.models.VirtualCluster": null, - "azure.mgmt.sql.models.VirtualClusterListResult": null, - "azure.mgmt.sql.models.VirtualClusterUpdate": null, - "azure.mgmt.sql.models.VirtualNetworkRule": null, - "azure.mgmt.sql.models.VirtualNetworkRuleListResult": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentScanError": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordListResult": null, - "azure.mgmt.sql.models.WorkloadClassifier": null, - "azure.mgmt.sql.models.WorkloadClassifierListResult": null, - "azure.mgmt.sql.models.WorkloadGroup": null, - "azure.mgmt.sql.models.WorkloadGroupListResult": null, - "azure.mgmt.sql.models.ZonePinningCapability": null, - "azure.mgmt.sql.models.DiffBackupIntervalInHours": null, - "azure.mgmt.sql.models.BlobAuditingPolicyState": null, - "azure.mgmt.sql.models.CreatedByType": null, - "azure.mgmt.sql.models.AdvancedThreatProtectionState": null, - "azure.mgmt.sql.models.RecommendedActionCurrentState": null, - "azure.mgmt.sql.models.RecommendedActionInitiatedBy": null, - "azure.mgmt.sql.models.ImplementationMethod": null, - "azure.mgmt.sql.models.IsRetryable": null, - "azure.mgmt.sql.models.AdvisorStatus": null, - "azure.mgmt.sql.models.AutoExecuteStatus": null, - "azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom": null, - "azure.mgmt.sql.models.ColumnDataType": null, - "azure.mgmt.sql.models.TableTemporalType": null, - "azure.mgmt.sql.models.ManagementOperationState": null, - "azure.mgmt.sql.models.Phase": null, - "azure.mgmt.sql.models.DatabaseIdentityType": null, - "azure.mgmt.sql.models.CreateMode": null, - "azure.mgmt.sql.models.SampleName": null, - "azure.mgmt.sql.models.DatabaseStatus": null, - "azure.mgmt.sql.models.CatalogCollationType": null, - "azure.mgmt.sql.models.DatabaseLicenseType": null, - "azure.mgmt.sql.models.DatabaseReadScale": null, - "azure.mgmt.sql.models.SecondaryType": null, - "azure.mgmt.sql.models.BackupStorageRedundancy": null, - "azure.mgmt.sql.models.DatabaseKeyType": null, - "azure.mgmt.sql.models.AlwaysEncryptedEnclaveType": null, - "azure.mgmt.sql.models.FreeLimitExhaustionBehavior": null, - "azure.mgmt.sql.models.AvailabilityZoneType": null, - "azure.mgmt.sql.models.SecurityAlertsPolicyState": null, - "azure.mgmt.sql.models.RuleStatus": null, - "azure.mgmt.sql.models.RuleSeverity": null, - "azure.mgmt.sql.models.RuleType": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentScanState": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentState": null, - "azure.mgmt.sql.models.DataMaskingRuleState": null, - "azure.mgmt.sql.models.DataMaskingFunction": null, - "azure.mgmt.sql.models.ReplicaSynchronizationHealth": null, - "azure.mgmt.sql.models.ReplicaConnectedState": null, - "azure.mgmt.sql.models.ReplicationModeType": null, - "azure.mgmt.sql.models.LinkRole": null, - "azure.mgmt.sql.models.FailoverModeType": null, - "azure.mgmt.sql.models.SeedingModeType": null, - "azure.mgmt.sql.models.ElasticPoolState": null, - "azure.mgmt.sql.models.ElasticPoolLicenseType": null, - "azure.mgmt.sql.models.ServerKeyType": null, - "azure.mgmt.sql.models.FailoverGroupReplicationRole": null, - "azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy": null, - "azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy": null, - "azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType": null, - "azure.mgmt.sql.models.GeoBackupPolicyState": null, - "azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole": null, - "azure.mgmt.sql.models.SecondaryInstanceType": null, - "azure.mgmt.sql.models.ErrorType": null, - "azure.mgmt.sql.models.InstancePoolLicenseType": null, - "azure.mgmt.sql.models.JobAgentIdentityType": null, - "azure.mgmt.sql.models.JobAgentState": null, - "azure.mgmt.sql.models.JobExecutionLifecycle": null, - "azure.mgmt.sql.models.ProvisioningState": null, - "azure.mgmt.sql.models.JobTargetType": null, - "azure.mgmt.sql.models.JobScheduleType": null, - "azure.mgmt.sql.models.JobStepActionType": null, - "azure.mgmt.sql.models.JobStepActionSource": null, - "azure.mgmt.sql.models.JobStepOutputType": null, - "azure.mgmt.sql.models.JobTargetGroupMembershipType": null, - "azure.mgmt.sql.models.LedgerDigestUploadsState": null, - "azure.mgmt.sql.models.MaxSizeUnit": null, - "azure.mgmt.sql.models.LogSizeUnit": null, - "azure.mgmt.sql.models.CapabilityStatus": null, - "azure.mgmt.sql.models.PerformanceLevelUnit": null, - "azure.mgmt.sql.models.PauseDelayTimeUnit": null, - "azure.mgmt.sql.models.StorageCapabilityStorageAccountType": null, - "azure.mgmt.sql.models.TimeBasedImmutability": null, - "azure.mgmt.sql.models.TimeBasedImmutabilityMode": null, - "azure.mgmt.sql.models.SetLegalHoldImmutability": null, - "azure.mgmt.sql.models.BackupStorageAccessTier": null, - "azure.mgmt.sql.models.DayOfWeek": null, - "azure.mgmt.sql.models.MoveOperationMode": null, - "azure.mgmt.sql.models.QueryMetricUnitType": null, - "azure.mgmt.sql.models.QueryTimeGrainType": null, - "azure.mgmt.sql.models.ManagedDatabaseStatus": null, - "azure.mgmt.sql.models.ManagedDatabaseCreateMode": null, - "azure.mgmt.sql.models.InaccessibilityReason": null, - "azure.mgmt.sql.models.SecurityAlertPolicyState": null, - "azure.mgmt.sql.models.SecurityEventType": null, - "azure.mgmt.sql.models.SensitivityLabelRank": null, - "azure.mgmt.sql.models.ClientClassificationSource": null, - "azure.mgmt.sql.models.SensitivityLabelUpdateKind": null, - "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind": null, - "azure.mgmt.sql.models.TransparentDataEncryptionState": null, - "azure.mgmt.sql.models.ManagedInstanceAdministratorType": null, - "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": null, - "azure.mgmt.sql.models.IdentityType": null, - "azure.mgmt.sql.models.ManagedServerCreateMode": null, - "azure.mgmt.sql.models.ManagedInstanceLicenseType": null, - "azure.mgmt.sql.models.HybridSecondaryUsage": null, - "azure.mgmt.sql.models.HybridSecondaryUsageDetected": null, - "azure.mgmt.sql.models.ManagedInstanceProxyOverride": null, - "azure.mgmt.sql.models.AdministratorType": null, - "azure.mgmt.sql.models.PrincipalType": null, - "azure.mgmt.sql.models.ServicePrincipalType": null, - "azure.mgmt.sql.models.ExternalGovernanceStatus": null, - "azure.mgmt.sql.models.PricingModel": null, - "azure.mgmt.sql.models.AuthMetadataLookupModes": null, - "azure.mgmt.sql.models.ManagedInstanceDatabaseFormat": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploadsState": null, - "azure.mgmt.sql.models.OperationOrigin": null, - "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus": null, - "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire": null, - "azure.mgmt.sql.models.PrivateEndpointProvisioningState": null, - "azure.mgmt.sql.models.ReplicationRole": null, - "azure.mgmt.sql.models.ReplicationState": null, - "azure.mgmt.sql.models.ReplicationLinkType": null, - "azure.mgmt.sql.models.RestorePointType": null, - "azure.mgmt.sql.models.ServerConnectionType": null, - "azure.mgmt.sql.models.MinimalTlsVersion": null, - "azure.mgmt.sql.models.ServerPublicNetworkAccessFlag": null, - "azure.mgmt.sql.models.ServerWorkspaceFeature": null, - "azure.mgmt.sql.models.ServerNetworkAccessFlag": null, - "azure.mgmt.sql.models.ServerCreateMode": null, - "azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem": null, - "azure.mgmt.sql.models.SyncAgentState": null, - "azure.mgmt.sql.models.SyncMemberDbType": null, - "azure.mgmt.sql.models.SyncConflictResolutionPolicy": null, - "azure.mgmt.sql.models.SyncGroupState": null, - "azure.mgmt.sql.models.SyncGroupLogType": null, - "azure.mgmt.sql.models.SyncDirection": null, - "azure.mgmt.sql.models.SyncMemberState": null, - "azure.mgmt.sql.models.TransparentDataEncryptionScanState": null, - "azure.mgmt.sql.models.VirtualNetworkRuleState": null, - "azure.mgmt.sql.models.ShortTermRetentionPolicyName": null, - "azure.mgmt.sql.models.AdvancedThreatProtectionName": null, - "azure.mgmt.sql.models.EncryptionProtectorName": null, - "azure.mgmt.sql.models.OperationMode": null, - "azure.mgmt.sql.models.StorageKeyType": null, - "azure.mgmt.sql.models.ReplicaType": null, - "azure.mgmt.sql.models.SecurityAlertPolicyName": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentName": null, - "azure.mgmt.sql.models.BaselineName": null, - "azure.mgmt.sql.models.SqlVulnerabilityAssessmentName": null, - "azure.mgmt.sql.models.DataMaskingPolicyName": null, - "azure.mgmt.sql.models.DataWarehouseUserActivityName": null, - "azure.mgmt.sql.models.FailoverType": null, - "azure.mgmt.sql.models.InstanceRole": null, - "azure.mgmt.sql.models.RoleChangeType": null, - "azure.mgmt.sql.models.GeoBackupPolicyName": null, - "azure.mgmt.sql.models.LedgerDigestUploadsName": null, - "azure.mgmt.sql.models.CapabilityGroup": null, - "azure.mgmt.sql.models.DatabaseState": null, - "azure.mgmt.sql.models.LongTermRetentionPolicyName": null, - "azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName": null, - "azure.mgmt.sql.models.RestoreDetailsName": null, - "azure.mgmt.sql.models.TransparentDataEncryptionName": null, - "azure.mgmt.sql.models.AdministratorName": null, - "azure.mgmt.sql.models.AuthenticationName": null, - "azure.mgmt.sql.models.DtcName": null, - "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName": null, - "azure.mgmt.sql.models.AggregationFunctionType": null, - "azure.mgmt.sql.models.MetricType": null, - "azure.mgmt.sql.models.ManagedLedgerDigestUploadsName": null, - "azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated": null, - "azure.mgmt.sql.models.ServerConfigurationOptionName": null, - "azure.mgmt.sql.models.ConnectionPolicyName": null, - "azure.mgmt.sql.models.DevOpsAuditingSettingsName": null, - "azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState": null, - "azure.mgmt.sql.models.StartStopScheduleName": null, - "azure.mgmt.sql.models.SyncGroupsType": null, - "azure.mgmt.sql.models.DNSRefreshOperationStatus": null, - "azure.mgmt.sql.models.AutomaticTuningOptionModeDesired": null, - "azure.mgmt.sql.models.AutomaticTuningOptionModeActual": null, - "azure.mgmt.sql.models.AutomaticTuningDisabledReason": null, - "azure.mgmt.sql.models.AutomaticTuningServerReason": null, - "azure.mgmt.sql.models.AutomaticTuningMode": null, - "azure.mgmt.sql.models.DataMaskingState": null, - "azure.mgmt.sql.models.AutomaticTuningServerMode": null, - "azure.mgmt.sql.models.CheckNameAvailabilityReason": null, - "azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName": null, - "azure.mgmt.sql.models.SensitivityLabelSource": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.update": null, - "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.update": null, - "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.get": null, - "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.update": null, - "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.update": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.operations.DatabaseColumnsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, - "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revert": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseExtensionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabaseOperationsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseOperationsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.cancel": null, - "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, - "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": null, - "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.update": null, - "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.update": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.DatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.get": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_update": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_export": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_export": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_failover": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_import_method": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_import_method": null, - "azure.mgmt.sql.operations.DatabasesOperations.rename": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.rename": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_pause": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_pause": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_resume": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_resume": null, - "azure.mgmt.sql.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_upgrade_data_warehouse": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.operations.DatabasesOperations.list_inaccessible_by_server": null, - "azure.mgmt.sql.aio.operations.DatabasesOperations.list_inaccessible_by_server": null, - "azure.mgmt.sql.operations.DatabaseSchemasOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseSchemasOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseTablesOperations.list_by_schema": null, - "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.list_by_schema": null, - "azure.mgmt.sql.operations.DatabaseTablesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseUsagesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseUsagesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.get": null, - "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DataMaskingRulesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DataMaskingRulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.list_by_database": null, - "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.get": null, - "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.get": null, - "azure.mgmt.sql.operations.DeletedServersOperations.list": null, - "azure.mgmt.sql.aio.operations.DeletedServersOperations.list": null, - "azure.mgmt.sql.operations.DeletedServersOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.DeletedServersOperations.list_by_location": null, - "azure.mgmt.sql.operations.DeletedServersOperations.get": null, - "azure.mgmt.sql.aio.operations.DeletedServersOperations.get": null, - "azure.mgmt.sql.operations.DeletedServersOperations.begin_recover": null, - "azure.mgmt.sql.aio.operations.DeletedServersOperations.begin_recover": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.get": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, - "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_set_role": null, - "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": null, - "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.cancel": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.get": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.get": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_update": null, - "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_failover": null, - "azure.mgmt.sql.operations.EncryptionProtectorsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.list_by_server": null, - "azure.mgmt.sql.operations.EncryptionProtectorsOperations.get": null, - "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.get": null, - "azure.mgmt.sql.operations.EncryptionProtectorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.EncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.operations.EndpointCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.EndpointCertificatesOperations.get": null, - "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.get": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.list_by_server": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.get": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, - "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.replace": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.replace": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.get": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.FirewallRulesOperations.delete": null, - "azure.mgmt.sql.aio.operations.FirewallRulesOperations.delete": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.list": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.list": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.get": null, - "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.get": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_failover": null, - "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.InstancePoolOperationsOperations.list_by_instance_pool": null, - "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.list_by_instance_pool": null, - "azure.mgmt.sql.operations.InstancePoolOperationsOperations.get": null, - "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.get": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.list": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.get": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.get": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_delete": null, - "azure.mgmt.sql.operations.InstancePoolsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_update": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.get": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.delete": null, - "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.delete": null, - "azure.mgmt.sql.operations.JobAgentsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.JobAgentsOperations.list_by_server": null, - "azure.mgmt.sql.operations.JobAgentsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobAgentsOperations.get": null, - "azure.mgmt.sql.operations.JobAgentsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.JobAgentsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_delete": null, - "azure.mgmt.sql.operations.JobAgentsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_update": null, - "azure.mgmt.sql.operations.JobCredentialsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobCredentialsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobCredentialsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobCredentialsOperations.get": null, - "azure.mgmt.sql.operations.JobCredentialsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.JobCredentialsOperations.create_or_update": null, - "azure.mgmt.sql.operations.JobCredentialsOperations.delete": null, - "azure.mgmt.sql.aio.operations.JobCredentialsOperations.delete": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_job": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_job": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.get": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.cancel": null, - "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create": null, - "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.get": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.begin_delete": null, - "azure.mgmt.sql.operations.JobsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobsOperations.get": null, - "azure.mgmt.sql.operations.JobsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.JobsOperations.create_or_update": null, - "azure.mgmt.sql.operations.JobsOperations.delete": null, - "azure.mgmt.sql.aio.operations.JobsOperations.delete": null, - "azure.mgmt.sql.operations.JobStepExecutionsOperations.list_by_job_execution": null, - "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.list_by_job_execution": null, - "azure.mgmt.sql.operations.JobStepExecutionsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.get": null, - "azure.mgmt.sql.operations.JobStepsOperations.list_by_job": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_job": null, - "azure.mgmt.sql.operations.JobStepsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.get": null, - "azure.mgmt.sql.operations.JobStepsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.create_or_update": null, - "azure.mgmt.sql.operations.JobStepsOperations.delete": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.delete": null, - "azure.mgmt.sql.operations.JobStepsOperations.list_by_version": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_version": null, - "azure.mgmt.sql.operations.JobStepsOperations.get_by_version": null, - "azure.mgmt.sql.aio.operations.JobStepsOperations.get_by_version": null, - "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_step": null, - "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_step": null, - "azure.mgmt.sql.operations.JobTargetExecutionsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.get": null, - "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_job_execution": null, - "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_job_execution": null, - "azure.mgmt.sql.operations.JobTargetGroupsOperations.list_by_agent": null, - "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.list_by_agent": null, - "azure.mgmt.sql.operations.JobTargetGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.get": null, - "azure.mgmt.sql.operations.JobTargetGroupsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.create_or_update": null, - "azure.mgmt.sql.operations.JobTargetGroupsOperations.delete": null, - "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.delete": null, - "azure.mgmt.sql.operations.JobVersionsOperations.list_by_job": null, - "azure.mgmt.sql.aio.operations.JobVersionsOperations.list_by_job": null, - "azure.mgmt.sql.operations.JobVersionsOperations.get": null, - "azure.mgmt.sql.aio.operations.JobVersionsOperations.get": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.operations.CapabilitiesOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.CapabilitiesOperations.list_by_location": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_server": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": null, - "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations.get": null, - "azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations.get": null, - "azure.mgmt.sql.operations.MaintenanceWindowsOperations.get": null, - "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.get": null, - "azure.mgmt.sql.operations.MaintenanceWindowsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_table": null, - "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": null, - "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.list_by_query": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.list_by_query": null, - "azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_cancel_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_cancel_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_restore": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_restore": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_start_move": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_start_move": null, - "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": null, - "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.list_by_schema": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.list_by_schema": null, - "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": null, - "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": null, - "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": null, - "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.cancel": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.cancel": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_failover": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_refresh_status": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_refresh_status": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_start": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_start": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_stop": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_stop": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": null, - "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": null, - "azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations.begin_create": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations.begin_create": null, - "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.list_by_database": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.get": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_disable": null, - "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, - "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": null, - "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": null, - "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.get": null, - "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.get": null, - "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": null, - "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": null, - "azure.mgmt.sql.operations.Operations.list": null, - "azure.mgmt.sql.aio.operations.Operations.list": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.get": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_delete": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.list_by_server": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.get": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.begin_delete": null, - "azure.mgmt.sql.operations.PrivateLinkResourcesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.list_by_server": null, - "azure.mgmt.sql.operations.PrivateLinkResourcesOperations.get": null, - "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.get": null, - "azure.mgmt.sql.operations.RecoverableDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.RecoverableDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.get": null, - "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_database": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.get": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.get": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_delete": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_update": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": null, - "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_server": null, - "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.get": null, - "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.get": null, - "azure.mgmt.sql.operations.RestorePointsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.RestorePointsOperations.list_by_database": null, - "azure.mgmt.sql.operations.RestorePointsOperations.begin_create": null, - "azure.mgmt.sql.aio.operations.RestorePointsOperations.begin_create": null, - "azure.mgmt.sql.operations.RestorePointsOperations.get": null, - "azure.mgmt.sql.aio.operations.RestorePointsOperations.get": null, - "azure.mgmt.sql.operations.RestorePointsOperations.delete": null, - "azure.mgmt.sql.aio.operations.RestorePointsOperations.delete": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_current_by_database": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_recommended_by_database": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.get": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.get": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.create_or_update": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.delete": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.disable_recommendation": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.enable_recommendation": null, - "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_by_database": null, - "azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations.update": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.get": null, - "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerAdvisorsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerAdvisorsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.get": null, - "azure.mgmt.sql.operations.ServerAdvisorsOperations.update": null, - "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.update": null, - "azure.mgmt.sql.operations.ServerAutomaticTuningOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.get": null, - "azure.mgmt.sql.operations.ServerAutomaticTuningOperations.update": null, - "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.update": null, - "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.get": null, - "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.get": null, - "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.get": null, - "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.get": null, - "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.get": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_acquire": null, - "azure.mgmt.sql.operations.ServerKeysOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerKeysOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerKeysOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerKeysOperations.get": null, - "azure.mgmt.sql.operations.ServerKeysOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerKeysOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerKeysOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerKeysOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerOperationsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerOperationsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServersOperations.check_name_availability": null, - "azure.mgmt.sql.aio.operations.ServersOperations.check_name_availability": null, - "azure.mgmt.sql.operations.ServersOperations.list": null, - "azure.mgmt.sql.aio.operations.ServersOperations.list": null, - "azure.mgmt.sql.operations.ServersOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.ServersOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.ServersOperations.get": null, - "azure.mgmt.sql.aio.operations.ServersOperations.get": null, - "azure.mgmt.sql.operations.ServersOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServersOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_update": null, - "azure.mgmt.sql.operations.ServersOperations.begin_import_database": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_import_database": null, - "azure.mgmt.sql.operations.ServersOperations.begin_refresh_status": null, - "azure.mgmt.sql.aio.operations.ServersOperations.begin_refresh_status": null, - "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.get": null, - "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.get": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_location": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.get": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_instance": null, - "azure.mgmt.sql.operations.ServerUsagesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerUsagesOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": null, - "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.get": null, - "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": null, - "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.SqlAgentOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlAgentOperations.get": null, - "azure.mgmt.sql.operations.SqlAgentOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlAgentOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": null, - "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations.delete": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.get": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.get": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": null, - "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.delete": null, - "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.delete": null, - "azure.mgmt.sql.operations.SubscriptionUsagesOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.list_by_location": null, - "azure.mgmt.sql.operations.SubscriptionUsagesOperations.get": null, - "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.get": null, - "azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations.list_by_database": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_by_server": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.get": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.get": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_delete": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.generate_key": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.generate_key": null, - "azure.mgmt.sql.operations.SyncAgentsOperations.list_linked_databases": null, - "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_linked_databases": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_sync_database_ids": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_sync_database_ids": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.get": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_delete": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_update": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.cancel_sync": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.cancel_sync": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_hub_schemas": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_hub_schemas": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.list_logs": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_logs": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_refresh_hub_schema": null, - "azure.mgmt.sql.operations.SyncGroupsOperations.trigger_sync": null, - "azure.mgmt.sql.aio.operations.SyncGroupsOperations.trigger_sync": null, - "azure.mgmt.sql.operations.SyncMembersOperations.list_by_sync_group": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_by_sync_group": null, - "azure.mgmt.sql.operations.SyncMembersOperations.get": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.get": null, - "azure.mgmt.sql.operations.SyncMembersOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.SyncMembersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_delete": null, - "azure.mgmt.sql.operations.SyncMembersOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_update": null, - "azure.mgmt.sql.operations.SyncMembersOperations.begin_refresh_member_schema": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_refresh_member_schema": null, - "azure.mgmt.sql.operations.SyncMembersOperations.list_member_schemas": null, - "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_member_schemas": null, - "azure.mgmt.sql.operations.TdeCertificatesOperations.begin_create": null, - "azure.mgmt.sql.aio.operations.TdeCertificatesOperations.begin_create": null, - "azure.mgmt.sql.operations.TimeZonesOperations.list_by_location": null, - "azure.mgmt.sql.aio.operations.TimeZonesOperations.list_by_location": null, - "azure.mgmt.sql.operations.TimeZonesOperations.get": null, - "azure.mgmt.sql.aio.operations.TimeZonesOperations.get": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.list_by_database": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.get": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.get": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_resume": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_resume": null, - "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_suspend": null, - "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_suspend": null, - "azure.mgmt.sql.operations.UsagesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.aio.operations.UsagesOperations.list_by_instance_pool": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.list": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.list_by_resource_group": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list_by_resource_group": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.get": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.get": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_delete": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update": null, - "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update_dns_servers": null, - "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update_dns_servers": null, - "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.list_by_server": null, - "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.list_by_server": null, - "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.get": null, - "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.get": null, - "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_delete": null, - "azure.mgmt.sql.operations.WorkloadClassifiersOperations.list_by_workload_group": null, - "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.list_by_workload_group": null, - "azure.mgmt.sql.operations.WorkloadClassifiersOperations.get": null, - "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.get": null, - "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_delete": null, - "azure.mgmt.sql.operations.WorkloadGroupsOperations.list_by_database": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.list_by_database": null, - "azure.mgmt.sql.operations.WorkloadGroupsOperations.get": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.get": null, - "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_create_or_update": null, - "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_delete": null, - "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_delete": null + "azure.mgmt.sql.models.AdministratorProperties": "Microsoft.Sql.AdministratorProperties", + "azure.mgmt.sql.models.AdvancedThreatProtectionProperties": "Microsoft.Sql.AdvancedThreatProtectionProperties", + "azure.mgmt.sql.models.Resource": "Azure.ResourceManager.CommonTypes.Resource", + "azure.mgmt.sql.models.ProxyResource": "Azure.ResourceManager.CommonTypes.ProxyResource", + "azure.mgmt.sql.models.Advisor": "Microsoft.Sql.Advisor", + "azure.mgmt.sql.models.AdvisorProperties": "Microsoft.Sql.AdvisorProperties", + "azure.mgmt.sql.models.ArmSystemData": "Azure.ResourceManager.CommonTypes.SystemData", + "azure.mgmt.sql.models.AutomaticTuningOptions": "Microsoft.Sql.AutomaticTuningOptions", + "azure.mgmt.sql.models.AutomaticTuningServerOptions": "Microsoft.Sql.AutomaticTuningServerOptions", + "azure.mgmt.sql.models.AutomaticTuningServerProperties": "Microsoft.Sql.AutomaticTuningServerProperties", + "azure.mgmt.sql.models.AutoPauseDelayTimeRange": "Microsoft.Sql.AutoPauseDelayTimeRange", + "azure.mgmt.sql.models.AzureADOnlyAuthProperties": "Microsoft.Sql.AzureADOnlyAuthProperties", + "azure.mgmt.sql.models.BackupShortTermRetentionPolicy": "Microsoft.Sql.BackupShortTermRetentionPolicy", + "azure.mgmt.sql.models.BackupShortTermRetentionPolicyProperties": "Microsoft.Sql.BackupShortTermRetentionPolicyProperties", + "azure.mgmt.sql.models.Baseline": "Microsoft.Sql.Baseline", + "azure.mgmt.sql.models.BaselineAdjustedResult": "Microsoft.Sql.BaselineAdjustedResult", + "azure.mgmt.sql.models.BenchmarkReference": "Microsoft.Sql.BenchmarkReference", + "azure.mgmt.sql.models.CertificateInfo": "Microsoft.Sql.CertificateInfo", + "azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters": "Microsoft.Sql.ChangeLongTermRetentionBackupAccessTierParameters", + "azure.mgmt.sql.models.CheckNameAvailabilityRequest": "Microsoft.Sql.CheckNameAvailabilityRequest", + "azure.mgmt.sql.models.CheckNameAvailabilityResponse": "Microsoft.Sql.CheckNameAvailabilityResponse", + "azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition": "Microsoft.Sql.CompleteDatabaseRestoreDefinition", + "azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters": "Microsoft.Sql.CopyLongTermRetentionBackupParameters", + "azure.mgmt.sql.models.CopyLongTermRetentionBackupParametersProperties": "Microsoft.Sql.CopyLongTermRetentionBackupParametersProperties", + "azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition": "Microsoft.Sql.CreateDatabaseRestorePointDefinition", + "azure.mgmt.sql.models.TrackedResource": "Azure.ResourceManager.CommonTypes.TrackedResource", + "azure.mgmt.sql.models.Database": "Microsoft.Sql.Database", + "azure.mgmt.sql.models.DatabaseAdvancedThreatProtection": "Microsoft.Sql.DatabaseAdvancedThreatProtection", + "azure.mgmt.sql.models.DatabaseAutomaticTuning": "Microsoft.Sql.DatabaseAutomaticTuning", + "azure.mgmt.sql.models.DatabaseAutomaticTuningProperties": "Microsoft.Sql.DatabaseAutomaticTuningProperties", + "azure.mgmt.sql.models.DatabaseBlobAuditingPolicy": "Microsoft.Sql.DatabaseBlobAuditingPolicy", + "azure.mgmt.sql.models.DatabaseBlobAuditingPolicyProperties": "Microsoft.Sql.DatabaseBlobAuditingPolicyProperties", + "azure.mgmt.sql.models.DatabaseColumn": "Microsoft.Sql.DatabaseColumn", + "azure.mgmt.sql.models.DatabaseColumnProperties": "Microsoft.Sql.DatabaseColumnProperties", + "azure.mgmt.sql.models.ResourceAutoGenerated": "Microsoft.Sql.Resource", + "azure.mgmt.sql.models.ProxyResourceAutoGenerated": "Microsoft.Sql.ProxyResource", + "azure.mgmt.sql.models.DatabaseExtensions": "Microsoft.Sql.DatabaseExtensions", + "azure.mgmt.sql.models.DatabaseExtensionsProperties": "Microsoft.Sql.DatabaseExtensionsProperties", + "azure.mgmt.sql.models.DatabaseIdentity": "Microsoft.Sql.DatabaseIdentity", + "azure.mgmt.sql.models.DatabaseKey": "Microsoft.Sql.DatabaseKey", + "azure.mgmt.sql.models.DatabaseOperation": "Microsoft.Sql.DatabaseOperation", + "azure.mgmt.sql.models.DatabaseOperationProperties": "Microsoft.Sql.DatabaseOperationProperties", + "azure.mgmt.sql.models.DatabaseProperties": "Microsoft.Sql.DatabaseProperties", + "azure.mgmt.sql.models.DatabaseSchema": "Microsoft.Sql.DatabaseSchema", + "azure.mgmt.sql.models.DatabaseSecurityAlertPolicy": "Microsoft.Sql.DatabaseSecurityAlertPolicy", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSet", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSetProperties": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSetProperties", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaseline", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties", + "azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties", + "azure.mgmt.sql.models.DatabaseTable": "Microsoft.Sql.DatabaseTable", + "azure.mgmt.sql.models.DatabaseTableProperties": "Microsoft.Sql.DatabaseTableProperties", + "azure.mgmt.sql.models.DatabaseUpdate": "Microsoft.Sql.DatabaseUpdate", + "azure.mgmt.sql.models.DatabaseUpdateProperties": "Microsoft.Sql.DatabaseUpdateProperties", + "azure.mgmt.sql.models.DatabaseUsage": "Microsoft.Sql.DatabaseUsage", + "azure.mgmt.sql.models.DatabaseUsageProperties": "Microsoft.Sql.DatabaseUsageProperties", + "azure.mgmt.sql.models.DatabaseUserIdentity": "Microsoft.Sql.DatabaseUserIdentity", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessment": "Microsoft.Sql.DatabaseVulnerabilityAssessment", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentProperties": "Microsoft.Sql.DatabaseVulnerabilityAssessmentProperties", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaseline", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselineItem", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineProperties": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselineProperties", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScanExportProperties": "Microsoft.Sql.DatabaseVulnerabilityAssessmentScanExportProperties", + "azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport": "Microsoft.Sql.DatabaseVulnerabilityAssessmentScansExport", + "azure.mgmt.sql.models.DataMaskingPolicy": "Microsoft.Sql.DataMaskingPolicy", + "azure.mgmt.sql.models.DataMaskingPolicyProperties": "Microsoft.Sql.DataMaskingPolicyProperties", + "azure.mgmt.sql.models.DataMaskingRule": "Microsoft.Sql.DataMaskingRule", + "azure.mgmt.sql.models.DataMaskingRuleProperties": "Microsoft.Sql.DataMaskingRuleProperties", + "azure.mgmt.sql.models.DataSyncParticipantIdentity": "Microsoft.Sql.DataSyncParticipantIdentity", + "azure.mgmt.sql.models.DataSyncParticipantUserAssignedIdentity": "Microsoft.Sql.DataSyncParticipantUserAssignedIdentity", + "azure.mgmt.sql.models.DataWarehouseUserActivities": "Microsoft.Sql.DataWarehouseUserActivities", + "azure.mgmt.sql.models.DataWarehouseUserActivitiesProperties": "Microsoft.Sql.DataWarehouseUserActivitiesProperties", + "azure.mgmt.sql.models.DeletedServer": "Microsoft.Sql.DeletedServer", + "azure.mgmt.sql.models.DeletedServerProperties": "Microsoft.Sql.DeletedServerProperties", + "azure.mgmt.sql.models.DistributedAvailabilityGroup": "Microsoft.Sql.DistributedAvailabilityGroup", + "azure.mgmt.sql.models.DistributedAvailabilityGroupDatabase": "Microsoft.Sql.DistributedAvailabilityGroupDatabase", + "azure.mgmt.sql.models.DistributedAvailabilityGroupProperties": "Microsoft.Sql.DistributedAvailabilityGroupProperties", + "azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole": "Microsoft.Sql.DistributedAvailabilityGroupSetRole", + "azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest": "Microsoft.Sql.DistributedAvailabilityGroupsFailoverRequest", + "azure.mgmt.sql.models.EditionCapability": "Microsoft.Sql.EditionCapability", + "azure.mgmt.sql.models.ElasticPool": "Microsoft.Sql.ElasticPool", + "azure.mgmt.sql.models.ElasticPoolEditionCapability": "Microsoft.Sql.ElasticPoolEditionCapability", + "azure.mgmt.sql.models.ElasticPoolOperation": "Microsoft.Sql.ElasticPoolOperation", + "azure.mgmt.sql.models.ElasticPoolOperationProperties": "Microsoft.Sql.ElasticPoolOperationProperties", + "azure.mgmt.sql.models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability": "Microsoft.Sql.ElasticPoolPerDatabaseMaxPerformanceLevelCapability", + "azure.mgmt.sql.models.ElasticPoolPerDatabaseMinPerformanceLevelCapability": "Microsoft.Sql.ElasticPoolPerDatabaseMinPerformanceLevelCapability", + "azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings": "Microsoft.Sql.ElasticPoolPerDatabaseSettings", + "azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability": "Microsoft.Sql.ElasticPoolPerformanceLevelCapability", + "azure.mgmt.sql.models.ElasticPoolProperties": "Microsoft.Sql.ElasticPoolProperties", + "azure.mgmt.sql.models.ElasticPoolUpdate": "Microsoft.Sql.ElasticPoolUpdate", + "azure.mgmt.sql.models.ElasticPoolUpdateProperties": "Microsoft.Sql.ElasticPoolUpdateProperties", + "azure.mgmt.sql.models.EncryptionProtector": "Microsoft.Sql.EncryptionProtector", + "azure.mgmt.sql.models.EncryptionProtectorProperties": "Microsoft.Sql.EncryptionProtectorProperties", + "azure.mgmt.sql.models.EndpointCertificate": "Microsoft.Sql.EndpointCertificate", + "azure.mgmt.sql.models.EndpointCertificateProperties": "Microsoft.Sql.EndpointCertificateProperties", + "azure.mgmt.sql.models.EndpointDependency": "Microsoft.Sql.EndpointDependency", + "azure.mgmt.sql.models.EndpointDetail": "Microsoft.Sql.EndpointDetail", + "azure.mgmt.sql.models.ErrorAdditionalInfo": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "azure.mgmt.sql.models.ErrorDetail": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "azure.mgmt.sql.models.ErrorResponse": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "azure.mgmt.sql.models.ExportDatabaseDefinition": "Microsoft.Sql.ExportDatabaseDefinition", + "azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicy", + "azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicyProperties": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicyProperties", + "azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy": "Microsoft.Sql.ExtendedServerBlobAuditingPolicy", + "azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicyProperties": "Microsoft.Sql.ExtendedServerBlobAuditingPolicyProperties", + "azure.mgmt.sql.models.FailoverGroup": "Microsoft.Sql.FailoverGroup", + "azure.mgmt.sql.models.FailoverGroupProperties": "Microsoft.Sql.FailoverGroupProperties", + "azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint": "Microsoft.Sql.FailoverGroupReadOnlyEndpoint", + "azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint": "Microsoft.Sql.FailoverGroupReadWriteEndpoint", + "azure.mgmt.sql.models.FailoverGroupUpdate": "Microsoft.Sql.FailoverGroupUpdate", + "azure.mgmt.sql.models.FailoverGroupUpdateProperties": "Microsoft.Sql.FailoverGroupUpdateProperties", + "azure.mgmt.sql.models.ResourceWithWritableName": "Microsoft.Sql.ResourceWithWritableName", + "azure.mgmt.sql.models.ProxyResourceWithWritableName": "Microsoft.Sql.ProxyResourceWithWritableName", + "azure.mgmt.sql.models.FirewallRule": "Microsoft.Sql.FirewallRule", + "azure.mgmt.sql.models.FirewallRuleList": "Microsoft.Sql.FirewallRuleList", + "azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability": "Microsoft.Sql.FreeLimitExhaustionBehaviorCapability", + "azure.mgmt.sql.models.GeoBackupPolicy": "Microsoft.Sql.GeoBackupPolicy", + "azure.mgmt.sql.models.GeoBackupPolicyProperties": "Microsoft.Sql.GeoBackupPolicyProperties", + "azure.mgmt.sql.models.ImportExistingDatabaseDefinition": "Microsoft.Sql.ImportExistingDatabaseDefinition", + "azure.mgmt.sql.models.ImportExportExtensionsOperationResult": "Microsoft.Sql.ImportExportExtensionsOperationResult", + "azure.mgmt.sql.models.ImportExportExtensionsOperationResultProperties": "Microsoft.Sql.ImportExportExtensionsOperationResultProperties", + "azure.mgmt.sql.models.ImportExportOperationResult": "Microsoft.Sql.ImportExportOperationResult", + "azure.mgmt.sql.models.ImportExportOperationResultProperties": "Microsoft.Sql.ImportExportOperationResultProperties", + "azure.mgmt.sql.models.ImportNewDatabaseDefinition": "Microsoft.Sql.ImportNewDatabaseDefinition", + "azure.mgmt.sql.models.InstanceFailoverGroup": "Microsoft.Sql.InstanceFailoverGroup", + "azure.mgmt.sql.models.InstanceFailoverGroupProperties": "Microsoft.Sql.InstanceFailoverGroupProperties", + "azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint": "Microsoft.Sql.InstanceFailoverGroupReadOnlyEndpoint", + "azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint": "Microsoft.Sql.InstanceFailoverGroupReadWriteEndpoint", + "azure.mgmt.sql.models.InstancePool": "Microsoft.Sql.InstancePool", + "azure.mgmt.sql.models.InstancePoolEditionCapability": "Microsoft.Sql.InstancePoolEditionCapability", + "azure.mgmt.sql.models.InstancePoolFamilyCapability": "Microsoft.Sql.InstancePoolFamilyCapability", + "azure.mgmt.sql.models.InstancePoolOperation": "Microsoft.Sql.InstancePoolOperation", + "azure.mgmt.sql.models.InstancePoolOperationProperties": "Microsoft.Sql.InstancePoolOperationProperties", + "azure.mgmt.sql.models.InstancePoolProperties": "Microsoft.Sql.InstancePoolProperties", + "azure.mgmt.sql.models.InstancePoolUpdate": "Microsoft.Sql.InstancePoolUpdate", + "azure.mgmt.sql.models.InstancePoolVcoresCapability": "Microsoft.Sql.InstancePoolVcoresCapability", + "azure.mgmt.sql.models.IPv6FirewallRule": "Microsoft.Sql.IPv6FirewallRule", + "azure.mgmt.sql.models.IPv6ServerFirewallRuleProperties": "Microsoft.Sql.IPv6ServerFirewallRuleProperties", + "azure.mgmt.sql.models.Job": "Microsoft.Sql.Job", + "azure.mgmt.sql.models.JobAgent": "Microsoft.Sql.JobAgent", + "azure.mgmt.sql.models.JobAgentEditionCapability": "Microsoft.Sql.JobAgentEditionCapability", + "azure.mgmt.sql.models.JobAgentIdentity": "Microsoft.Sql.JobAgentIdentity", + "azure.mgmt.sql.models.JobAgentProperties": "Microsoft.Sql.JobAgentProperties", + "azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability": "Microsoft.Sql.JobAgentServiceLevelObjectiveCapability", + "azure.mgmt.sql.models.JobAgentUpdate": "Microsoft.Sql.JobAgentUpdate", + "azure.mgmt.sql.models.JobAgentUserAssignedIdentity": "Microsoft.Sql.JobAgentUserAssignedIdentity", + "azure.mgmt.sql.models.JobAgentVersionCapability": "Microsoft.Sql.JobAgentVersionCapability", + "azure.mgmt.sql.models.JobCredential": "Microsoft.Sql.JobCredential", + "azure.mgmt.sql.models.JobCredentialProperties": "Microsoft.Sql.JobCredentialProperties", + "azure.mgmt.sql.models.JobExecution": "Microsoft.Sql.JobExecution", + "azure.mgmt.sql.models.JobExecutionProperties": "Microsoft.Sql.JobExecutionProperties", + "azure.mgmt.sql.models.JobExecutionTarget": "Microsoft.Sql.JobExecutionTarget", + "azure.mgmt.sql.models.JobPrivateEndpoint": "Microsoft.Sql.JobPrivateEndpoint", + "azure.mgmt.sql.models.JobPrivateEndpointProperties": "Microsoft.Sql.JobPrivateEndpointProperties", + "azure.mgmt.sql.models.JobProperties": "Microsoft.Sql.JobProperties", + "azure.mgmt.sql.models.JobSchedule": "Microsoft.Sql.JobSchedule", + "azure.mgmt.sql.models.JobStep": "Microsoft.Sql.JobStep", + "azure.mgmt.sql.models.JobStepAction": "Microsoft.Sql.JobStepAction", + "azure.mgmt.sql.models.JobStepExecutionOptions": "Microsoft.Sql.JobStepExecutionOptions", + "azure.mgmt.sql.models.JobStepOutput": "Microsoft.Sql.JobStepOutput", + "azure.mgmt.sql.models.JobStepProperties": "Microsoft.Sql.JobStepProperties", + "azure.mgmt.sql.models.JobTarget": "Microsoft.Sql.JobTarget", + "azure.mgmt.sql.models.JobTargetGroup": "Microsoft.Sql.JobTargetGroup", + "azure.mgmt.sql.models.JobTargetGroupProperties": "Microsoft.Sql.JobTargetGroupProperties", + "azure.mgmt.sql.models.JobVersion": "Microsoft.Sql.JobVersion", + "azure.mgmt.sql.models.LedgerDigestUploads": "Microsoft.Sql.LedgerDigestUploads", + "azure.mgmt.sql.models.LedgerDigestUploadsProperties": "Microsoft.Sql.LedgerDigestUploadsProperties", + "azure.mgmt.sql.models.LicenseTypeCapability": "Microsoft.Sql.LicenseTypeCapability", + "azure.mgmt.sql.models.LocationCapabilities": "Microsoft.Sql.LocationCapabilities", + "azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryption", + "azure.mgmt.sql.models.LogSizeCapability": "Microsoft.Sql.LogSizeCapability", + "azure.mgmt.sql.models.LongTermRetentionBackup": "Microsoft.Sql.LongTermRetentionBackup", + "azure.mgmt.sql.models.LongTermRetentionBackupOperationResult": "Microsoft.Sql.LongTermRetentionBackupOperationResult", + "azure.mgmt.sql.models.LongTermRetentionBackupProperties": "Microsoft.Sql.LongTermRetentionBackupProperties", + "azure.mgmt.sql.models.LongTermRetentionOperationResultProperties": "Microsoft.Sql.LongTermRetentionOperationResultProperties", + "azure.mgmt.sql.models.LongTermRetentionPolicy": "Microsoft.Sql.LongTermRetentionPolicy", + "azure.mgmt.sql.models.LongTermRetentionPolicyProperties": "Microsoft.Sql.LongTermRetentionPolicyProperties", + "azure.mgmt.sql.models.MaintenanceConfigurationCapability": "Microsoft.Sql.MaintenanceConfigurationCapability", + "azure.mgmt.sql.models.MaintenanceWindowOptions": "Microsoft.Sql.MaintenanceWindowOptions", + "azure.mgmt.sql.models.MaintenanceWindowOptionsProperties": "Microsoft.Sql.MaintenanceWindowOptionsProperties", + "azure.mgmt.sql.models.MaintenanceWindows": "Microsoft.Sql.MaintenanceWindows", + "azure.mgmt.sql.models.MaintenanceWindowsProperties": "Microsoft.Sql.MaintenanceWindowsProperties", + "azure.mgmt.sql.models.MaintenanceWindowTimeRange": "Microsoft.Sql.MaintenanceWindowTimeRange", + "azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicy", + "azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicyProperties": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicyProperties", + "azure.mgmt.sql.models.ManagedDatabase": "Microsoft.Sql.ManagedDatabase", + "azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtection", + "azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo": "Microsoft.Sql.ManagedDatabaseExtendedAccessibilityInfo", + "azure.mgmt.sql.models.ManagedDatabaseMoveDefinition": "Microsoft.Sql.ManagedDatabaseMoveDefinition", + "azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult": "Microsoft.Sql.ManagedDatabaseMoveOperationResult", + "azure.mgmt.sql.models.ManagedDatabaseMoveOperationResultProperties": "Microsoft.Sql.ManagedDatabaseMoveOperationResultProperties", + "azure.mgmt.sql.models.ManagedDatabaseProperties": "Microsoft.Sql.ManagedDatabaseProperties", + "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties": "Microsoft.Sql.ManagedDatabaseRestoreDetailsBackupSetProperties", + "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsProperties": "Microsoft.Sql.ManagedDatabaseRestoreDetailsProperties", + "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult": "Microsoft.Sql.ManagedDatabaseRestoreDetailsResult", + "azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties": "Microsoft.Sql.ManagedDatabaseRestoreDetailsUnrestorableFileProperties", + "azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicy", + "azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition": "Microsoft.Sql.ManagedDatabaseStartMoveDefinition", + "azure.mgmt.sql.models.ManagedDatabaseUpdate": "Microsoft.Sql.ManagedDatabaseUpdate", + "azure.mgmt.sql.models.ManagedInstance": "Microsoft.Sql.ManagedInstance", + "azure.mgmt.sql.models.ManagedInstanceAdministrator": "Microsoft.Sql.ManagedInstanceAdministrator", + "azure.mgmt.sql.models.ManagedInstanceAdministratorProperties": "Microsoft.Sql.ManagedInstanceAdministratorProperties", + "azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtection", + "azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentication", + "azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthProperties": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthProperties", + "azure.mgmt.sql.models.ManagedInstanceDtc": "Microsoft.Sql.ManagedInstanceDtc", + "azure.mgmt.sql.models.ManagedInstanceDtcProperties": "Microsoft.Sql.ManagedInstanceDtcProperties", + "azure.mgmt.sql.models.ManagedInstanceDtcSecuritySettings": "Microsoft.Sql.ManagedInstanceDtcSecuritySettings", + "azure.mgmt.sql.models.ManagedInstanceDtcTransactionManagerCommunicationSettings": "Microsoft.Sql.ManagedInstanceDtcTransactionManagerCommunicationSettings", + "azure.mgmt.sql.models.ManagedInstanceEditionCapability": "Microsoft.Sql.ManagedInstanceEditionCapability", + "azure.mgmt.sql.models.ManagedInstanceEncryptionProtector": "Microsoft.Sql.ManagedInstanceEncryptionProtector", + "azure.mgmt.sql.models.ManagedInstanceEncryptionProtectorProperties": "Microsoft.Sql.ManagedInstanceEncryptionProtectorProperties", + "azure.mgmt.sql.models.ManagedInstanceExternalAdministrator": "Microsoft.Sql.ManagedInstanceExternalAdministrator", + "azure.mgmt.sql.models.ManagedInstanceFamilyCapability": "Microsoft.Sql.ManagedInstanceFamilyCapability", + "azure.mgmt.sql.models.ManagedInstanceKey": "Microsoft.Sql.ManagedInstanceKey", + "azure.mgmt.sql.models.ManagedInstanceKeyProperties": "Microsoft.Sql.ManagedInstanceKeyProperties", + "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackup", + "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackupProperties": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackupProperties", + "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicy", + "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyProperties": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicyProperties", + "azure.mgmt.sql.models.ManagedInstanceMaintenanceConfigurationCapability": "Microsoft.Sql.ManagedInstanceMaintenanceConfigurationCapability", + "azure.mgmt.sql.models.ManagedInstanceOperation": "Microsoft.Sql.ManagedInstanceOperation", + "azure.mgmt.sql.models.ManagedInstanceOperationParametersPair": "Microsoft.Sql.ManagedInstanceOperationParametersPair", + "azure.mgmt.sql.models.ManagedInstanceOperationProperties": "Microsoft.Sql.ManagedInstanceOperationProperties", + "azure.mgmt.sql.models.ManagedInstanceOperationSteps": "Microsoft.Sql.ManagedInstanceOperationSteps", + "azure.mgmt.sql.models.ManagedInstancePairInfo": "Microsoft.Sql.ManagedInstancePairInfo", + "azure.mgmt.sql.models.ManagedInstancePecProperty": "Microsoft.Sql.ManagedInstancePecProperty", + "azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection": "Microsoft.Sql.ManagedInstancePrivateEndpointConnection", + "azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionProperties": "Microsoft.Sql.ManagedInstancePrivateEndpointConnectionProperties", + "azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty": "Microsoft.Sql.ManagedInstancePrivateEndpointProperty", + "azure.mgmt.sql.models.ManagedInstancePrivateLink": "Microsoft.Sql.ManagedInstancePrivateLink", + "azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties": "Microsoft.Sql.ManagedInstancePrivateLinkProperties", + "azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty": "Microsoft.Sql.ManagedInstancePrivateLinkServiceConnectionStateProperty", + "azure.mgmt.sql.models.ManagedInstanceProperties": "Microsoft.Sql.ManagedInstanceProperties", + "azure.mgmt.sql.models.ManagedInstanceQuery": "Microsoft.Sql.ManagedInstanceQuery", + "azure.mgmt.sql.models.ManagedInstanceUpdate": "Microsoft.Sql.ManagedInstanceUpdate", + "azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest": "Microsoft.Sql.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", + "azure.mgmt.sql.models.ManagedInstanceVcoresCapability": "Microsoft.Sql.ManagedInstanceVcoresCapability", + "azure.mgmt.sql.models.ManagedInstanceVersionCapability": "Microsoft.Sql.ManagedInstanceVersionCapability", + "azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessment", + "azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessmentProperties": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessmentProperties", + "azure.mgmt.sql.models.ManagedLedgerDigestUploads": "Microsoft.Sql.ManagedLedgerDigestUploads", + "azure.mgmt.sql.models.ManagedLedgerDigestUploadsProperties": "Microsoft.Sql.ManagedLedgerDigestUploadsProperties", + "azure.mgmt.sql.models.ManagedServerDnsAlias": "Microsoft.Sql.ManagedServerDnsAlias", + "azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition": "Microsoft.Sql.ManagedServerDnsAliasAcquisition", + "azure.mgmt.sql.models.ManagedServerDnsAliasCreation": "Microsoft.Sql.ManagedServerDnsAliasCreation", + "azure.mgmt.sql.models.ManagedServerDnsAliasProperties": "Microsoft.Sql.ManagedServerDnsAliasProperties", + "azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy": "Microsoft.Sql.ManagedServerSecurityAlertPolicy", + "azure.mgmt.sql.models.ManagedTransparentDataEncryption": "Microsoft.Sql.ManagedTransparentDataEncryption", + "azure.mgmt.sql.models.ManagedTransparentDataEncryptionProperties": "Microsoft.Sql.ManagedTransparentDataEncryptionProperties", + "azure.mgmt.sql.models.MaxLimitRangeCapability": "Microsoft.Sql.MaxLimitRangeCapability", + "azure.mgmt.sql.models.MaxSizeCapability": "Microsoft.Sql.MaxSizeCapability", + "azure.mgmt.sql.models.MaxSizeRangeCapability": "Microsoft.Sql.MaxSizeRangeCapability", + "azure.mgmt.sql.models.MinCapacityCapability": "Microsoft.Sql.MinCapacityCapability", + "azure.mgmt.sql.models.Name": "Microsoft.Sql.Name", + "azure.mgmt.sql.models.NetworkIsolationSettings": "Microsoft.Sql.NetworkIsolationSettings", + "azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration": "Microsoft.Sql.NetworkSecurityPerimeterConfiguration", + "azure.mgmt.sql.models.NetworkSecurityPerimeterConfigurationProperties": "Microsoft.Sql.NetworkSecurityPerimeterConfigurationProperties", + "azure.mgmt.sql.models.NSPConfigAccessRule": "Microsoft.Sql.NSPConfigAccessRule", + "azure.mgmt.sql.models.NSPConfigAccessRuleProperties": "Microsoft.Sql.NSPConfigAccessRuleProperties", + "azure.mgmt.sql.models.NSPConfigAssociation": "Microsoft.Sql.NSPConfigAssociation", + "azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule": "Microsoft.Sql.NSPConfigNetworkSecurityPerimeterRule", + "azure.mgmt.sql.models.NSPConfigPerimeter": "Microsoft.Sql.NSPConfigPerimeter", + "azure.mgmt.sql.models.NSPConfigProfile": "Microsoft.Sql.NSPConfigProfile", + "azure.mgmt.sql.models.NSPProvisioningIssue": "Microsoft.Sql.NSPProvisioningIssue", + "azure.mgmt.sql.models.NSPProvisioningIssueProperties": "Microsoft.Sql.NSPProvisioningIssueProperties", + "azure.mgmt.sql.models.Operation": "Microsoft.Sql.Operation", + "azure.mgmt.sql.models.OperationDisplay": "Microsoft.Sql.OperationDisplay", + "azure.mgmt.sql.models.OutboundEnvironmentEndpoint": "Microsoft.Sql.OutboundEnvironmentEndpoint", + "azure.mgmt.sql.models.OutboundFirewallRule": "Microsoft.Sql.OutboundFirewallRule", + "azure.mgmt.sql.models.OutboundFirewallRuleProperties": "Microsoft.Sql.OutboundFirewallRuleProperties", + "azure.mgmt.sql.models.PartnerInfo": "Microsoft.Sql.PartnerInfo", + "azure.mgmt.sql.models.PartnerRegionInfo": "Microsoft.Sql.PartnerRegionInfo", + "azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange": "Microsoft.Sql.PerDatabaseAutoPauseDelayTimeRange", + "azure.mgmt.sql.models.PerformanceLevelCapability": "Microsoft.Sql.PerformanceLevelCapability", + "azure.mgmt.sql.models.PhaseDetails": "Microsoft.Sql.PhaseDetails", + "azure.mgmt.sql.models.PrivateEndpointConnection": "Microsoft.Sql.PrivateEndpointConnection", + "azure.mgmt.sql.models.PrivateEndpointConnectionProperties": "Microsoft.Sql.PrivateEndpointConnectionProperties", + "azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus": "Microsoft.Sql.PrivateEndpointConnectionRequestStatus", + "azure.mgmt.sql.models.PrivateEndpointProperty": "Microsoft.Sql.PrivateEndpointProperty", + "azure.mgmt.sql.models.PrivateLinkResource": "Microsoft.Sql.PrivateLinkResource", + "azure.mgmt.sql.models.PrivateLinkResourceProperties": "Microsoft.Sql.PrivateLinkResourceProperties", + "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty": "Microsoft.Sql.PrivateLinkServiceConnectionStateProperty", + "azure.mgmt.sql.models.QueryCheck": "Microsoft.Sql.QueryCheck", + "azure.mgmt.sql.models.QueryMetricInterval": "Microsoft.Sql.QueryMetricInterval", + "azure.mgmt.sql.models.QueryMetricProperties": "Microsoft.Sql.QueryMetricProperties", + "azure.mgmt.sql.models.QueryProperties": "Microsoft.Sql.QueryProperties", + "azure.mgmt.sql.models.QueryStatistics": "Microsoft.Sql.QueryStatistics", + "azure.mgmt.sql.models.QueryStatisticsProperties": "Microsoft.Sql.QueryStatisticsProperties", + "azure.mgmt.sql.models.ReadScaleCapability": "Microsoft.Sql.ReadScaleCapability", + "azure.mgmt.sql.models.RecommendedAction": "Microsoft.Sql.RecommendedAction", + "azure.mgmt.sql.models.RecommendedActionErrorInfo": "Microsoft.Sql.RecommendedActionErrorInfo", + "azure.mgmt.sql.models.RecommendedActionImpactRecord": "Microsoft.Sql.RecommendedActionImpactRecord", + "azure.mgmt.sql.models.RecommendedActionImplementationInfo": "Microsoft.Sql.RecommendedActionImplementationInfo", + "azure.mgmt.sql.models.RecommendedActionMetricInfo": "Microsoft.Sql.RecommendedActionMetricInfo", + "azure.mgmt.sql.models.RecommendedActionProperties": "Microsoft.Sql.RecommendedActionProperties", + "azure.mgmt.sql.models.RecommendedActionStateInfo": "Microsoft.Sql.RecommendedActionStateInfo", + "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate": "Microsoft.Sql.RecommendedSensitivityLabelUpdate", + "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList": "Microsoft.Sql.RecommendedSensitivityLabelUpdateList", + "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateProperties": "Microsoft.Sql.RecommendedSensitivityLabelUpdateProperties", + "azure.mgmt.sql.models.RecoverableDatabase": "Microsoft.Sql.RecoverableDatabase", + "azure.mgmt.sql.models.RecoverableDatabaseProperties": "Microsoft.Sql.RecoverableDatabaseProperties", + "azure.mgmt.sql.models.RecoverableManagedDatabase": "Microsoft.Sql.RecoverableManagedDatabase", + "azure.mgmt.sql.models.RecoverableManagedDatabaseProperties": "Microsoft.Sql.RecoverableManagedDatabaseProperties", + "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult": "Microsoft.Sql.RefreshExternalGovernanceStatusOperationResult", + "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI": "Microsoft.Sql.RefreshExternalGovernanceStatusOperationResultMI", + "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultProperties": "Microsoft.Sql.RefreshExternalGovernanceStatusOperationResultProperties", + "azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultPropertiesMI": "Microsoft.Sql.RefreshExternalGovernanceStatusOperationResultPropertiesMI", + "azure.mgmt.sql.models.Remediation": "Microsoft.Sql.Remediation", + "azure.mgmt.sql.models.ReplicationLink": "Microsoft.Sql.ReplicationLink", + "azure.mgmt.sql.models.ReplicationLinkProperties": "Microsoft.Sql.ReplicationLinkProperties", + "azure.mgmt.sql.models.ReplicationLinkUpdate": "Microsoft.Sql.ReplicationLinkUpdate", + "azure.mgmt.sql.models.ReplicationLinkUpdateProperties": "Microsoft.Sql.ReplicationLinkUpdateProperties", + "azure.mgmt.sql.models.ResourceIdentity": "Microsoft.Sql.ResourceIdentity", + "azure.mgmt.sql.models.ResourceMoveDefinition": "Microsoft.Sql.ResourceMoveDefinition", + "azure.mgmt.sql.models.RestorableDroppedDatabase": "Microsoft.Sql.RestorableDroppedDatabase", + "azure.mgmt.sql.models.RestorableDroppedDatabaseProperties": "Microsoft.Sql.RestorableDroppedDatabaseProperties", + "azure.mgmt.sql.models.RestorableDroppedManagedDatabase": "Microsoft.Sql.RestorableDroppedManagedDatabase", + "azure.mgmt.sql.models.RestorableDroppedManagedDatabaseProperties": "Microsoft.Sql.RestorableDroppedManagedDatabaseProperties", + "azure.mgmt.sql.models.RestorePoint": "Microsoft.Sql.RestorePoint", + "azure.mgmt.sql.models.RestorePointProperties": "Microsoft.Sql.RestorePointProperties", + "azure.mgmt.sql.models.ScheduleItem": "Microsoft.Sql.ScheduleItem", + "azure.mgmt.sql.models.SecurityAlertPolicyProperties": "Microsoft.Sql.SecurityAlertPolicyProperties", + "azure.mgmt.sql.models.SecurityAlertsPolicyProperties": "Microsoft.Sql.SecurityAlertsPolicyProperties", + "azure.mgmt.sql.models.SecurityEvent": "Microsoft.Sql.SecurityEvent", + "azure.mgmt.sql.models.SecurityEventProperties": "Microsoft.Sql.SecurityEventProperties", + "azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties": "Microsoft.Sql.SecurityEventSqlInjectionAdditionalProperties", + "azure.mgmt.sql.models.SensitivityLabel": "Microsoft.Sql.SensitivityLabel", + "azure.mgmt.sql.models.SensitivityLabelProperties": "Microsoft.Sql.SensitivityLabelProperties", + "azure.mgmt.sql.models.SensitivityLabelUpdate": "Microsoft.Sql.SensitivityLabelUpdate", + "azure.mgmt.sql.models.SensitivityLabelUpdateList": "Microsoft.Sql.SensitivityLabelUpdateList", + "azure.mgmt.sql.models.SensitivityLabelUpdateProperties": "Microsoft.Sql.SensitivityLabelUpdateProperties", + "azure.mgmt.sql.models.Server": "Microsoft.Sql.Server", + "azure.mgmt.sql.models.ServerAdvancedThreatProtection": "Microsoft.Sql.ServerAdvancedThreatProtection", + "azure.mgmt.sql.models.ServerAutomaticTuning": "Microsoft.Sql.ServerAutomaticTuning", + "azure.mgmt.sql.models.ServerAzureADAdministrator": "Microsoft.Sql.ServerAzureADAdministrator", + "azure.mgmt.sql.models.ServerAzureADOnlyAuthentication": "Microsoft.Sql.ServerAzureADOnlyAuthentication", + "azure.mgmt.sql.models.ServerBlobAuditingPolicy": "Microsoft.Sql.ServerBlobAuditingPolicy", + "azure.mgmt.sql.models.ServerBlobAuditingPolicyProperties": "Microsoft.Sql.ServerBlobAuditingPolicyProperties", + "azure.mgmt.sql.models.ServerConfigurationOption": "Microsoft.Sql.ServerConfigurationOption", + "azure.mgmt.sql.models.ServerConfigurationOptionProperties": "Microsoft.Sql.ServerConfigurationOptionProperties", + "azure.mgmt.sql.models.ServerConnectionPolicy": "Microsoft.Sql.ServerConnectionPolicy", + "azure.mgmt.sql.models.ServerConnectionPolicyProperties": "Microsoft.Sql.ServerConnectionPolicyProperties", + "azure.mgmt.sql.models.ServerDevOpsAuditingSettings": "Microsoft.Sql.ServerDevOpsAuditingSettings", + "azure.mgmt.sql.models.ServerDevOpsAuditSettingsProperties": "Microsoft.Sql.ServerDevOpsAuditSettingsProperties", + "azure.mgmt.sql.models.ServerDnsAlias": "Microsoft.Sql.ServerDnsAlias", + "azure.mgmt.sql.models.ServerDnsAliasAcquisition": "Microsoft.Sql.ServerDnsAliasAcquisition", + "azure.mgmt.sql.models.ServerDnsAliasProperties": "Microsoft.Sql.ServerDnsAliasProperties", + "azure.mgmt.sql.models.ServerExternalAdministrator": "Microsoft.Sql.ServerExternalAdministrator", + "azure.mgmt.sql.models.ServerFirewallRuleProperties": "Microsoft.Sql.ServerFirewallRuleProperties", + "azure.mgmt.sql.models.ServerInfo": "Microsoft.Sql.ServerInfo", + "azure.mgmt.sql.models.ServerKey": "Microsoft.Sql.ServerKey", + "azure.mgmt.sql.models.ServerKeyProperties": "Microsoft.Sql.ServerKeyProperties", + "azure.mgmt.sql.models.ServerOperation": "Microsoft.Sql.ServerOperation", + "azure.mgmt.sql.models.ServerOperationProperties": "Microsoft.Sql.ServerOperationProperties", + "azure.mgmt.sql.models.ServerPrivateEndpointConnection": "Microsoft.Sql.ServerPrivateEndpointConnection", + "azure.mgmt.sql.models.ServerProperties": "Microsoft.Sql.ServerProperties", + "azure.mgmt.sql.models.ServerSecurityAlertPolicy": "Microsoft.Sql.ServerSecurityAlertPolicy", + "azure.mgmt.sql.models.ServerTrustCertificate": "Microsoft.Sql.ServerTrustCertificate", + "azure.mgmt.sql.models.ServerTrustCertificateProperties": "Microsoft.Sql.ServerTrustCertificateProperties", + "azure.mgmt.sql.models.ServerTrustGroup": "Microsoft.Sql.ServerTrustGroup", + "azure.mgmt.sql.models.ServerTrustGroupProperties": "Microsoft.Sql.ServerTrustGroupProperties", + "azure.mgmt.sql.models.ServerUpdate": "Microsoft.Sql.ServerUpdate", + "azure.mgmt.sql.models.ServerUsage": "Microsoft.Sql.ServerUsage", + "azure.mgmt.sql.models.ServerUsageProperties": "Microsoft.Sql.ServerUsageProperties", + "azure.mgmt.sql.models.ServerVersionCapability": "Microsoft.Sql.ServerVersionCapability", + "azure.mgmt.sql.models.ServerVulnerabilityAssessment": "Microsoft.Sql.ServerVulnerabilityAssessment", + "azure.mgmt.sql.models.ServerVulnerabilityAssessmentProperties": "Microsoft.Sql.ServerVulnerabilityAssessmentProperties", + "azure.mgmt.sql.models.ServiceObjectiveCapability": "Microsoft.Sql.ServiceObjectiveCapability", + "azure.mgmt.sql.models.ServicePrincipal": "Microsoft.Sql.ServicePrincipal", + "azure.mgmt.sql.models.Sku": "Microsoft.Sql.Sku", + "azure.mgmt.sql.models.SqlAgentConfiguration": "Microsoft.Sql.SqlAgentConfiguration", + "azure.mgmt.sql.models.SqlAgentConfigurationProperties": "Microsoft.Sql.SqlAgentConfigurationProperties", + "azure.mgmt.sql.models.SqlVulnerabilityAssessment": "Microsoft.Sql.SqlVulnerabilityAssessment", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentPolicyProperties": "Microsoft.Sql.SqlVulnerabilityAssessmentPolicyProperties", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanError": "Microsoft.Sql.SqlVulnerabilityAssessmentScanError", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecord", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecordProperties": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecordProperties", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResultProperties": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResultProperties", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResults", + "azure.mgmt.sql.models.StartStopManagedInstanceSchedule": "Microsoft.Sql.StartStopManagedInstanceSchedule", + "azure.mgmt.sql.models.StartStopManagedInstanceScheduleProperties": "Microsoft.Sql.StartStopManagedInstanceScheduleProperties", + "azure.mgmt.sql.models.StorageCapability": "Microsoft.Sql.StorageCapability", + "azure.mgmt.sql.models.SubscriptionUsage": "Microsoft.Sql.SubscriptionUsage", + "azure.mgmt.sql.models.SubscriptionUsageProperties": "Microsoft.Sql.SubscriptionUsageProperties", + "azure.mgmt.sql.models.SynapseLinkWorkspace": "Microsoft.Sql.SynapseLinkWorkspace", + "azure.mgmt.sql.models.SynapseLinkWorkspaceInfoProperties": "Microsoft.Sql.SynapseLinkWorkspaceInfoProperties", + "azure.mgmt.sql.models.SynapseLinkWorkspaceProperties": "Microsoft.Sql.SynapseLinkWorkspaceProperties", + "azure.mgmt.sql.models.SyncAgent": "Microsoft.Sql.SyncAgent", + "azure.mgmt.sql.models.SyncAgentKeyProperties": "Microsoft.Sql.SyncAgentKeyProperties", + "azure.mgmt.sql.models.SyncAgentLinkedDatabase": "Microsoft.Sql.SyncAgentLinkedDatabase", + "azure.mgmt.sql.models.SyncAgentLinkedDatabaseProperties": "Microsoft.Sql.SyncAgentLinkedDatabaseProperties", + "azure.mgmt.sql.models.SyncAgentProperties": "Microsoft.Sql.SyncAgentProperties", + "azure.mgmt.sql.models.SyncDatabaseIdProperties": "Microsoft.Sql.SyncDatabaseIdProperties", + "azure.mgmt.sql.models.SyncFullSchemaProperties": "Microsoft.Sql.SyncFullSchemaProperties", + "azure.mgmt.sql.models.SyncFullSchemaTable": "Microsoft.Sql.SyncFullSchemaTable", + "azure.mgmt.sql.models.SyncFullSchemaTableColumn": "Microsoft.Sql.SyncFullSchemaTableColumn", + "azure.mgmt.sql.models.SyncGroup": "Microsoft.Sql.SyncGroup", + "azure.mgmt.sql.models.SyncGroupLogProperties": "Microsoft.Sql.SyncGroupLogProperties", + "azure.mgmt.sql.models.SyncGroupProperties": "Microsoft.Sql.SyncGroupProperties", + "azure.mgmt.sql.models.SyncGroupSchema": "Microsoft.Sql.SyncGroupSchema", + "azure.mgmt.sql.models.SyncGroupSchemaTable": "Microsoft.Sql.SyncGroupSchemaTable", + "azure.mgmt.sql.models.SyncGroupSchemaTableColumn": "Microsoft.Sql.SyncGroupSchemaTableColumn", + "azure.mgmt.sql.models.SyncMember": "Microsoft.Sql.SyncMember", + "azure.mgmt.sql.models.SyncMemberProperties": "Microsoft.Sql.SyncMemberProperties", + "azure.mgmt.sql.models.SystemData": "Microsoft.Sql.systemData", + "azure.mgmt.sql.models.TdeCertificate": "Microsoft.Sql.TdeCertificate", + "azure.mgmt.sql.models.TdeCertificateProperties": "Microsoft.Sql.TdeCertificateProperties", + "azure.mgmt.sql.models.TimeZone": "Microsoft.Sql.TimeZone", + "azure.mgmt.sql.models.TimeZoneProperties": "Microsoft.Sql.TimeZoneProperties", + "azure.mgmt.sql.models.TopQueries": "Microsoft.Sql.TopQueries", + "azure.mgmt.sql.models.TransparentDataEncryptionProperties": "Microsoft.Sql.TransparentDataEncryptionProperties", + "azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters": "Microsoft.Sql.UpdateLongTermRetentionBackupParameters", + "azure.mgmt.sql.models.UpdateLongTermRetentionBackupParametersProperties": "Microsoft.Sql.UpdateLongTermRetentionBackupParametersProperties", + "azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation": "Microsoft.Sql.UpdateVirtualClusterDnsServersOperation", + "azure.mgmt.sql.models.UpsertManagedServerOperationParameters": "Microsoft.Sql.UpsertManagedServerOperationParameters", + "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration": "Microsoft.Sql.UpsertManagedServerOperationStepWithEstimatesAndDuration", + "azure.mgmt.sql.models.Usage": "Microsoft.Sql.Usage", + "azure.mgmt.sql.models.UserIdentity": "Microsoft.Sql.UserIdentity", + "azure.mgmt.sql.models.VaRule": "Microsoft.Sql.VaRule", + "azure.mgmt.sql.models.VirtualCluster": "Microsoft.Sql.VirtualCluster", + "azure.mgmt.sql.models.VirtualClusterDnsServersProperties": "Microsoft.Sql.VirtualClusterDnsServersProperties", + "azure.mgmt.sql.models.VirtualClusterProperties": "Microsoft.Sql.VirtualClusterProperties", + "azure.mgmt.sql.models.VirtualClusterUpdate": "Microsoft.Sql.VirtualClusterUpdate", + "azure.mgmt.sql.models.VirtualNetworkRule": "Microsoft.Sql.VirtualNetworkRule", + "azure.mgmt.sql.models.VirtualNetworkRuleProperties": "Microsoft.Sql.VirtualNetworkRuleProperties", + "azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties": "Microsoft.Sql.VulnerabilityAssessmentRecurringScansProperties", + "azure.mgmt.sql.models.VulnerabilityAssessmentScanError": "Microsoft.Sql.VulnerabilityAssessmentScanError", + "azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord": "Microsoft.Sql.VulnerabilityAssessmentScanRecord", + "azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordProperties": "Microsoft.Sql.VulnerabilityAssessmentScanRecordProperties", + "azure.mgmt.sql.models.WorkloadClassifier": "Microsoft.Sql.WorkloadClassifier", + "azure.mgmt.sql.models.WorkloadClassifierProperties": "Microsoft.Sql.WorkloadClassifierProperties", + "azure.mgmt.sql.models.WorkloadGroup": "Microsoft.Sql.WorkloadGroup", + "azure.mgmt.sql.models.WorkloadGroupProperties": "Microsoft.Sql.WorkloadGroupProperties", + "azure.mgmt.sql.models.ZonePinningCapability": "Microsoft.Sql.ZonePinningCapability", + "azure.mgmt.sql.models.OperationOrigin": "Microsoft.Sql.OperationOrigin", + "azure.mgmt.sql.models.CreatedByType": "Microsoft.Sql.CreatedByType", + "azure.mgmt.sql.models.DiffBackupIntervalInHours": "Microsoft.Sql.DiffBackupIntervalInHours", + "azure.mgmt.sql.models.ShortTermRetentionPolicyName": "Microsoft.Sql.ShortTermRetentionPolicyName", + "azure.mgmt.sql.models.ColumnDataType": "Microsoft.Sql.ColumnDataType", + "azure.mgmt.sql.models.TableTemporalType": "Microsoft.Sql.TableTemporalType", + "azure.mgmt.sql.models.RestorePointType": "Microsoft.Sql.RestorePointType", + "azure.mgmt.sql.models.SensitivityLabelRank": "Microsoft.Sql.SensitivityLabelRank", + "azure.mgmt.sql.models.ClientClassificationSource": "Microsoft.Sql.ClientClassificationSource", + "azure.mgmt.sql.models.SensitivityLabelUpdateKind": "Microsoft.Sql.SensitivityLabelUpdateKind", + "azure.mgmt.sql.models.SensitivityLabelSource": "Microsoft.Sql.SensitivityLabelSource", + "azure.mgmt.sql.models.CurrentSensitivityLabelSource": "Microsoft.Sql.CurrentSensitivityLabelSource", + "azure.mgmt.sql.models.RecommendedSensitivityLabelSource": "Microsoft.Sql.RecommendedSensitivityLabelSource", + "azure.mgmt.sql.models.CreateMode": "Microsoft.Sql.CreateMode", + "azure.mgmt.sql.models.SampleName": "Microsoft.Sql.SampleName", + "azure.mgmt.sql.models.DatabaseStatus": "Microsoft.Sql.DatabaseStatus", + "azure.mgmt.sql.models.CatalogCollationType": "Microsoft.Sql.CatalogCollationType", + "azure.mgmt.sql.models.DatabaseLicenseType": "Microsoft.Sql.DatabaseLicenseType", + "azure.mgmt.sql.models.DatabaseReadScale": "Microsoft.Sql.DatabaseReadScale", + "azure.mgmt.sql.models.SecondaryType": "Microsoft.Sql.SecondaryType", + "azure.mgmt.sql.models.BackupStorageRedundancy": "Microsoft.Sql.BackupStorageRedundancy", + "azure.mgmt.sql.models.DatabaseKeyType": "Microsoft.Sql.DatabaseKeyType", + "azure.mgmt.sql.models.AlwaysEncryptedEnclaveType": "Microsoft.Sql.AlwaysEncryptedEnclaveType", + "azure.mgmt.sql.models.FreeLimitExhaustionBehavior": "Microsoft.Sql.FreeLimitExhaustionBehavior", + "azure.mgmt.sql.models.AvailabilityZoneType": "Microsoft.Sql.AvailabilityZoneType", + "azure.mgmt.sql.models.DatabaseIdentityType": "Microsoft.Sql.DatabaseIdentityType", + "azure.mgmt.sql.models.StorageKeyType": "Microsoft.Sql.StorageKeyType", + "azure.mgmt.sql.models.ReplicaType": "Microsoft.Sql.ReplicaType", + "azure.mgmt.sql.models.ReplicationRole": "Microsoft.Sql.ReplicationRole", + "azure.mgmt.sql.models.ReplicationState": "Microsoft.Sql.ReplicationState", + "azure.mgmt.sql.models.ReplicationLinkType": "Microsoft.Sql.ReplicationLinkType", + "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus": "Microsoft.Sql.PrivateLinkServiceConnectionStateStatus", + "azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire": "Microsoft.Sql.PrivateLinkServiceConnectionStateActionsRequire", + "azure.mgmt.sql.models.PrivateEndpointProvisioningState": "Microsoft.Sql.PrivateEndpointProvisioningState", + "azure.mgmt.sql.models.MinimalTlsVersion": "Microsoft.Sql.MinimalTlsVersion", + "azure.mgmt.sql.models.ServerPublicNetworkAccessFlag": "Microsoft.Sql.ServerPublicNetworkAccessFlag", + "azure.mgmt.sql.models.ServerWorkspaceFeature": "Microsoft.Sql.ServerWorkspaceFeature", + "azure.mgmt.sql.models.AdministratorType": "Microsoft.Sql.AdministratorType", + "azure.mgmt.sql.models.PrincipalType": "Microsoft.Sql.PrincipalType", + "azure.mgmt.sql.models.ServerNetworkAccessFlag": "Microsoft.Sql.ServerNetworkAccessFlag", + "azure.mgmt.sql.models.ExternalGovernanceStatus": "Microsoft.Sql.ExternalGovernanceStatus", + "azure.mgmt.sql.models.ServerCreateMode": "Microsoft.Sql.ServerCreateMode", + "azure.mgmt.sql.models.IdentityType": "Microsoft.Sql.IdentityType", + "azure.mgmt.sql.models.CheckNameAvailabilityReason": "Microsoft.Sql.CheckNameAvailabilityReason", + "azure.mgmt.sql.models.CheckNameAvailabilityResourceType": "Microsoft.Sql.CheckNameAvailabilityResourceType", + "azure.mgmt.sql.models.BlobAuditingPolicyState": "Microsoft.Sql.BlobAuditingPolicyState", + "azure.mgmt.sql.models.BlobAuditingPolicyName": "Microsoft.Sql.BlobAuditingPolicyName", + "azure.mgmt.sql.models.AdvisorStatus": "Microsoft.Sql.AdvisorStatus", + "azure.mgmt.sql.models.AutoExecuteStatus": "Microsoft.Sql.AutoExecuteStatus", + "azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom": "Microsoft.Sql.AutoExecuteStatusInheritedFrom", + "azure.mgmt.sql.models.RecommendedActionCurrentState": "Microsoft.Sql.RecommendedActionCurrentState", + "azure.mgmt.sql.models.RecommendedActionInitiatedBy": "Microsoft.Sql.RecommendedActionInitiatedBy", + "azure.mgmt.sql.models.ImplementationMethod": "Microsoft.Sql.ImplementationMethod", + "azure.mgmt.sql.models.IsRetryable": "Microsoft.Sql.IsRetryable", + "azure.mgmt.sql.models.SecurityAlertsPolicyState": "Microsoft.Sql.SecurityAlertsPolicyState", + "azure.mgmt.sql.models.SecurityAlertPolicyName": "Microsoft.Sql.SecurityAlertPolicyName", + "azure.mgmt.sql.models.VulnerabilityAssessmentName": "Microsoft.Sql.VulnerabilityAssessmentName", + "azure.mgmt.sql.models.BaselineName": "Microsoft.Sql.BaselineName", + "azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName": "Microsoft.Sql.VulnerabilityAssessmentSystemDatabaseName", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentState": "Microsoft.Sql.SqlVulnerabilityAssessmentState", + "azure.mgmt.sql.models.SqlVulnerabilityAssessmentName": "Microsoft.Sql.SqlVulnerabilityAssessmentName", + "azure.mgmt.sql.models.RuleStatus": "Microsoft.Sql.RuleStatus", + "azure.mgmt.sql.models.RuleSeverity": "Microsoft.Sql.RuleSeverity", + "azure.mgmt.sql.models.RuleType": "Microsoft.Sql.RuleType", + "azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType": "Microsoft.Sql.VulnerabilityAssessmentScanTriggerType", + "azure.mgmt.sql.models.VulnerabilityAssessmentScanState": "Microsoft.Sql.VulnerabilityAssessmentScanState", + "azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName": "Microsoft.Sql.VulnerabilityAssessmentPolicyBaselineName", + "azure.mgmt.sql.models.DataMaskingState": "Microsoft.Sql.DataMaskingState", + "azure.mgmt.sql.models.DataMaskingPolicyName": "Microsoft.Sql.DataMaskingPolicyName", + "azure.mgmt.sql.models.ReplicationModeType": "Microsoft.Sql.ReplicationModeType", + "azure.mgmt.sql.models.LinkRole": "Microsoft.Sql.LinkRole", + "azure.mgmt.sql.models.FailoverModeType": "Microsoft.Sql.FailoverModeType", + "azure.mgmt.sql.models.SeedingModeType": "Microsoft.Sql.SeedingModeType", + "azure.mgmt.sql.models.ReplicaSynchronizationHealth": "Microsoft.Sql.ReplicaSynchronizationHealth", + "azure.mgmt.sql.models.ReplicaConnectedState": "Microsoft.Sql.ReplicaConnectedState", + "azure.mgmt.sql.models.FailoverType": "Microsoft.Sql.FailoverType", + "azure.mgmt.sql.models.InstanceRole": "Microsoft.Sql.InstanceRole", + "azure.mgmt.sql.models.RoleChangeType": "Microsoft.Sql.RoleChangeType", + "azure.mgmt.sql.models.ManagedDatabaseStatus": "Microsoft.Sql.ManagedDatabaseStatus", + "azure.mgmt.sql.models.ManagedDatabaseCreateMode": "Microsoft.Sql.ManagedDatabaseCreateMode", + "azure.mgmt.sql.models.InaccessibilityReason": "Microsoft.Sql.InaccessibilityReason", + "azure.mgmt.sql.models.MoveOperationMode": "Microsoft.Sql.MoveOperationMode", + "azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem": "Microsoft.Sql.ServerTrustGroupPropertiesTrustScopesItem", + "azure.mgmt.sql.models.ProvisioningState": "Microsoft.Sql.ProvisioningState", + "azure.mgmt.sql.models.ManagedServerCreateMode": "Microsoft.Sql.ManagedServerCreateMode", + "azure.mgmt.sql.models.ManagedInstanceLicenseType": "Microsoft.Sql.ManagedInstanceLicenseType", + "azure.mgmt.sql.models.HybridSecondaryUsage": "Microsoft.Sql.HybridSecondaryUsage", + "azure.mgmt.sql.models.HybridSecondaryUsageDetected": "Microsoft.Sql.HybridSecondaryUsageDetected", + "azure.mgmt.sql.models.ManagedInstanceProxyOverride": "Microsoft.Sql.ManagedInstanceProxyOverride", + "azure.mgmt.sql.models.ServicePrincipalType": "Microsoft.Sql.ServicePrincipalType", + "azure.mgmt.sql.models.PricingModel": "Microsoft.Sql.PricingModel", + "azure.mgmt.sql.models.AuthMetadataLookupModes": "Microsoft.Sql.AuthMetadataLookupModes", + "azure.mgmt.sql.models.ManagedInstanceDatabaseFormat": "Microsoft.Sql.ManagedInstanceDatabaseFormat", + "azure.mgmt.sql.models.QueryTimeGrainType": "Microsoft.Sql.QueryTimeGrainType", + "azure.mgmt.sql.models.QueryMetricUnitType": "Microsoft.Sql.QueryMetricUnitType", + "azure.mgmt.sql.models.AggregationFunctionType": "Microsoft.Sql.AggregationFunctionType", + "azure.mgmt.sql.models.MetricType": "Microsoft.Sql.MetricType", + "azure.mgmt.sql.models.ElasticPoolState": "Microsoft.Sql.ElasticPoolState", + "azure.mgmt.sql.models.ElasticPoolLicenseType": "Microsoft.Sql.ElasticPoolLicenseType", + "azure.mgmt.sql.models.ServerKeyType": "Microsoft.Sql.ServerKeyType", + "azure.mgmt.sql.models.EncryptionProtectorName": "Microsoft.Sql.EncryptionProtectorName", + "azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy": "Microsoft.Sql.ReadWriteEndpointFailoverPolicy", + "azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy": "Microsoft.Sql.ReadOnlyEndpointFailoverPolicy", + "azure.mgmt.sql.models.FailoverGroupReplicationRole": "Microsoft.Sql.FailoverGroupReplicationRole", + "azure.mgmt.sql.models.FailoverGroupDatabasesSecondaryType": "Microsoft.Sql.FailoverGroupDatabasesSecondaryType", + "azure.mgmt.sql.models.GeoBackupPolicyState": "Microsoft.Sql.GeoBackupPolicyState", + "azure.mgmt.sql.models.GeoBackupPolicyName": "Microsoft.Sql.GeoBackupPolicyName", + "azure.mgmt.sql.models.SecondaryInstanceType": "Microsoft.Sql.SecondaryInstanceType", + "azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole": "Microsoft.Sql.InstanceFailoverGroupReplicationRole", + "azure.mgmt.sql.models.ManagementOperationState": "Microsoft.Sql.ManagementOperationState", + "azure.mgmt.sql.models.ErrorType": "Microsoft.Sql.ErrorType", + "azure.mgmt.sql.models.InstancePoolLicenseType": "Microsoft.Sql.InstancePoolLicenseType", + "azure.mgmt.sql.models.JobExecutionLifecycle": "Microsoft.Sql.JobExecutionLifecycle", + "azure.mgmt.sql.models.JobTargetType": "Microsoft.Sql.JobTargetType", + "azure.mgmt.sql.models.JobAgentState": "Microsoft.Sql.JobAgentState", + "azure.mgmt.sql.models.JobAgentIdentityType": "Microsoft.Sql.JobAgentIdentityType", + "azure.mgmt.sql.models.JobScheduleType": "Microsoft.Sql.JobScheduleType", + "azure.mgmt.sql.models.JobStepActionType": "Microsoft.Sql.JobStepActionType", + "azure.mgmt.sql.models.JobStepActionSource": "Microsoft.Sql.JobStepActionSource", + "azure.mgmt.sql.models.JobStepOutputType": "Microsoft.Sql.JobStepOutputType", + "azure.mgmt.sql.models.JobTargetGroupMembershipType": "Microsoft.Sql.JobTargetGroupMembershipType", + "azure.mgmt.sql.models.TimeBasedImmutability": "Microsoft.Sql.TimeBasedImmutability", + "azure.mgmt.sql.models.TimeBasedImmutabilityMode": "Microsoft.Sql.TimeBasedImmutabilityMode", + "azure.mgmt.sql.models.SetLegalHoldImmutability": "Microsoft.Sql.SetLegalHoldImmutability", + "azure.mgmt.sql.models.BackupStorageAccessTier": "Microsoft.Sql.BackupStorageAccessTier", + "azure.mgmt.sql.models.DatabaseState": "Microsoft.Sql.DatabaseState", + "azure.mgmt.sql.models.LongTermRetentionPolicyName": "Microsoft.Sql.LongTermRetentionPolicyName", + "azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName": "Microsoft.Sql.ManagedShortTermRetentionPolicyName", + "azure.mgmt.sql.models.SecurityAlertPolicyState": "Microsoft.Sql.SecurityAlertPolicyState", + "azure.mgmt.sql.models.ManagedInstanceAdministratorType": "Microsoft.Sql.ManagedInstanceAdministratorType", + "azure.mgmt.sql.models.AdministratorName": "Microsoft.Sql.AdministratorName", + "azure.mgmt.sql.models.AuthenticationName": "Microsoft.Sql.AuthenticationName", + "azure.mgmt.sql.models.DtcName": "Microsoft.Sql.DtcName", + "azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicyName", + "azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": "Microsoft.Sql.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus", + "azure.mgmt.sql.models.ServerConfigurationOptionName": "Microsoft.Sql.ServerConfigurationOptionName", + "azure.mgmt.sql.models.ServerConnectionType": "Microsoft.Sql.ServerConnectionType", + "azure.mgmt.sql.models.ConnectionPolicyName": "Microsoft.Sql.ConnectionPolicyName", + "azure.mgmt.sql.models.DevOpsAuditingSettingsName": "Microsoft.Sql.DevOpsAuditingSettingsName", + "azure.mgmt.sql.models.DayOfWeek": "Microsoft.Sql.DayOfWeek", + "azure.mgmt.sql.models.StartStopScheduleName": "Microsoft.Sql.StartStopScheduleName", + "azure.mgmt.sql.models.SyncAgentState": "Microsoft.Sql.SyncAgentState", + "azure.mgmt.sql.models.SyncMemberDbType": "Microsoft.Sql.SyncMemberDbType", + "azure.mgmt.sql.models.SyncConflictResolutionPolicy": "Microsoft.Sql.SyncConflictResolutionPolicy", + "azure.mgmt.sql.models.SyncGroupState": "Microsoft.Sql.SyncGroupState", + "azure.mgmt.sql.models.DataSyncParticipantIdentityType": "Microsoft.Sql.DataSyncParticipantIdentityType", + "azure.mgmt.sql.models.SyncGroupLogType": "Microsoft.Sql.SyncGroupLogType", + "azure.mgmt.sql.models.SyncGroupsType": "Microsoft.Sql.SyncGroupsType", + "azure.mgmt.sql.models.SyncDirection": "Microsoft.Sql.SyncDirection", + "azure.mgmt.sql.models.SyncMemberState": "Microsoft.Sql.SyncMemberState", + "azure.mgmt.sql.models.DNSRefreshOperationStatus": "Microsoft.Sql.DNSRefreshOperationStatus", + "azure.mgmt.sql.models.VirtualNetworkRuleState": "Microsoft.Sql.VirtualNetworkRuleState", + "azure.mgmt.sql.models.Phase": "Microsoft.Sql.Phase", + "azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind": "Microsoft.Sql.RecommendedSensitivityLabelUpdateKind", + "azure.mgmt.sql.models.AdvancedThreatProtectionState": "Microsoft.Sql.AdvancedThreatProtectionState", + "azure.mgmt.sql.models.AdvancedThreatProtectionName": "Microsoft.Sql.AdvancedThreatProtectionName", + "azure.mgmt.sql.models.AutomaticTuningMode": "Microsoft.Sql.AutomaticTuningMode", + "azure.mgmt.sql.models.AutomaticTuningOptionModeDesired": "Microsoft.Sql.AutomaticTuningOptionModeDesired", + "azure.mgmt.sql.models.AutomaticTuningOptionModeActual": "Microsoft.Sql.AutomaticTuningOptionModeActual", + "azure.mgmt.sql.models.AutomaticTuningDisabledReason": "Microsoft.Sql.AutomaticTuningDisabledReason", + "azure.mgmt.sql.models.OperationMode": "Microsoft.Sql.OperationMode", + "azure.mgmt.sql.models.DataMaskingRuleState": "Microsoft.Sql.DataMaskingRuleState", + "azure.mgmt.sql.models.DataMaskingFunction": "Microsoft.Sql.DataMaskingFunction", + "azure.mgmt.sql.models.DataWarehouseUserActivityName": "Microsoft.Sql.DataWarehouseUserActivityName", + "azure.mgmt.sql.models.SecurityEventType": "Microsoft.Sql.SecurityEventType", + "azure.mgmt.sql.models.LedgerDigestUploadsState": "Microsoft.Sql.LedgerDigestUploadsState", + "azure.mgmt.sql.models.LedgerDigestUploadsName": "Microsoft.Sql.LedgerDigestUploadsName", + "azure.mgmt.sql.models.RestoreDetailsName": "Microsoft.Sql.RestoreDetailsName", + "azure.mgmt.sql.models.TransparentDataEncryptionState": "Microsoft.Sql.TransparentDataEncryptionState", + "azure.mgmt.sql.models.TransparentDataEncryptionName": "Microsoft.Sql.TransparentDataEncryptionName", + "azure.mgmt.sql.models.ManagedLedgerDigestUploadsState": "Microsoft.Sql.ManagedLedgerDigestUploadsState", + "azure.mgmt.sql.models.ManagedLedgerDigestUploadsName": "Microsoft.Sql.ManagedLedgerDigestUploadsName", + "azure.mgmt.sql.models.AutomaticTuningServerMode": "Microsoft.Sql.AutomaticTuningServerMode", + "azure.mgmt.sql.models.AutomaticTuningServerReason": "Microsoft.Sql.AutomaticTuningServerReason", + "azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState": "Microsoft.Sql.SqlAgentConfigurationPropertiesState", + "azure.mgmt.sql.models.TransparentDataEncryptionScanState": "Microsoft.Sql.TransparentDataEncryptionScanState", + "azure.mgmt.sql.models.MaxSizeUnit": "Microsoft.Sql.MaxSizeUnit", + "azure.mgmt.sql.models.LogSizeUnit": "Microsoft.Sql.LogSizeUnit", + "azure.mgmt.sql.models.CapabilityStatus": "Microsoft.Sql.CapabilityStatus", + "azure.mgmt.sql.models.PerformanceLevelUnit": "Microsoft.Sql.PerformanceLevelUnit", + "azure.mgmt.sql.models.PauseDelayTimeUnit": "Microsoft.Sql.PauseDelayTimeUnit", + "azure.mgmt.sql.models.StorageCapabilityStorageAccountType": "Microsoft.Sql.StorageCapabilityStorageAccountType", + "azure.mgmt.sql.models.CapabilityGroup": "Microsoft.Sql.CapabilityGroup", + "azure.mgmt.sql.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.sql.aio.operations.Operations.list": "Azure.ResourceManager.Legacy.Operations.list", + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.BackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.BackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.BackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.BackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.BackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.BackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.BackupShortTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.BackupShortTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.operations.DatabaseColumnsOperations.get": "Microsoft.Sql.DatabaseColumns.get", + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.get": "Microsoft.Sql.DatabaseColumns.get", + "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_table": "Microsoft.Sql.DatabaseColumns.listByTable", + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_table": "Microsoft.Sql.DatabaseColumns.listByTable", + "azure.mgmt.sql.operations.DatabaseColumnsOperations.list_by_database": "Microsoft.Sql.Databases.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseColumnsOperations.list_by_database": "Microsoft.Sql.Databases.listByDatabase", + "azure.mgmt.sql.operations.RestorePointsOperations.get": "Microsoft.Sql.RestorePoints.get", + "azure.mgmt.sql.aio.operations.RestorePointsOperations.get": "Microsoft.Sql.RestorePoints.get", + "azure.mgmt.sql.operations.RestorePointsOperations.delete": "Microsoft.Sql.RestorePoints.delete", + "azure.mgmt.sql.aio.operations.RestorePointsOperations.delete": "Microsoft.Sql.RestorePoints.delete", + "azure.mgmt.sql.operations.RestorePointsOperations.list_by_database": "Microsoft.Sql.RestorePoints.listByDatabase", + "azure.mgmt.sql.aio.operations.RestorePointsOperations.list_by_database": "Microsoft.Sql.RestorePoints.listByDatabase", + "azure.mgmt.sql.operations.RestorePointsOperations.begin_create": "Microsoft.Sql.Databases.create", + "azure.mgmt.sql.aio.operations.RestorePointsOperations.begin_create": "Microsoft.Sql.Databases.create", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_current_by_database": "Microsoft.Sql.Databases.listCurrentByDatabase", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_current_by_database": "Microsoft.Sql.Databases.listCurrentByDatabase", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.update": "Microsoft.Sql.Databases.sensitivityLabelsUpdate", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.update": "Microsoft.Sql.Databases.sensitivityLabelsUpdate", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_recommended_by_database": "Microsoft.Sql.Databases.listRecommendedByDatabase", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_recommended_by_database": "Microsoft.Sql.Databases.listRecommendedByDatabase", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.list_by_database": "Microsoft.Sql.Databases.sensitivityLabelsListByDatabase", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.list_by_database": "Microsoft.Sql.Databases.sensitivityLabelsListByDatabase", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.get": "Microsoft.Sql.SensitivityLabelOperationGroup.get", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.get": "Microsoft.Sql.SensitivityLabelOperationGroup.get", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.create_or_update": "Microsoft.Sql.SensitivityLabelOperationGroup.createOrUpdate", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.create_or_update": "Microsoft.Sql.SensitivityLabelOperationGroup.createOrUpdate", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.delete": "Microsoft.Sql.SensitivityLabelOperationGroup.delete", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.delete": "Microsoft.Sql.SensitivityLabelOperationGroup.delete", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.disable_recommendation": "Microsoft.Sql.SensitivityLabelOperationGroup.disableRecommendation", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.disable_recommendation": "Microsoft.Sql.SensitivityLabelOperationGroup.disableRecommendation", + "azure.mgmt.sql.operations.SensitivityLabelsOperations.enable_recommendation": "Microsoft.Sql.SensitivityLabelOperationGroup.enableRecommendation", + "azure.mgmt.sql.aio.operations.SensitivityLabelsOperations.enable_recommendation": "Microsoft.Sql.SensitivityLabelOperationGroup.enableRecommendation", + "azure.mgmt.sql.operations.DatabasesOperations.get": "Microsoft.Sql.Databases.get", + "azure.mgmt.sql.aio.operations.DatabasesOperations.get": "Microsoft.Sql.Databases.get", + "azure.mgmt.sql.operations.DatabasesOperations.begin_create_or_update": "Microsoft.Sql.Databases.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_create_or_update": "Microsoft.Sql.Databases.createOrUpdate", + "azure.mgmt.sql.operations.DatabasesOperations.begin_update": "Microsoft.Sql.Databases.update", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_update": "Microsoft.Sql.Databases.update", + "azure.mgmt.sql.operations.DatabasesOperations.begin_delete": "Microsoft.Sql.Databases.delete", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_delete": "Microsoft.Sql.Databases.delete", + "azure.mgmt.sql.operations.DatabasesOperations.list_by_server": "Microsoft.Sql.Databases.listByServer", + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_server": "Microsoft.Sql.Databases.listByServer", + "azure.mgmt.sql.operations.DatabasesOperations.begin_export": "Microsoft.Sql.Databases.export", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_export": "Microsoft.Sql.Databases.export", + "azure.mgmt.sql.operations.DatabasesOperations.begin_failover": "Microsoft.Sql.Databases.failover", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_failover": "Microsoft.Sql.Databases.failover", + "azure.mgmt.sql.operations.DatabasesOperations.begin_import_method": "Microsoft.Sql.Databases.importDatabase", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_import_method": "Microsoft.Sql.Databases.importDatabase", + "azure.mgmt.sql.operations.DatabasesOperations.rename": "Microsoft.Sql.Databases.rename", + "azure.mgmt.sql.aio.operations.DatabasesOperations.rename": "Microsoft.Sql.Databases.rename", + "azure.mgmt.sql.operations.DatabasesOperations.begin_pause": "Microsoft.Sql.Databases.pause", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_pause": "Microsoft.Sql.Databases.pause", + "azure.mgmt.sql.operations.DatabasesOperations.begin_resume": "Microsoft.Sql.Databases.resume", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_resume": "Microsoft.Sql.Databases.resume", + "azure.mgmt.sql.operations.DatabasesOperations.begin_upgrade_data_warehouse": "Microsoft.Sql.Databases.upgradeDataWarehouse", + "azure.mgmt.sql.aio.operations.DatabasesOperations.begin_upgrade_data_warehouse": "Microsoft.Sql.Databases.upgradeDataWarehouse", + "azure.mgmt.sql.operations.DatabasesOperations.list_inaccessible_by_server": "Microsoft.Sql.Servers.listInaccessibleByServer", + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_inaccessible_by_server": "Microsoft.Sql.Servers.listInaccessibleByServer", + "azure.mgmt.sql.operations.DatabasesOperations.list_by_elastic_pool": "Microsoft.Sql.ElasticPools.listByElasticPool", + "azure.mgmt.sql.aio.operations.DatabasesOperations.list_by_elastic_pool": "Microsoft.Sql.ElasticPools.listByElasticPool", + "azure.mgmt.sql.operations.FirewallRulesOperations.get": "Microsoft.Sql.FirewallRules.get", + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.get": "Microsoft.Sql.FirewallRules.get", + "azure.mgmt.sql.operations.FirewallRulesOperations.create_or_update": "Microsoft.Sql.FirewallRules.createOrUpdate", + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.create_or_update": "Microsoft.Sql.FirewallRules.createOrUpdate", + "azure.mgmt.sql.operations.FirewallRulesOperations.delete": "Microsoft.Sql.FirewallRules.delete", + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.delete": "Microsoft.Sql.FirewallRules.delete", + "azure.mgmt.sql.operations.FirewallRulesOperations.list_by_server": "Microsoft.Sql.FirewallRules.listByServer", + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.list_by_server": "Microsoft.Sql.FirewallRules.listByServer", + "azure.mgmt.sql.operations.FirewallRulesOperations.replace": "Microsoft.Sql.Servers.replace", + "azure.mgmt.sql.aio.operations.FirewallRulesOperations.replace": "Microsoft.Sql.Servers.replace", + "azure.mgmt.sql.operations.ReplicationLinksOperations.get": "Microsoft.Sql.ReplicationLinks.get", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.get": "Microsoft.Sql.ReplicationLinks.get", + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_create_or_update": "Microsoft.Sql.ReplicationLinks.createOrUpdate", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_create_or_update": "Microsoft.Sql.ReplicationLinks.createOrUpdate", + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_update": "Microsoft.Sql.ReplicationLinks.update", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_update": "Microsoft.Sql.ReplicationLinks.update", + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_delete": "Microsoft.Sql.ReplicationLinks.delete", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_delete": "Microsoft.Sql.ReplicationLinks.delete", + "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_database": "Microsoft.Sql.ReplicationLinks.listByDatabase", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_database": "Microsoft.Sql.ReplicationLinks.listByDatabase", + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover": "Microsoft.Sql.ReplicationLinks.failover", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover": "Microsoft.Sql.ReplicationLinks.failover", + "azure.mgmt.sql.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": "Microsoft.Sql.ReplicationLinks.failoverAllowDataLoss", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.begin_failover_allow_data_loss": "Microsoft.Sql.ReplicationLinks.failoverAllowDataLoss", + "azure.mgmt.sql.operations.ReplicationLinksOperations.list_by_server": "Microsoft.Sql.Servers.listByServer", + "azure.mgmt.sql.aio.operations.ReplicationLinksOperations.list_by_server": "Microsoft.Sql.Servers.listByServer", + "azure.mgmt.sql.operations.ServersOperations.get": "Microsoft.Sql.Servers.get", + "azure.mgmt.sql.aio.operations.ServersOperations.get": "Microsoft.Sql.Servers.get", + "azure.mgmt.sql.operations.ServersOperations.begin_create_or_update": "Microsoft.Sql.Servers.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServersOperations.begin_create_or_update": "Microsoft.Sql.Servers.createOrUpdate", + "azure.mgmt.sql.operations.ServersOperations.begin_update": "Microsoft.Sql.Servers.update", + "azure.mgmt.sql.aio.operations.ServersOperations.begin_update": "Microsoft.Sql.Servers.update", + "azure.mgmt.sql.operations.ServersOperations.begin_delete": "Microsoft.Sql.Servers.delete", + "azure.mgmt.sql.aio.operations.ServersOperations.begin_delete": "Microsoft.Sql.Servers.delete", + "azure.mgmt.sql.operations.ServersOperations.list_by_resource_group": "Microsoft.Sql.Servers.listByResourceGroup", + "azure.mgmt.sql.aio.operations.ServersOperations.list_by_resource_group": "Microsoft.Sql.Servers.listByResourceGroup", + "azure.mgmt.sql.operations.ServersOperations.list": "Microsoft.Sql.Servers.list", + "azure.mgmt.sql.aio.operations.ServersOperations.list": "Microsoft.Sql.Servers.list", + "azure.mgmt.sql.operations.ServersOperations.begin_import_database": "Microsoft.Sql.Servers.importDatabase", + "azure.mgmt.sql.aio.operations.ServersOperations.begin_import_database": "Microsoft.Sql.Servers.importDatabase", + "azure.mgmt.sql.operations.ServersOperations.begin_refresh_status": "Microsoft.Sql.Servers.refreshStatus", + "azure.mgmt.sql.aio.operations.ServersOperations.begin_refresh_status": "Microsoft.Sql.Servers.refreshStatus", + "azure.mgmt.sql.operations.ServersOperations.check_name_availability": "Microsoft.Sql.ServersOperationGroup.checkNameAvailability", + "azure.mgmt.sql.aio.operations.ServersOperations.check_name_availability": "Microsoft.Sql.ServersOperationGroup.checkNameAvailability", + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ServerBlobAuditingPolicies.get", + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ServerBlobAuditingPolicies.get", + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations.list_by_server": "Microsoft.Sql.ServerBlobAuditingPolicies.listByServer", + "azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations.list_by_server": "Microsoft.Sql.ServerBlobAuditingPolicies.listByServer", + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.get": "Microsoft.Sql.DatabaseBlobAuditingPolicies.get", + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.get": "Microsoft.Sql.DatabaseBlobAuditingPolicies.get", + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": "Microsoft.Sql.DatabaseBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.create_or_update": "Microsoft.Sql.DatabaseBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": "Microsoft.Sql.DatabaseBlobAuditingPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseBlobAuditingPoliciesOperations.list_by_database": "Microsoft.Sql.DatabaseBlobAuditingPolicies.listByDatabase", + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.get", + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.get", + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.create_or_update": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.ExtendedDatabaseBlobAuditingPoliciesOperations.list_by_database": "Microsoft.Sql.ExtendedDatabaseBlobAuditingPolicies.listByDatabase", + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.get", + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.get": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.get", + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.listByServer", + "azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations.list_by_server": "Microsoft.Sql.ExtendedServerBlobAuditingPolicies.listByServer", + "azure.mgmt.sql.operations.ServerAdvisorsOperations.get": "Microsoft.Sql.ServerAdvisors.get", + "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.get": "Microsoft.Sql.ServerAdvisors.get", + "azure.mgmt.sql.operations.ServerAdvisorsOperations.update": "Microsoft.Sql.ServerAdvisors.update", + "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.update": "Microsoft.Sql.ServerAdvisors.update", + "azure.mgmt.sql.operations.ServerAdvisorsOperations.list_by_server": "Microsoft.Sql.ServerAdvisors.listByServer", + "azure.mgmt.sql.aio.operations.ServerAdvisorsOperations.list_by_server": "Microsoft.Sql.ServerAdvisors.listByServer", + "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.get": "Microsoft.Sql.ManagedDatabaseColumns.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.get": "Microsoft.Sql.ManagedDatabaseColumns.get", + "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_table": "Microsoft.Sql.ManagedDatabaseColumns.listByTable", + "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_table": "Microsoft.Sql.ManagedDatabaseColumns.listByTable", + "azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.listByDatabase", + "azure.mgmt.sql.operations.DatabaseTablesOperations.get": "Microsoft.Sql.DatabaseTables.get", + "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.get": "Microsoft.Sql.DatabaseTables.get", + "azure.mgmt.sql.operations.DatabaseTablesOperations.list_by_schema": "Microsoft.Sql.DatabaseTables.listBySchema", + "azure.mgmt.sql.aio.operations.DatabaseTablesOperations.list_by_schema": "Microsoft.Sql.DatabaseTables.listBySchema", + "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.get": "Microsoft.Sql.ManagedDatabaseTables.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.get": "Microsoft.Sql.ManagedDatabaseTables.get", + "azure.mgmt.sql.operations.ManagedDatabaseTablesOperations.list_by_schema": "Microsoft.Sql.ManagedDatabaseTables.listBySchema", + "azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations.list_by_schema": "Microsoft.Sql.ManagedDatabaseTables.listBySchema", + "azure.mgmt.sql.operations.DatabaseSchemasOperations.get": "Microsoft.Sql.DatabaseSchemas.get", + "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.get": "Microsoft.Sql.DatabaseSchemas.get", + "azure.mgmt.sql.operations.DatabaseSchemasOperations.list_by_database": "Microsoft.Sql.DatabaseSchemas.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseSchemasOperations.list_by_database": "Microsoft.Sql.DatabaseSchemas.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.get": "Microsoft.Sql.ManagedDatabaseSchemas.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.get": "Microsoft.Sql.ManagedDatabaseSchemas.get", + "azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseSchemas.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseSchemas.listByDatabase", + "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.get": "Microsoft.Sql.DatabaseSecurityAlertPolicies.get", + "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.get": "Microsoft.Sql.DatabaseSecurityAlertPolicies.get", + "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": "Microsoft.Sql.DatabaseSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.create_or_update": "Microsoft.Sql.DatabaseSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": "Microsoft.Sql.DatabaseSecurityAlertPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations.list_by_database": "Microsoft.Sql.DatabaseSecurityAlertPolicies.listByDatabase", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.get", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.get", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.listBySqlVulnerabilityAssessment", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations.list_by_sql_vulnerability_assessment": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.listBySqlVulnerabilityAssessment", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.delete", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.delete", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.get", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.get", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.createOrUpdate", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.createOrUpdate", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.listByServer", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations.list_by_server": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.listByServer", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.listByBaseline", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations.list_by_baseline": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentRuleBaselines.listByBaseline", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.get", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.get", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.createOrUpdate", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.createOrUpdate", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.listByBaseline", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations.list_by_baseline": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.listByBaseline", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentScanResult.get", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentScanResult.get", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentScanResult.listByScan", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations.list_by_scan": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentScanResult.listByScan", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResult.get", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResult.get", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResult.listByScan", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations.list_by_scan": "Microsoft.Sql.SqlVulnerabilityAssessmentScanResult.listByScan", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScans.get", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScans.get", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": "Microsoft.Sql.SqlVulnerabilityAssessmentScans.listBySqlVulnerabilityAssessments", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": "Microsoft.Sql.SqlVulnerabilityAssessmentScans.listBySqlVulnerabilityAssessments", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.DatabaseVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.get", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentRuleBaselines.delete", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.DatabaseVulnerabilityAssessments.get", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.DatabaseVulnerabilityAssessments.get", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.DatabaseVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.DatabaseVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.DatabaseVulnerabilityAssessments.delete", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.DatabaseVulnerabilityAssessments.delete", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": "Microsoft.Sql.DatabaseVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations.list_by_database": "Microsoft.Sql.DatabaseVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.get", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.delete", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.delete", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.get", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.export", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.export": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.export", + "azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.initiateScan", + "azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": "Microsoft.Sql.ManagedDatabaseVulnerabilityAssessmentScans.initiateScan", + "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.get": "Microsoft.Sql.DataMaskingPolicies.get", + "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.get": "Microsoft.Sql.DataMaskingPolicies.get", + "azure.mgmt.sql.operations.DataMaskingPoliciesOperations.create_or_update": "Microsoft.Sql.DataMaskingPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations.create_or_update": "Microsoft.Sql.DataMaskingPolicies.createOrUpdate", + "azure.mgmt.sql.operations.DeletedServersOperations.get": "Microsoft.Sql.DeletedServers.get", + "azure.mgmt.sql.aio.operations.DeletedServersOperations.get": "Microsoft.Sql.DeletedServers.get", + "azure.mgmt.sql.operations.DeletedServersOperations.list_by_location": "Microsoft.Sql.DeletedServers.listByLocation", + "azure.mgmt.sql.aio.operations.DeletedServersOperations.list_by_location": "Microsoft.Sql.DeletedServers.listByLocation", + "azure.mgmt.sql.operations.DeletedServersOperations.begin_recover": "Microsoft.Sql.DeletedServers.recover", + "azure.mgmt.sql.aio.operations.DeletedServersOperations.begin_recover": "Microsoft.Sql.DeletedServers.recover", + "azure.mgmt.sql.operations.DeletedServersOperations.list": "Microsoft.Sql.DeletedServersOperationGroup.list", + "azure.mgmt.sql.aio.operations.DeletedServersOperations.list": "Microsoft.Sql.DeletedServersOperationGroup.list", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.get": "Microsoft.Sql.DistributedAvailabilityGroups.get", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.get": "Microsoft.Sql.DistributedAvailabilityGroups.get", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": "Microsoft.Sql.DistributedAvailabilityGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_create_or_update": "Microsoft.Sql.DistributedAvailabilityGroups.createOrUpdate", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_update": "Microsoft.Sql.DistributedAvailabilityGroups.update", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_update": "Microsoft.Sql.DistributedAvailabilityGroups.update", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_delete": "Microsoft.Sql.DistributedAvailabilityGroups.delete", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_delete": "Microsoft.Sql.DistributedAvailabilityGroups.delete", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.list_by_instance": "Microsoft.Sql.DistributedAvailabilityGroups.listByInstance", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.list_by_instance": "Microsoft.Sql.DistributedAvailabilityGroups.listByInstance", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_failover": "Microsoft.Sql.DistributedAvailabilityGroups.failover", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_failover": "Microsoft.Sql.DistributedAvailabilityGroups.failover", + "azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations.begin_set_role": "Microsoft.Sql.DistributedAvailabilityGroups.setRole", + "azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations.begin_set_role": "Microsoft.Sql.DistributedAvailabilityGroups.setRole", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.get": "Microsoft.Sql.ManagedDatabases.get", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.get": "Microsoft.Sql.ManagedDatabases.get", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_create_or_update": "Microsoft.Sql.ManagedDatabases.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_create_or_update": "Microsoft.Sql.ManagedDatabases.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_update": "Microsoft.Sql.ManagedDatabases.update", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_update": "Microsoft.Sql.ManagedDatabases.update", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_delete": "Microsoft.Sql.ManagedDatabases.delete", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_delete": "Microsoft.Sql.ManagedDatabases.delete", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.ManagedDatabases.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.ManagedDatabases.listByInstance", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_cancel_move": "Microsoft.Sql.ManagedDatabases.cancelMove", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_cancel_move": "Microsoft.Sql.ManagedDatabases.cancelMove", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_move": "Microsoft.Sql.ManagedDatabases.completeMove", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_move": "Microsoft.Sql.ManagedDatabases.completeMove", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_complete_restore": "Microsoft.Sql.ManagedDatabases.completeRestore", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_complete_restore": "Microsoft.Sql.ManagedDatabases.completeRestore", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": "Microsoft.Sql.ManagedDatabases.reevaluateInaccessibleDatabaseState", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_reevaluate_inaccessible_database_state": "Microsoft.Sql.ManagedDatabases.reevaluateInaccessibleDatabaseState", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.begin_start_move": "Microsoft.Sql.ManagedDatabases.startMove", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.begin_start_move": "Microsoft.Sql.ManagedDatabases.startMove", + "azure.mgmt.sql.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": "Microsoft.Sql.ManagedInstances.listInaccessibleByInstance", + "azure.mgmt.sql.aio.operations.ManagedDatabasesOperations.list_inaccessible_by_instance": "Microsoft.Sql.ManagedInstances.listInaccessibleByInstance", + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.get": "Microsoft.Sql.ServerTrustGroups.get", + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.get": "Microsoft.Sql.ServerTrustGroups.get", + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_create_or_update": "Microsoft.Sql.ServerTrustGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_create_or_update": "Microsoft.Sql.ServerTrustGroups.createOrUpdate", + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.begin_delete": "Microsoft.Sql.ServerTrustGroups.delete", + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.begin_delete": "Microsoft.Sql.ServerTrustGroups.delete", + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_location": "Microsoft.Sql.ServerTrustGroups.listByLocation", + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_location": "Microsoft.Sql.ServerTrustGroups.listByLocation", + "azure.mgmt.sql.operations.ServerTrustGroupsOperations.list_by_instance": "Microsoft.Sql.ManagedInstances.listByInstance", + "azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations.list_by_instance": "Microsoft.Sql.ManagedInstances.listByInstance", + "azure.mgmt.sql.operations.ManagedInstancesOperations.get": "Microsoft.Sql.ManagedInstances.get", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.get": "Microsoft.Sql.ManagedInstances.get", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstances.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstances.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_update": "Microsoft.Sql.ManagedInstances.update", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_update": "Microsoft.Sql.ManagedInstances.update", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_delete": "Microsoft.Sql.ManagedInstances.delete", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_delete": "Microsoft.Sql.ManagedInstances.delete", + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_resource_group": "Microsoft.Sql.ManagedInstances.listByResourceGroup", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_resource_group": "Microsoft.Sql.ManagedInstances.listByResourceGroup", + "azure.mgmt.sql.operations.ManagedInstancesOperations.list": "Microsoft.Sql.ManagedInstances.list", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list": "Microsoft.Sql.ManagedInstances.list", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_failover": "Microsoft.Sql.ManagedInstances.failover", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_failover": "Microsoft.Sql.ManagedInstances.failover", + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": "Microsoft.Sql.ManagedInstances.listOutboundNetworkDependenciesByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_outbound_network_dependencies_by_managed_instance": "Microsoft.Sql.ManagedInstances.listOutboundNetworkDependenciesByManagedInstance", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": "Microsoft.Sql.ManagedInstances.reevaluateInaccessibleDatabaseState", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_reevaluate_inaccessible_database_state": "Microsoft.Sql.ManagedInstances.reevaluateInaccessibleDatabaseState", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_refresh_status": "Microsoft.Sql.ManagedInstances.refreshStatus", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_refresh_status": "Microsoft.Sql.ManagedInstances.refreshStatus", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_start": "Microsoft.Sql.ManagedInstances.start", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_start": "Microsoft.Sql.ManagedInstances.start", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_stop": "Microsoft.Sql.ManagedInstances.stop", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_stop": "Microsoft.Sql.ManagedInstances.stop", + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstances.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstances.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": "Microsoft.Sql.ManagedInstances.validateAzureKeyVaultEncryptionKey", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.begin_validate_azure_key_vault_encryption_key": "Microsoft.Sql.ManagedInstances.validateAzureKeyVaultEncryptionKey", + "azure.mgmt.sql.operations.ManagedInstancesOperations.list_by_instance_pool": "Microsoft.Sql.InstancePools.listByInstancePool", + "azure.mgmt.sql.aio.operations.ManagedInstancesOperations.list_by_instance_pool": "Microsoft.Sql.InstancePools.listByInstancePool", + "azure.mgmt.sql.operations.ElasticPoolsOperations.get": "Microsoft.Sql.ElasticPools.get", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.get": "Microsoft.Sql.ElasticPools.get", + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_create_or_update": "Microsoft.Sql.ElasticPools.createOrUpdate", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_create_or_update": "Microsoft.Sql.ElasticPools.createOrUpdate", + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_update": "Microsoft.Sql.ElasticPools.update", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_update": "Microsoft.Sql.ElasticPools.update", + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_delete": "Microsoft.Sql.ElasticPools.delete", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_delete": "Microsoft.Sql.ElasticPools.delete", + "azure.mgmt.sql.operations.ElasticPoolsOperations.list_by_server": "Microsoft.Sql.ElasticPools.listByServer", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.list_by_server": "Microsoft.Sql.ElasticPools.listByServer", + "azure.mgmt.sql.operations.ElasticPoolsOperations.begin_failover": "Microsoft.Sql.ElasticPools.failover", + "azure.mgmt.sql.aio.operations.ElasticPoolsOperations.begin_failover": "Microsoft.Sql.ElasticPools.failover", + "azure.mgmt.sql.operations.EncryptionProtectorsOperations.get": "Microsoft.Sql.EncryptionProtectors.get", + "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.get": "Microsoft.Sql.EncryptionProtectors.get", + "azure.mgmt.sql.operations.EncryptionProtectorsOperations.begin_create_or_update": "Microsoft.Sql.EncryptionProtectors.createOrUpdate", + "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_create_or_update": "Microsoft.Sql.EncryptionProtectors.createOrUpdate", + "azure.mgmt.sql.operations.EncryptionProtectorsOperations.list_by_server": "Microsoft.Sql.EncryptionProtectors.listByServer", + "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.list_by_server": "Microsoft.Sql.EncryptionProtectors.listByServer", + "azure.mgmt.sql.operations.EncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.EncryptionProtectors.revalidate", + "azure.mgmt.sql.aio.operations.EncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.EncryptionProtectors.revalidate", + "azure.mgmt.sql.operations.EndpointCertificatesOperations.get": "Microsoft.Sql.EndpointCertificates.get", + "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.get": "Microsoft.Sql.EndpointCertificates.get", + "azure.mgmt.sql.operations.EndpointCertificatesOperations.list_by_instance": "Microsoft.Sql.EndpointCertificates.listByInstance", + "azure.mgmt.sql.aio.operations.EndpointCertificatesOperations.list_by_instance": "Microsoft.Sql.EndpointCertificates.listByInstance", + "azure.mgmt.sql.operations.FailoverGroupsOperations.get": "Microsoft.Sql.FailoverGroups.get", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.get": "Microsoft.Sql.FailoverGroups.get", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_create_or_update": "Microsoft.Sql.FailoverGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_create_or_update": "Microsoft.Sql.FailoverGroups.createOrUpdate", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_update": "Microsoft.Sql.FailoverGroups.update", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_update": "Microsoft.Sql.FailoverGroups.update", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_delete": "Microsoft.Sql.FailoverGroups.delete", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_delete": "Microsoft.Sql.FailoverGroups.delete", + "azure.mgmt.sql.operations.FailoverGroupsOperations.list_by_server": "Microsoft.Sql.FailoverGroups.listByServer", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.list_by_server": "Microsoft.Sql.FailoverGroups.listByServer", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_failover": "Microsoft.Sql.FailoverGroups.failover", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_failover": "Microsoft.Sql.FailoverGroups.failover", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": "Microsoft.Sql.FailoverGroups.forceFailoverAllowDataLoss", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_force_failover_allow_data_loss": "Microsoft.Sql.FailoverGroups.forceFailoverAllowDataLoss", + "azure.mgmt.sql.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": "Microsoft.Sql.FailoverGroups.tryPlannedBeforeForcedFailover", + "azure.mgmt.sql.aio.operations.FailoverGroupsOperations.begin_try_planned_before_forced_failover": "Microsoft.Sql.FailoverGroups.tryPlannedBeforeForcedFailover", + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.get": "Microsoft.Sql.GeoBackupPolicies.get", + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.get": "Microsoft.Sql.GeoBackupPolicies.get", + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.create_or_update": "Microsoft.Sql.GeoBackupPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.create_or_update": "Microsoft.Sql.GeoBackupPolicies.createOrUpdate", + "azure.mgmt.sql.operations.GeoBackupPoliciesOperations.list": "Microsoft.Sql.GeoBackupPolicies.list", + "azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations.list": "Microsoft.Sql.GeoBackupPolicies.list", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.get": "Microsoft.Sql.InstanceFailoverGroups.get", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.get": "Microsoft.Sql.InstanceFailoverGroups.get", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_create_or_update": "Microsoft.Sql.InstanceFailoverGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_create_or_update": "Microsoft.Sql.InstanceFailoverGroups.createOrUpdate", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_delete": "Microsoft.Sql.InstanceFailoverGroups.delete", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_delete": "Microsoft.Sql.InstanceFailoverGroups.delete", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.list_by_location": "Microsoft.Sql.InstanceFailoverGroups.listByLocation", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.list_by_location": "Microsoft.Sql.InstanceFailoverGroups.listByLocation", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_failover": "Microsoft.Sql.InstanceFailoverGroups.failover", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_failover": "Microsoft.Sql.InstanceFailoverGroups.failover", + "azure.mgmt.sql.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": "Microsoft.Sql.InstanceFailoverGroups.forceFailoverAllowDataLoss", + "azure.mgmt.sql.aio.operations.InstanceFailoverGroupsOperations.begin_force_failover_allow_data_loss": "Microsoft.Sql.InstanceFailoverGroups.forceFailoverAllowDataLoss", + "azure.mgmt.sql.operations.InstancePoolOperationsOperations.get": "Microsoft.Sql.InstancePoolOperations.get", + "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.get": "Microsoft.Sql.InstancePoolOperations.get", + "azure.mgmt.sql.operations.InstancePoolOperationsOperations.list_by_instance_pool": "Microsoft.Sql.InstancePoolOperations.listByInstancePool", + "azure.mgmt.sql.aio.operations.InstancePoolOperationsOperations.list_by_instance_pool": "Microsoft.Sql.InstancePoolOperations.listByInstancePool", + "azure.mgmt.sql.operations.InstancePoolsOperations.get": "Microsoft.Sql.InstancePools.get", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.get": "Microsoft.Sql.InstancePools.get", + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_create_or_update": "Microsoft.Sql.InstancePools.createOrUpdate", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_create_or_update": "Microsoft.Sql.InstancePools.createOrUpdate", + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_update": "Microsoft.Sql.InstancePools.update", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_update": "Microsoft.Sql.InstancePools.update", + "azure.mgmt.sql.operations.InstancePoolsOperations.begin_delete": "Microsoft.Sql.InstancePools.delete", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.begin_delete": "Microsoft.Sql.InstancePools.delete", + "azure.mgmt.sql.operations.InstancePoolsOperations.list_by_resource_group": "Microsoft.Sql.InstancePools.listByResourceGroup", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list_by_resource_group": "Microsoft.Sql.InstancePools.listByResourceGroup", + "azure.mgmt.sql.operations.InstancePoolsOperations.list": "Microsoft.Sql.InstancePools.list", + "azure.mgmt.sql.aio.operations.InstancePoolsOperations.list": "Microsoft.Sql.InstancePools.list", + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.get": "Microsoft.Sql.IPv6FirewallRules.get", + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.get": "Microsoft.Sql.IPv6FirewallRules.get", + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.create_or_update": "Microsoft.Sql.IPv6FirewallRules.createOrUpdate", + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.create_or_update": "Microsoft.Sql.IPv6FirewallRules.createOrUpdate", + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.delete": "Microsoft.Sql.IPv6FirewallRules.delete", + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.delete": "Microsoft.Sql.IPv6FirewallRules.delete", + "azure.mgmt.sql.operations.IPv6FirewallRulesOperations.list_by_server": "Microsoft.Sql.IPv6FirewallRules.listByServer", + "azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations.list_by_server": "Microsoft.Sql.IPv6FirewallRules.listByServer", + "azure.mgmt.sql.operations.JobExecutionsOperations.get": "Microsoft.Sql.JobExecutions.get", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.get": "Microsoft.Sql.JobExecutions.get", + "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create_or_update": "Microsoft.Sql.JobExecutions.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create_or_update": "Microsoft.Sql.JobExecutions.createOrUpdate", + "azure.mgmt.sql.operations.JobExecutionsOperations.cancel": "Microsoft.Sql.JobExecutions.cancel", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.cancel": "Microsoft.Sql.JobExecutions.cancel", + "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_job": "Microsoft.Sql.JobExecutions.listByJob", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_job": "Microsoft.Sql.JobExecutions.listByJob", + "azure.mgmt.sql.operations.JobExecutionsOperations.list_by_agent": "Microsoft.Sql.JobAgents.listByAgent", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.list_by_agent": "Microsoft.Sql.JobAgents.listByAgent", + "azure.mgmt.sql.operations.JobExecutionsOperations.begin_create": "Microsoft.Sql.Jobs.create", + "azure.mgmt.sql.aio.operations.JobExecutionsOperations.begin_create": "Microsoft.Sql.Jobs.create", + "azure.mgmt.sql.operations.JobAgentsOperations.get": "Microsoft.Sql.JobAgents.get", + "azure.mgmt.sql.aio.operations.JobAgentsOperations.get": "Microsoft.Sql.JobAgents.get", + "azure.mgmt.sql.operations.JobAgentsOperations.begin_create_or_update": "Microsoft.Sql.JobAgents.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_create_or_update": "Microsoft.Sql.JobAgents.createOrUpdate", + "azure.mgmt.sql.operations.JobAgentsOperations.begin_update": "Microsoft.Sql.JobAgents.update", + "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_update": "Microsoft.Sql.JobAgents.update", + "azure.mgmt.sql.operations.JobAgentsOperations.begin_delete": "Microsoft.Sql.JobAgents.delete", + "azure.mgmt.sql.aio.operations.JobAgentsOperations.begin_delete": "Microsoft.Sql.JobAgents.delete", + "azure.mgmt.sql.operations.JobAgentsOperations.list_by_server": "Microsoft.Sql.JobAgents.listByServer", + "azure.mgmt.sql.aio.operations.JobAgentsOperations.list_by_server": "Microsoft.Sql.JobAgents.listByServer", + "azure.mgmt.sql.operations.JobCredentialsOperations.get": "Microsoft.Sql.JobCredentials.get", + "azure.mgmt.sql.aio.operations.JobCredentialsOperations.get": "Microsoft.Sql.JobCredentials.get", + "azure.mgmt.sql.operations.JobCredentialsOperations.create_or_update": "Microsoft.Sql.JobCredentials.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobCredentialsOperations.create_or_update": "Microsoft.Sql.JobCredentials.createOrUpdate", + "azure.mgmt.sql.operations.JobCredentialsOperations.delete": "Microsoft.Sql.JobCredentials.delete", + "azure.mgmt.sql.aio.operations.JobCredentialsOperations.delete": "Microsoft.Sql.JobCredentials.delete", + "azure.mgmt.sql.operations.JobCredentialsOperations.list_by_agent": "Microsoft.Sql.JobCredentials.listByAgent", + "azure.mgmt.sql.aio.operations.JobCredentialsOperations.list_by_agent": "Microsoft.Sql.JobCredentials.listByAgent", + "azure.mgmt.sql.operations.JobStepExecutionsOperations.get": "Microsoft.Sql.JobStepExecutions.get", + "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.get": "Microsoft.Sql.JobStepExecutions.get", + "azure.mgmt.sql.operations.JobStepExecutionsOperations.list_by_job_execution": "Microsoft.Sql.JobStepExecutions.ListByJobExecution", + "azure.mgmt.sql.aio.operations.JobStepExecutionsOperations.list_by_job_execution": "Microsoft.Sql.JobStepExecutions.ListByJobExecution", + "azure.mgmt.sql.operations.JobTargetExecutionsOperations.get": "Microsoft.Sql.JobTargetExecutions.get", + "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.get": "Microsoft.Sql.JobTargetExecutions.get", + "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_step": "Microsoft.Sql.JobTargetExecutions.ListByStep", + "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_step": "Microsoft.Sql.JobTargetExecutions.ListByStep", + "azure.mgmt.sql.operations.JobTargetExecutionsOperations.list_by_job_execution": "Microsoft.Sql.JobTargetExecutions.listByJobExecution", + "azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations.list_by_job_execution": "Microsoft.Sql.JobTargetExecutions.listByJobExecution", + "azure.mgmt.sql.operations.JobsOperations.get": "Microsoft.Sql.Jobs.get", + "azure.mgmt.sql.aio.operations.JobsOperations.get": "Microsoft.Sql.Jobs.get", + "azure.mgmt.sql.operations.JobsOperations.create_or_update": "Microsoft.Sql.Jobs.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobsOperations.create_or_update": "Microsoft.Sql.Jobs.createOrUpdate", + "azure.mgmt.sql.operations.JobsOperations.delete": "Microsoft.Sql.Jobs.delete", + "azure.mgmt.sql.aio.operations.JobsOperations.delete": "Microsoft.Sql.Jobs.delete", + "azure.mgmt.sql.operations.JobsOperations.list_by_agent": "Microsoft.Sql.Jobs.listByAgent", + "azure.mgmt.sql.aio.operations.JobsOperations.list_by_agent": "Microsoft.Sql.Jobs.listByAgent", + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.get": "Microsoft.Sql.JobPrivateEndpoints.get", + "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.get": "Microsoft.Sql.JobPrivateEndpoints.get", + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.begin_create_or_update": "Microsoft.Sql.JobPrivateEndpoints.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.begin_create_or_update": "Microsoft.Sql.JobPrivateEndpoints.createOrUpdate", + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.begin_delete": "Microsoft.Sql.JobPrivateEndpoints.delete", + "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.begin_delete": "Microsoft.Sql.JobPrivateEndpoints.delete", + "azure.mgmt.sql.operations.JobPrivateEndpointsOperations.list_by_agent": "Microsoft.Sql.JobPrivateEndpoints.listByAgent", + "azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations.list_by_agent": "Microsoft.Sql.JobPrivateEndpoints.listByAgent", + "azure.mgmt.sql.operations.JobStepsOperations.get": "Microsoft.Sql.JobSteps.get", + "azure.mgmt.sql.aio.operations.JobStepsOperations.get": "Microsoft.Sql.JobSteps.get", + "azure.mgmt.sql.operations.JobStepsOperations.create_or_update": "Microsoft.Sql.JobSteps.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobStepsOperations.create_or_update": "Microsoft.Sql.JobSteps.createOrUpdate", + "azure.mgmt.sql.operations.JobStepsOperations.delete": "Microsoft.Sql.JobSteps.delete", + "azure.mgmt.sql.aio.operations.JobStepsOperations.delete": "Microsoft.Sql.JobSteps.delete", + "azure.mgmt.sql.operations.JobStepsOperations.list_by_job": "Microsoft.Sql.JobSteps.listByJob", + "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_job": "Microsoft.Sql.JobSteps.listByJob", + "azure.mgmt.sql.operations.JobStepsOperations.get_by_version": "Microsoft.Sql.JobStepOperationGroup.getByVersion", + "azure.mgmt.sql.aio.operations.JobStepsOperations.get_by_version": "Microsoft.Sql.JobStepOperationGroup.getByVersion", + "azure.mgmt.sql.operations.JobStepsOperations.list_by_version": "Microsoft.Sql.JobStepOperationGroup.listByVersion", + "azure.mgmt.sql.aio.operations.JobStepsOperations.list_by_version": "Microsoft.Sql.JobStepOperationGroup.listByVersion", + "azure.mgmt.sql.operations.JobTargetGroupsOperations.get": "Microsoft.Sql.JobTargetGroups.get", + "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.get": "Microsoft.Sql.JobTargetGroups.get", + "azure.mgmt.sql.operations.JobTargetGroupsOperations.create_or_update": "Microsoft.Sql.JobTargetGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.create_or_update": "Microsoft.Sql.JobTargetGroups.createOrUpdate", + "azure.mgmt.sql.operations.JobTargetGroupsOperations.delete": "Microsoft.Sql.JobTargetGroups.delete", + "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.delete": "Microsoft.Sql.JobTargetGroups.delete", + "azure.mgmt.sql.operations.JobTargetGroupsOperations.list_by_agent": "Microsoft.Sql.JobTargetGroups.listByAgent", + "azure.mgmt.sql.aio.operations.JobTargetGroupsOperations.list_by_agent": "Microsoft.Sql.JobTargetGroups.listByAgent", + "azure.mgmt.sql.operations.JobVersionsOperations.get": "Microsoft.Sql.JobVersions.get", + "azure.mgmt.sql.aio.operations.JobVersionsOperations.get": "Microsoft.Sql.JobVersions.get", + "azure.mgmt.sql.operations.JobVersionsOperations.list_by_job": "Microsoft.Sql.JobVersions.listByJob", + "azure.mgmt.sql.aio.operations.JobVersionsOperations.list_by_job": "Microsoft.Sql.JobVersions.listByJob", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get": "Microsoft.Sql.LongTermRetentionBackups.get", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get": "Microsoft.Sql.LongTermRetentionBackups.get", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete": "Microsoft.Sql.LongTermRetentionBackups.delete", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete": "Microsoft.Sql.LongTermRetentionBackups.delete", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_database": "Microsoft.Sql.LongTermRetentionBackups.listByDatabase", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_database": "Microsoft.Sql.LongTermRetentionBackups.listByDatabase", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": "Microsoft.Sql.LongTermRetentionBackups.changeAccessTier", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier": "Microsoft.Sql.LongTermRetentionBackups.changeAccessTier", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy": "Microsoft.Sql.LongTermRetentionBackups.copy", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy": "Microsoft.Sql.LongTermRetentionBackups.copy", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": "Microsoft.Sql.LongTermRetentionBackups.lockTimeBasedImmutability", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability": "Microsoft.Sql.LongTermRetentionBackups.lockTimeBasedImmutability", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": "Microsoft.Sql.LongTermRetentionBackups.removeLegalHoldImmutability", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability": "Microsoft.Sql.LongTermRetentionBackups.removeLegalHoldImmutability", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": "Microsoft.Sql.LongTermRetentionBackups.removeTimeBasedImmutability", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability": "Microsoft.Sql.LongTermRetentionBackups.removeTimeBasedImmutability", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": "Microsoft.Sql.LongTermRetentionBackups.setLegalHoldImmutability", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability": "Microsoft.Sql.LongTermRetentionBackups.setLegalHoldImmutability", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update": "Microsoft.Sql.LongTermRetentionBackups.update", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update": "Microsoft.Sql.LongTermRetentionBackups.update", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.get_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.getByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.get_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.getByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.deleteByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_delete_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.deleteByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.listByResourceGroupDatabase", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_database": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.listByResourceGroupDatabase", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.changeAccessTierByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_change_access_tier_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.changeAccessTierByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.copyByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_copy_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.copyByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.lockTimeBasedImmutabilityByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_lock_time_based_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.lockTimeBasedImmutabilityByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.removeLegalHoldImmutabilityByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_legal_hold_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.removeLegalHoldImmutabilityByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.removeTimeBasedImmutabilityByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_remove_time_based_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.removeTimeBasedImmutabilityByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.setLegalHoldImmutabilityByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_set_legal_hold_immutability_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.setLegalHoldImmutabilityByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.updateByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.begin_update_by_resource_group": "Microsoft.Sql.LongTermRetentionBackupOperationGroup.updateByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_location": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByLocation", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_location": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByLocation", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_server": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByServer", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_server": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByServer", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByResourceGroupLocation", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_location": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByResourceGroupLocation", + "azure.mgmt.sql.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByResourceGroupServer", + "azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations.list_by_resource_group_server": "Microsoft.Sql.LongTermRetentionBackupsOperationGroup.listByResourceGroupServer", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.getByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get_by_resource_group": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.getByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.deleteByResourceGroup", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete_by_resource_group": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.deleteByResourceGroup", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.listByResourceGroupDatabase", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_database": "Microsoft.Sql.LongTermRetentionManagedInstanceBackups.listByResourceGroupDatabase", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.get": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.get", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.get": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.get", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.delete", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.delete", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.listByDatabase", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_database": "Microsoft.Sql.ManagedInstanceLongTermRetentionBackups.listByDatabase", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByLocation", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_location": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByLocation", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByInstance", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_instance": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByInstance", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupLocation", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_location": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupLocation", + "azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupInstance", + "azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations.list_by_resource_group_instance": "Microsoft.Sql.LongTermRetentionManagedInstanceBackupsOperationGroup.listByResourceGroupInstance", + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.get": "Microsoft.Sql.LongTermRetentionPolicies.get", + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.get": "Microsoft.Sql.LongTermRetentionPolicies.get", + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.LongTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.LongTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.LongTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.LongTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedBackupShortTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.get", + "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.begin_update": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.update", + "azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.listByRestorableDroppedDatabase", + "azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations.list_by_restorable_dropped_database": "Microsoft.Sql.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies.listByRestorableDroppedDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.get", + "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseSecurityAlertPolicies.listByDatabase", + "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.get": "Microsoft.Sql.ManagedInstanceAdministrators.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.get": "Microsoft.Sql.ManagedInstanceAdministrators.get", + "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAdministrators.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAdministrators.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceAdministrators.delete", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceAdministrators.delete", + "azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAdministrators.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAdministrators.listByInstance", + "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.get": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.get", + "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.delete", + "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.begin_delete": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.delete", + "azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAzureADOnlyAuthentications.listByInstance", + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.get": "Microsoft.Sql.ManagedInstanceDtcs.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.get": "Microsoft.Sql.ManagedInstanceDtcs.get", + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceDtcs.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceDtcs.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstanceDtcs.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceDtcsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstanceDtcs.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.get": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.get": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.get", + "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.listByInstance", + "azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.revalidate", + "azure.mgmt.sql.aio.operations.ManagedInstanceEncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.ManagedInstanceEncryptionProtectors.revalidate", + "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.get": "Microsoft.Sql.ManagedInstanceKeys.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.get": "Microsoft.Sql.ManagedInstanceKeys.get", + "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceKeys.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceKeys.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.begin_delete": "Microsoft.Sql.ManagedInstanceKeys.delete", + "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.begin_delete": "Microsoft.Sql.ManagedInstanceKeys.delete", + "azure.mgmt.sql.operations.ManagedInstanceKeysOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceKeys.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceKeysOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceKeys.listByInstance", + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.get": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.get", + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.delete", + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.begin_delete": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.delete", + "azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedInstanceLongTermRetentionPoliciesOperations.list_by_database": "Microsoft.Sql.ManagedInstanceLongTermRetentionPolicies.listByDatabase", + "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.get": "Microsoft.Sql.ManagedInstanceOperations.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.get": "Microsoft.Sql.ManagedInstanceOperations.get", + "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstanceOperations.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstanceOperations.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedInstanceOperationsOperations.cancel": "Microsoft.Sql.ManagedInstanceOperations.cancel", + "azure.mgmt.sql.aio.operations.ManagedInstanceOperationsOperations.cancel": "Microsoft.Sql.ManagedInstanceOperations.cancel", + "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.get", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.get": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.get", + "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.delete", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.begin_delete": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.delete", + "azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstancePrivateEndpointConnections.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.get", + "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.delete", + "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.delete", + "azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceVulnerabilityAssessments.listByInstance", + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.get": "Microsoft.Sql.ManagedServerDnsAliases.get", + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.get": "Microsoft.Sql.ManagedServerDnsAliases.get", + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": "Microsoft.Sql.ManagedServerDnsAliases.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_create_or_update": "Microsoft.Sql.ManagedServerDnsAliases.createOrUpdate", + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_delete": "Microsoft.Sql.ManagedServerDnsAliases.delete", + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_delete": "Microsoft.Sql.ManagedServerDnsAliases.delete", + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedServerDnsAliases.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedServerDnsAliases.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations.begin_acquire": "Microsoft.Sql.ManagedServerDnsAliases.acquire", + "azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations.begin_acquire": "Microsoft.Sql.ManagedServerDnsAliases.acquire", + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.get", + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.get", + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedServerSecurityAlertPoliciesOperations.list_by_instance": "Microsoft.Sql.ManagedServerSecurityAlertPolicies.listByInstance", + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.get": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.get", + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.get": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.get", + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.listByServer", + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.list_by_server": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.listByServer", + "azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.reconcile", + "azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations.begin_reconcile": "Microsoft.Sql.NetworkSecurityPerimeterConfigurations.reconcile", + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.get": "Microsoft.Sql.OutboundFirewallRules.get", + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.get": "Microsoft.Sql.OutboundFirewallRules.get", + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_create_or_update": "Microsoft.Sql.OutboundFirewallRules.createOrUpdate", + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_create_or_update": "Microsoft.Sql.OutboundFirewallRules.createOrUpdate", + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.begin_delete": "Microsoft.Sql.OutboundFirewallRules.delete", + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.begin_delete": "Microsoft.Sql.OutboundFirewallRules.delete", + "azure.mgmt.sql.operations.OutboundFirewallRulesOperations.list_by_server": "Microsoft.Sql.OutboundFirewallRules.listByServer", + "azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations.list_by_server": "Microsoft.Sql.OutboundFirewallRules.listByServer", + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.Sql.PrivateEndpointConnections.get", + "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.get": "Microsoft.Sql.PrivateEndpointConnections.get", + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": "Microsoft.Sql.PrivateEndpointConnections.createOrUpdate", + "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.begin_create_or_update": "Microsoft.Sql.PrivateEndpointConnections.createOrUpdate", + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.Sql.PrivateEndpointConnections.delete", + "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.begin_delete": "Microsoft.Sql.PrivateEndpointConnections.delete", + "azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations.list_by_server": "Microsoft.Sql.PrivateEndpointConnections.listByServer", + "azure.mgmt.sql.aio.operations.PrivateEndpointConnectionsOperations.list_by_server": "Microsoft.Sql.PrivateEndpointConnections.listByServer", + "azure.mgmt.sql.operations.PrivateLinkResourcesOperations.get": "Microsoft.Sql.PrivateLinkResources.get", + "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.get": "Microsoft.Sql.PrivateLinkResources.get", + "azure.mgmt.sql.operations.PrivateLinkResourcesOperations.list_by_server": "Microsoft.Sql.PrivateLinkResources.listByServer", + "azure.mgmt.sql.aio.operations.PrivateLinkResourcesOperations.list_by_server": "Microsoft.Sql.PrivateLinkResources.listByServer", + "azure.mgmt.sql.operations.RecoverableDatabasesOperations.get": "Microsoft.Sql.RecoverableDatabases.get", + "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.get": "Microsoft.Sql.RecoverableDatabases.get", + "azure.mgmt.sql.operations.RecoverableDatabasesOperations.list_by_server": "Microsoft.Sql.RecoverableDatabases.listByServer", + "azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations.list_by_server": "Microsoft.Sql.RecoverableDatabases.listByServer", + "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.get": "Microsoft.Sql.RecoverableManagedDatabases.get", + "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.get": "Microsoft.Sql.RecoverableManagedDatabases.get", + "azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.RecoverableManagedDatabases.listByInstance", + "azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.RecoverableManagedDatabases.listByInstance", + "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.get": "Microsoft.Sql.RestorableDroppedDatabases.get", + "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.get": "Microsoft.Sql.RestorableDroppedDatabases.get", + "azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations.list_by_server": "Microsoft.Sql.RestorableDroppedDatabases.listByServer", + "azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations.list_by_server": "Microsoft.Sql.RestorableDroppedDatabases.listByServer", + "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.get": "Microsoft.Sql.RestorableDroppedManagedDatabases.get", + "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.get": "Microsoft.Sql.RestorableDroppedManagedDatabases.get", + "azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.RestorableDroppedManagedDatabases.listByInstance", + "azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations.list_by_instance": "Microsoft.Sql.RestorableDroppedManagedDatabases.listByInstance", + "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.get": "Microsoft.Sql.ServerAzureADAdministrators.get", + "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.get": "Microsoft.Sql.ServerAzureADAdministrators.get", + "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": "Microsoft.Sql.ServerAzureADAdministrators.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_create_or_update": "Microsoft.Sql.ServerAzureADAdministrators.createOrUpdate", + "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.begin_delete": "Microsoft.Sql.ServerAzureADAdministrators.delete", + "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.begin_delete": "Microsoft.Sql.ServerAzureADAdministrators.delete", + "azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations.list_by_server": "Microsoft.Sql.ServerAzureADAdministrators.listByServer", + "azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations.list_by_server": "Microsoft.Sql.ServerAzureADAdministrators.listByServer", + "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.get": "Microsoft.Sql.ServerAzureADOnlyAuthentications.get", + "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.get": "Microsoft.Sql.ServerAzureADOnlyAuthentications.get", + "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": "Microsoft.Sql.ServerAzureADOnlyAuthentications.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_create_or_update": "Microsoft.Sql.ServerAzureADOnlyAuthentications.createOrUpdate", + "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": "Microsoft.Sql.ServerAzureADOnlyAuthentications.delete", + "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.begin_delete": "Microsoft.Sql.ServerAzureADOnlyAuthentications.delete", + "azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": "Microsoft.Sql.ServerAzureADOnlyAuthentications.listByServer", + "azure.mgmt.sql.aio.operations.ServerAzureADOnlyAuthenticationsOperations.list_by_server": "Microsoft.Sql.ServerAzureADOnlyAuthentications.listByServer", + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.get": "Microsoft.Sql.ServerConfigurationOptions.get", + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.get": "Microsoft.Sql.ServerConfigurationOptions.get", + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.begin_create_or_update": "Microsoft.Sql.ServerConfigurationOptions.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.begin_create_or_update": "Microsoft.Sql.ServerConfigurationOptions.createOrUpdate", + "azure.mgmt.sql.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": "Microsoft.Sql.ServerConfigurationOptions.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ServerConfigurationOptionsOperations.list_by_managed_instance": "Microsoft.Sql.ServerConfigurationOptions.listByManagedInstance", + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.get": "Microsoft.Sql.ServerConnectionPolicies.get", + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.get": "Microsoft.Sql.ServerConnectionPolicies.get", + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerConnectionPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerConnectionPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ServerConnectionPoliciesOperations.list_by_server": "Microsoft.Sql.ServerConnectionPolicies.listByServer", + "azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations.list_by_server": "Microsoft.Sql.ServerConnectionPolicies.listByServer", + "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.get": "Microsoft.Sql.ServerDevOpsAuditSettings.get", + "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.get": "Microsoft.Sql.ServerDevOpsAuditSettings.get", + "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": "Microsoft.Sql.ServerDevOpsAuditSettings.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.begin_create_or_update": "Microsoft.Sql.ServerDevOpsAuditSettings.createOrUpdate", + "azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations.list_by_server": "Microsoft.Sql.ServerDevOpsAuditSettings.listByServer", + "azure.mgmt.sql.aio.operations.ServerDevOpsAuditSettingsOperations.list_by_server": "Microsoft.Sql.ServerDevOpsAuditSettings.listByServer", + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.get": "Microsoft.Sql.ServerDnsAliases.get", + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.get": "Microsoft.Sql.ServerDnsAliases.get", + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_create_or_update": "Microsoft.Sql.ServerDnsAliases.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_create_or_update": "Microsoft.Sql.ServerDnsAliases.createOrUpdate", + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_delete": "Microsoft.Sql.ServerDnsAliases.delete", + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_delete": "Microsoft.Sql.ServerDnsAliases.delete", + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.list_by_server": "Microsoft.Sql.ServerDnsAliases.listByServer", + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.list_by_server": "Microsoft.Sql.ServerDnsAliases.listByServer", + "azure.mgmt.sql.operations.ServerDnsAliasesOperations.begin_acquire": "Microsoft.Sql.ServerDnsAliases.acquire", + "azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations.begin_acquire": "Microsoft.Sql.ServerDnsAliases.acquire", + "azure.mgmt.sql.operations.ServerKeysOperations.get": "Microsoft.Sql.ServerKeys.get", + "azure.mgmt.sql.aio.operations.ServerKeysOperations.get": "Microsoft.Sql.ServerKeys.get", + "azure.mgmt.sql.operations.ServerKeysOperations.begin_create_or_update": "Microsoft.Sql.ServerKeys.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerKeysOperations.begin_create_or_update": "Microsoft.Sql.ServerKeys.createOrUpdate", + "azure.mgmt.sql.operations.ServerKeysOperations.begin_delete": "Microsoft.Sql.ServerKeys.delete", + "azure.mgmt.sql.aio.operations.ServerKeysOperations.begin_delete": "Microsoft.Sql.ServerKeys.delete", + "azure.mgmt.sql.operations.ServerKeysOperations.list_by_server": "Microsoft.Sql.ServerKeys.listByServer", + "azure.mgmt.sql.aio.operations.ServerKeysOperations.list_by_server": "Microsoft.Sql.ServerKeys.listByServer", + "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ServerSecurityAlertPolicies.get", + "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.get": "Microsoft.Sql.ServerSecurityAlertPolicies.get", + "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.begin_create_or_update": "Microsoft.Sql.ServerSecurityAlertPolicies.createOrUpdate", + "azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations.list_by_server": "Microsoft.Sql.ServerSecurityAlertPolicies.listByServer", + "azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations.list_by_server": "Microsoft.Sql.ServerSecurityAlertPolicies.listByServer", + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.get": "Microsoft.Sql.ServerTrustCertificates.get", + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.get": "Microsoft.Sql.ServerTrustCertificates.get", + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_create_or_update": "Microsoft.Sql.ServerTrustCertificates.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_create_or_update": "Microsoft.Sql.ServerTrustCertificates.createOrUpdate", + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.begin_delete": "Microsoft.Sql.ServerTrustCertificates.delete", + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.begin_delete": "Microsoft.Sql.ServerTrustCertificates.delete", + "azure.mgmt.sql.operations.ServerTrustCertificatesOperations.list_by_instance": "Microsoft.Sql.ServerTrustCertificates.listByInstance", + "azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations.list_by_instance": "Microsoft.Sql.ServerTrustCertificates.listByInstance", + "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ServerVulnerabilityAssessments.get", + "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.get": "Microsoft.Sql.ServerVulnerabilityAssessments.get", + "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ServerVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.create_or_update": "Microsoft.Sql.ServerVulnerabilityAssessments.createOrUpdate", + "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ServerVulnerabilityAssessments.delete", + "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.delete": "Microsoft.Sql.ServerVulnerabilityAssessments.delete", + "azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": "Microsoft.Sql.ServerVulnerabilityAssessments.listByServer", + "azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations.list_by_server": "Microsoft.Sql.ServerVulnerabilityAssessments.listByServer", + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.get": "Microsoft.Sql.StartStopManagedInstanceSchedules.get", + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.get": "Microsoft.Sql.StartStopManagedInstanceSchedules.get", + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": "Microsoft.Sql.StartStopManagedInstanceSchedules.createOrUpdate", + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.create_or_update": "Microsoft.Sql.StartStopManagedInstanceSchedules.createOrUpdate", + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.delete": "Microsoft.Sql.StartStopManagedInstanceSchedules.delete", + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.delete": "Microsoft.Sql.StartStopManagedInstanceSchedules.delete", + "azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": "Microsoft.Sql.StartStopManagedInstanceSchedules.listByInstance", + "azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations.list_by_instance": "Microsoft.Sql.StartStopManagedInstanceSchedules.listByInstance", + "azure.mgmt.sql.operations.SubscriptionUsagesOperations.get": "Microsoft.Sql.SubscriptionUsages.get", + "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.get": "Microsoft.Sql.SubscriptionUsages.get", + "azure.mgmt.sql.operations.SubscriptionUsagesOperations.list_by_location": "Microsoft.Sql.SubscriptionUsages.listByLocation", + "azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations.list_by_location": "Microsoft.Sql.SubscriptionUsages.listByLocation", + "azure.mgmt.sql.operations.SyncAgentsOperations.get": "Microsoft.Sql.SyncAgents.get", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.get": "Microsoft.Sql.SyncAgents.get", + "azure.mgmt.sql.operations.SyncAgentsOperations.begin_create_or_update": "Microsoft.Sql.SyncAgents.createOrUpdate", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_create_or_update": "Microsoft.Sql.SyncAgents.createOrUpdate", + "azure.mgmt.sql.operations.SyncAgentsOperations.begin_delete": "Microsoft.Sql.SyncAgents.delete", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.begin_delete": "Microsoft.Sql.SyncAgents.delete", + "azure.mgmt.sql.operations.SyncAgentsOperations.list_by_server": "Microsoft.Sql.SyncAgents.listByServer", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_by_server": "Microsoft.Sql.SyncAgents.listByServer", + "azure.mgmt.sql.operations.SyncAgentsOperations.generate_key": "Microsoft.Sql.SyncAgents.generateKey", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.generate_key": "Microsoft.Sql.SyncAgents.generateKey", + "azure.mgmt.sql.operations.SyncAgentsOperations.list_linked_databases": "Microsoft.Sql.SyncAgents.listLinkedDatabases", + "azure.mgmt.sql.aio.operations.SyncAgentsOperations.list_linked_databases": "Microsoft.Sql.SyncAgents.listLinkedDatabases", + "azure.mgmt.sql.operations.SyncGroupsOperations.get": "Microsoft.Sql.SyncGroups.get", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.get": "Microsoft.Sql.SyncGroups.get", + "azure.mgmt.sql.operations.SyncGroupsOperations.begin_create_or_update": "Microsoft.Sql.SyncGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_create_or_update": "Microsoft.Sql.SyncGroups.createOrUpdate", + "azure.mgmt.sql.operations.SyncGroupsOperations.begin_update": "Microsoft.Sql.SyncGroups.update", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_update": "Microsoft.Sql.SyncGroups.update", + "azure.mgmt.sql.operations.SyncGroupsOperations.begin_delete": "Microsoft.Sql.SyncGroups.delete", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_delete": "Microsoft.Sql.SyncGroups.delete", + "azure.mgmt.sql.operations.SyncGroupsOperations.list_by_database": "Microsoft.Sql.SyncGroups.listByDatabase", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_by_database": "Microsoft.Sql.SyncGroups.listByDatabase", + "azure.mgmt.sql.operations.SyncGroupsOperations.cancel_sync": "Microsoft.Sql.SyncGroups.cancelSync", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.cancel_sync": "Microsoft.Sql.SyncGroups.cancelSync", + "azure.mgmt.sql.operations.SyncGroupsOperations.list_hub_schemas": "Microsoft.Sql.SyncGroups.listHubSchemas", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_hub_schemas": "Microsoft.Sql.SyncGroups.listHubSchemas", + "azure.mgmt.sql.operations.SyncGroupsOperations.list_logs": "Microsoft.Sql.SyncGroups.listLogs", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_logs": "Microsoft.Sql.SyncGroups.listLogs", + "azure.mgmt.sql.operations.SyncGroupsOperations.begin_refresh_hub_schema": "Microsoft.Sql.SyncGroups.refreshHubSchema", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.begin_refresh_hub_schema": "Microsoft.Sql.SyncGroups.refreshHubSchema", + "azure.mgmt.sql.operations.SyncGroupsOperations.trigger_sync": "Microsoft.Sql.SyncGroups.triggerSync", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.trigger_sync": "Microsoft.Sql.SyncGroups.triggerSync", + "azure.mgmt.sql.operations.SyncGroupsOperations.list_sync_database_ids": "Microsoft.Sql.SyncGroupsOperationGroup.listSyncDatabaseIds", + "azure.mgmt.sql.aio.operations.SyncGroupsOperations.list_sync_database_ids": "Microsoft.Sql.SyncGroupsOperationGroup.listSyncDatabaseIds", + "azure.mgmt.sql.operations.SyncMembersOperations.get": "Microsoft.Sql.SyncMembers.get", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.get": "Microsoft.Sql.SyncMembers.get", + "azure.mgmt.sql.operations.SyncMembersOperations.begin_create_or_update": "Microsoft.Sql.SyncMembers.createOrUpdate", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_create_or_update": "Microsoft.Sql.SyncMembers.createOrUpdate", + "azure.mgmt.sql.operations.SyncMembersOperations.begin_update": "Microsoft.Sql.SyncMembers.update", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_update": "Microsoft.Sql.SyncMembers.update", + "azure.mgmt.sql.operations.SyncMembersOperations.begin_delete": "Microsoft.Sql.SyncMembers.delete", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_delete": "Microsoft.Sql.SyncMembers.delete", + "azure.mgmt.sql.operations.SyncMembersOperations.list_by_sync_group": "Microsoft.Sql.SyncMembers.listBySyncGroup", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_by_sync_group": "Microsoft.Sql.SyncMembers.listBySyncGroup", + "azure.mgmt.sql.operations.SyncMembersOperations.begin_refresh_member_schema": "Microsoft.Sql.SyncMembers.refreshMemberSchema", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.begin_refresh_member_schema": "Microsoft.Sql.SyncMembers.refreshMemberSchema", + "azure.mgmt.sql.operations.SyncMembersOperations.list_member_schemas": "Microsoft.Sql.SyncMembers.listMemberSchemas", + "azure.mgmt.sql.aio.operations.SyncMembersOperations.list_member_schemas": "Microsoft.Sql.SyncMembers.listMemberSchemas", + "azure.mgmt.sql.operations.TimeZonesOperations.get": "Microsoft.Sql.TimeZones.get", + "azure.mgmt.sql.aio.operations.TimeZonesOperations.get": "Microsoft.Sql.TimeZones.get", + "azure.mgmt.sql.operations.TimeZonesOperations.list_by_location": "Microsoft.Sql.TimeZones.listByLocation", + "azure.mgmt.sql.aio.operations.TimeZonesOperations.list_by_location": "Microsoft.Sql.TimeZones.listByLocation", + "azure.mgmt.sql.operations.VirtualClustersOperations.get": "Microsoft.Sql.VirtualClusters.get", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.get": "Microsoft.Sql.VirtualClusters.get", + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_create_or_update": "Microsoft.Sql.VirtualClusters.createOrUpdate", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_create_or_update": "Microsoft.Sql.VirtualClusters.createOrUpdate", + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update": "Microsoft.Sql.VirtualClusters.update", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update": "Microsoft.Sql.VirtualClusters.update", + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_delete": "Microsoft.Sql.VirtualClusters.delete", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_delete": "Microsoft.Sql.VirtualClusters.delete", + "azure.mgmt.sql.operations.VirtualClustersOperations.list_by_resource_group": "Microsoft.Sql.VirtualClusters.listByResourceGroup", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list_by_resource_group": "Microsoft.Sql.VirtualClusters.listByResourceGroup", + "azure.mgmt.sql.operations.VirtualClustersOperations.list": "Microsoft.Sql.VirtualClusters.list", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.list": "Microsoft.Sql.VirtualClusters.list", + "azure.mgmt.sql.operations.VirtualClustersOperations.begin_update_dns_servers": "Microsoft.Sql.VirtualClusters.updateDnsServers", + "azure.mgmt.sql.aio.operations.VirtualClustersOperations.begin_update_dns_servers": "Microsoft.Sql.VirtualClusters.updateDnsServers", + "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.get": "Microsoft.Sql.VirtualNetworkRules.get", + "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.get": "Microsoft.Sql.VirtualNetworkRules.get", + "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_create_or_update": "Microsoft.Sql.VirtualNetworkRules.createOrUpdate", + "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_create_or_update": "Microsoft.Sql.VirtualNetworkRules.createOrUpdate", + "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.begin_delete": "Microsoft.Sql.VirtualNetworkRules.delete", + "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.begin_delete": "Microsoft.Sql.VirtualNetworkRules.delete", + "azure.mgmt.sql.operations.VirtualNetworkRulesOperations.list_by_server": "Microsoft.Sql.VirtualNetworkRules.listByServer", + "azure.mgmt.sql.aio.operations.VirtualNetworkRulesOperations.list_by_server": "Microsoft.Sql.VirtualNetworkRules.listByServer", + "azure.mgmt.sql.operations.WorkloadClassifiersOperations.get": "Microsoft.Sql.WorkloadClassifiers.get", + "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.get": "Microsoft.Sql.WorkloadClassifiers.get", + "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_create_or_update": "Microsoft.Sql.WorkloadClassifiers.createOrUpdate", + "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_create_or_update": "Microsoft.Sql.WorkloadClassifiers.createOrUpdate", + "azure.mgmt.sql.operations.WorkloadClassifiersOperations.begin_delete": "Microsoft.Sql.WorkloadClassifiers.delete", + "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.begin_delete": "Microsoft.Sql.WorkloadClassifiers.delete", + "azure.mgmt.sql.operations.WorkloadClassifiersOperations.list_by_workload_group": "Microsoft.Sql.WorkloadClassifiers.listByWorkloadGroup", + "azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations.list_by_workload_group": "Microsoft.Sql.WorkloadClassifiers.listByWorkloadGroup", + "azure.mgmt.sql.operations.WorkloadGroupsOperations.get": "Microsoft.Sql.WorkloadGroups.get", + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.get": "Microsoft.Sql.WorkloadGroups.get", + "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_create_or_update": "Microsoft.Sql.WorkloadGroups.createOrUpdate", + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_create_or_update": "Microsoft.Sql.WorkloadGroups.createOrUpdate", + "azure.mgmt.sql.operations.WorkloadGroupsOperations.begin_delete": "Microsoft.Sql.WorkloadGroups.delete", + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.begin_delete": "Microsoft.Sql.WorkloadGroups.delete", + "azure.mgmt.sql.operations.WorkloadGroupsOperations.list_by_database": "Microsoft.Sql.WorkloadGroups.listByDatabase", + "azure.mgmt.sql.aio.operations.WorkloadGroupsOperations.list_by_database": "Microsoft.Sql.WorkloadGroups.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.get": "Microsoft.Sql.SensitivityLabels.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.get": "Microsoft.Sql.SensitivityLabels.get", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": "Microsoft.Sql.SensitivityLabels.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.create_or_update": "Microsoft.Sql.SensitivityLabels.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.delete": "Microsoft.Sql.SensitivityLabels.delete", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.delete": "Microsoft.Sql.SensitivityLabels.delete", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": "Microsoft.Sql.SensitivityLabels.disableRecommendation", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.disable_recommendation": "Microsoft.Sql.SensitivityLabels.disableRecommendation", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": "Microsoft.Sql.SensitivityLabels.enableRecommendation", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.enable_recommendation": "Microsoft.Sql.SensitivityLabels.enableRecommendation", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": "Microsoft.Sql.ManagedDatabases.listCurrentByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_current_by_database": "Microsoft.Sql.ManagedDatabases.listCurrentByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.update": "Microsoft.Sql.ManagedDatabases.managedDatabaseSensitivityLabelsUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.update": "Microsoft.Sql.ManagedDatabases.managedDatabaseSensitivityLabelsUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": "Microsoft.Sql.ManagedDatabases.listRecommendedByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_recommended_by_database": "Microsoft.Sql.ManagedDatabases.listRecommendedByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.managedDatabaseSensitivityLabelsListByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.managedDatabaseSensitivityLabelsListByDatabase", + "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.Databases.revalidate", + "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revalidate": "Microsoft.Sql.Databases.revalidate", + "azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations.begin_revert": "Microsoft.Sql.Databases.revert", + "azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations.begin_revert": "Microsoft.Sql.Databases.revert", + "azure.mgmt.sql.operations.DatabaseOperationsOperations.list_by_database": "Microsoft.Sql.Databases.databaseOperationsListByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.list_by_database": "Microsoft.Sql.Databases.databaseOperationsListByDatabase", + "azure.mgmt.sql.operations.DatabaseOperationsOperations.cancel": "Microsoft.Sql.Databases.cancel", + "azure.mgmt.sql.aio.operations.DatabaseOperationsOperations.cancel": "Microsoft.Sql.Databases.cancel", + "azure.mgmt.sql.operations.DatabaseUsagesOperations.list_by_database": "Microsoft.Sql.Databases.databaseUsagesListByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseUsagesOperations.list_by_database": "Microsoft.Sql.Databases.databaseUsagesListByDatabase", + "azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations.update": "Microsoft.Sql.Databases.recommendedSensitivityLabelsUpdate", + "azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations.update": "Microsoft.Sql.Databases.recommendedSensitivityLabelsUpdate", + "azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations.list_by_database": "Microsoft.Sql.Databases.synapseLinkWorkspacesListByDatabase", + "azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations.list_by_database": "Microsoft.Sql.Databases.synapseLinkWorkspacesListByDatabase", + "azure.mgmt.sql.operations.ServerOperationsOperations.list_by_server": "Microsoft.Sql.Servers.serverOperationsListByServer", + "azure.mgmt.sql.aio.operations.ServerOperationsOperations.list_by_server": "Microsoft.Sql.Servers.serverOperationsListByServer", + "azure.mgmt.sql.operations.ServerUsagesOperations.list_by_server": "Microsoft.Sql.Servers.serverUsagesListByServer", + "azure.mgmt.sql.aio.operations.ServerUsagesOperations.list_by_server": "Microsoft.Sql.Servers.serverUsagesListByServer", + "azure.mgmt.sql.operations.TdeCertificatesOperations.begin_create": "Microsoft.Sql.Servers.create", + "azure.mgmt.sql.aio.operations.TdeCertificatesOperations.begin_create": "Microsoft.Sql.Servers.create", + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.DatabaseAdvancedThreatProtections.get", + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.DatabaseAdvancedThreatProtections.get", + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": "Microsoft.Sql.DatabaseAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": "Microsoft.Sql.DatabaseAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": "Microsoft.Sql.DatabaseAdvancedThreatProtections.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": "Microsoft.Sql.DatabaseAdvancedThreatProtections.listByDatabase", + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.get": "Microsoft.Sql.Advisors.get", + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.get": "Microsoft.Sql.Advisors.get", + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.update": "Microsoft.Sql.Advisors.update", + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.update": "Microsoft.Sql.Advisors.update", + "azure.mgmt.sql.operations.DatabaseAdvisorsOperations.list_by_database": "Microsoft.Sql.Advisors.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations.list_by_database": "Microsoft.Sql.Advisors.listByDatabase", + "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.get": "Microsoft.Sql.DatabaseAutomaticTunings.get", + "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.get": "Microsoft.Sql.DatabaseAutomaticTunings.get", + "azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations.update": "Microsoft.Sql.DatabaseAutomaticTunings.update", + "azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations.update": "Microsoft.Sql.DatabaseAutomaticTunings.update", + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.get": "Microsoft.Sql.ImportExportExtensionsOperationResults.get", + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.get": "Microsoft.Sql.ImportExportExtensionsOperationResults.get", + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.begin_create_or_update": "Microsoft.Sql.ImportExportExtensionsOperationResults.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.begin_create_or_update": "Microsoft.Sql.ImportExportExtensionsOperationResults.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseExtensionsOperations.list_by_database": "Microsoft.Sql.ImportExportExtensionsOperationResults.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations.list_by_database": "Microsoft.Sql.ImportExportExtensionsOperationResults.listByDatabase", + "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.get": "Microsoft.Sql.RecommendedActions.get", + "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.get": "Microsoft.Sql.RecommendedActions.get", + "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.update": "Microsoft.Sql.RecommendedActions.update", + "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.update": "Microsoft.Sql.RecommendedActions.update", + "azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": "Microsoft.Sql.RecommendedActions.listByDatabaseAdvisor", + "azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations.list_by_database_advisor": "Microsoft.Sql.RecommendedActions.listByDatabaseAdvisor", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.get", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.get": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.get", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.createOrUpdate", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.create_or_update": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.listBySqlVulnerabilityAssessment", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations.list_by_sql_vulnerability_assessment": "Microsoft.Sql.DatabaseSqlVulnerabilityAssessmentBaselineSets.listBySqlVulnerabilityAssessment", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.createOrUpdate", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations.create_or_update": "Microsoft.Sql.SqlVulnerabilityAssessmentBaseline.createOrUpdate", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessments.get", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessments.get", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": "Microsoft.Sql.SqlVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations.list_by_database": "Microsoft.Sql.SqlVulnerabilityAssessments.listByDatabase", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": "Microsoft.Sql.SqlVulnerabilityAssessments.execute", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": "Microsoft.Sql.SqlVulnerabilityAssessments.execute", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.execute", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations.begin_execute": "Microsoft.Sql.SqlVulnerabilityAssessmentsSettings.execute", + "azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.delete", + "azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations.delete": "Microsoft.Sql.SqlVulnerabilityAssessmentRuleBaseline.delete", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecords.get", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecords.get", + "azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecords.listBySqlVulnerabilityAssessments", + "azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations.list_by_sql_vulnerability_assessments": "Microsoft.Sql.SqlVulnerabilityAssessmentScanRecords.listBySqlVulnerabilityAssessments", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.get", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.get": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.get", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.listByDatabase", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.list_by_database": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.listByDatabase", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.export": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.export", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.export": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.export", + "azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.initiateScan", + "azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations.begin_initiate_scan": "Microsoft.Sql.VulnerabilityAssessmentScanRecords.initiateScan", + "azure.mgmt.sql.operations.DataMaskingRulesOperations.list_by_database": "Microsoft.Sql.DataMaskingPolicies.listByDatabase", + "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.list_by_database": "Microsoft.Sql.DataMaskingPolicies.listByDatabase", + "azure.mgmt.sql.operations.DataMaskingRulesOperations.create_or_update": "Microsoft.Sql.DataMaskingPolicies.dataMaskingRulesCreateOrUpdate", + "azure.mgmt.sql.aio.operations.DataMaskingRulesOperations.create_or_update": "Microsoft.Sql.DataMaskingPolicies.dataMaskingRulesCreateOrUpdate", + "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.get": "Microsoft.Sql.DataWarehouseUserActivitiesOperationGroup.get", + "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.get": "Microsoft.Sql.DataWarehouseUserActivitiesOperationGroup.get", + "azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations.list_by_database": "Microsoft.Sql.DataWarehouseUserActivitiesOperationGroup.listByDatabase", + "azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations.list_by_database": "Microsoft.Sql.DataWarehouseUserActivitiesOperationGroup.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.managedDatabaseSecurityEventsListByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations.list_by_database": "Microsoft.Sql.ManagedDatabases.managedDatabaseSecurityEventsListByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": "Microsoft.Sql.ManagedDatabases.managedDatabaseRecommendedSensitivityLabelsUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations.update": "Microsoft.Sql.ManagedDatabases.managedDatabaseRecommendedSensitivityLabelsUpdate", + "azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations.begin_create": "Microsoft.Sql.ManagedInstances.create", + "azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations.begin_create": "Microsoft.Sql.ManagedInstances.create", + "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": "Microsoft.Sql.ElasticPools.elasticPoolOperationsListByElasticPool", + "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.list_by_elastic_pool": "Microsoft.Sql.ElasticPools.elasticPoolOperationsListByElasticPool", + "azure.mgmt.sql.operations.ElasticPoolOperationsOperations.cancel": "Microsoft.Sql.ElasticPools.cancel", + "azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations.cancel": "Microsoft.Sql.ElasticPools.cancel", + "azure.mgmt.sql.operations.UsagesOperations.list_by_instance_pool": "Microsoft.Sql.InstancePools.usagesListByInstancePool", + "azure.mgmt.sql.aio.operations.UsagesOperations.list_by_instance_pool": "Microsoft.Sql.InstancePools.usagesListByInstancePool", + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.get": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.get", + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.get": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.get", + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_create_or_update": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.createOrUpdate", + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_create_or_update": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.createOrUpdate", + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.list_by_database": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.listByDatabase", + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.list_by_database": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.listByDatabase", + "azure.mgmt.sql.operations.LedgerDigestUploadsOperations.begin_disable": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.disable", + "azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations.begin_disable": "Microsoft.Sql.LedgerDigestUploadsOperationGroup.disable", + "azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations.get": "Microsoft.Sql.MaintenanceWindowOptionsOperationGroup.get", + "azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations.get": "Microsoft.Sql.MaintenanceWindowOptionsOperationGroup.get", + "azure.mgmt.sql.operations.MaintenanceWindowsOperations.get": "Microsoft.Sql.MaintenanceWindowsOperationGroup.get", + "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.get": "Microsoft.Sql.MaintenanceWindowsOperationGroup.get", + "azure.mgmt.sql.operations.MaintenanceWindowsOperations.create_or_update": "Microsoft.Sql.MaintenanceWindowsOperationGroup.createOrUpdate", + "azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations.create_or_update": "Microsoft.Sql.MaintenanceWindowsOperationGroup.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.get", + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.create_or_update": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations.list_by_database": "Microsoft.Sql.ManagedDatabaseAdvancedThreatProtections.listByDatabase", + "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.get": "Microsoft.Sql.ManagedDatabaseMoveOperationResults.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.get": "Microsoft.Sql.ManagedDatabaseMoveOperationResults.get", + "azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": "Microsoft.Sql.ManagedDatabaseMoveOperationResults.listByLocation", + "azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations.list_by_location": "Microsoft.Sql.ManagedDatabaseMoveOperationResults.listByLocation", + "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.get": "Microsoft.Sql.ManagedInstanceQueries.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.get": "Microsoft.Sql.ManagedInstanceQueries.get", + "azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations.list_by_query": "Microsoft.Sql.ManagedInstanceQueries.listByQuery", + "azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations.list_by_query": "Microsoft.Sql.ManagedInstanceQueries.listByQuery", + "azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations.get": "Microsoft.Sql.ManagedDatabaseRestoreDetailsResults.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations.get": "Microsoft.Sql.ManagedDatabaseRestoreDetailsResults.get", + "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": "Microsoft.Sql.ManagedTransparentDataEncryptions.get", + "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.get": "Microsoft.Sql.ManagedTransparentDataEncryptions.get", + "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": "Microsoft.Sql.ManagedTransparentDataEncryptions.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.create_or_update": "Microsoft.Sql.ManagedTransparentDataEncryptions.createOrUpdate", + "azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": "Microsoft.Sql.ManagedTransparentDataEncryptions.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations.list_by_database": "Microsoft.Sql.ManagedTransparentDataEncryptions.listByDatabase", + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.get", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.get", + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.begin_create_or_update": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.listByInstance", + "azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations.list_by_instance": "Microsoft.Sql.ManagedInstanceAdvancedThreatProtections.listByInstance", + "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.get": "Microsoft.Sql.ManagedInstancePrivateLinks.get", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.get": "Microsoft.Sql.ManagedInstancePrivateLinks.get", + "azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstancePrivateLinks.listByManagedInstance", + "azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations.list_by_managed_instance": "Microsoft.Sql.ManagedInstancePrivateLinks.listByManagedInstance", + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.get": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.get", + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.get": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.get", + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.createOrUpdate", + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_create_or_update": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.createOrUpdate", + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.list_by_database": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.listByDatabase", + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.list_by_database": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.listByDatabase", + "azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations.begin_disable": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.disable", + "azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations.begin_disable": "Microsoft.Sql.ManagedLedgerDigestUploadsOperationGroup.disable", + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ServerAdvancedThreatProtections.get", + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.get": "Microsoft.Sql.ServerAdvancedThreatProtections.get", + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": "Microsoft.Sql.ServerAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.begin_create_or_update": "Microsoft.Sql.ServerAdvancedThreatProtections.createOrUpdate", + "azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": "Microsoft.Sql.ServerAdvancedThreatProtections.listByServer", + "azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations.list_by_server": "Microsoft.Sql.ServerAdvancedThreatProtections.listByServer", + "azure.mgmt.sql.operations.ServerAutomaticTuningOperations.get": "Microsoft.Sql.ServerAutomaticTunings.get", + "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.get": "Microsoft.Sql.ServerAutomaticTunings.get", + "azure.mgmt.sql.operations.ServerAutomaticTuningOperations.update": "Microsoft.Sql.ServerAutomaticTunings.update", + "azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations.update": "Microsoft.Sql.ServerAutomaticTunings.update", + "azure.mgmt.sql.operations.SqlAgentOperations.get": "Microsoft.Sql.SqlAgentConfigurations.get", + "azure.mgmt.sql.aio.operations.SqlAgentOperations.get": "Microsoft.Sql.SqlAgentConfigurations.get", + "azure.mgmt.sql.operations.SqlAgentOperations.create_or_update": "Microsoft.Sql.SqlAgentConfigurations.createOrUpdate", + "azure.mgmt.sql.aio.operations.SqlAgentOperations.create_or_update": "Microsoft.Sql.SqlAgentConfigurations.createOrUpdate", + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.get": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.get", + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.get": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.get", + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_create_or_update": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.createOrUpdate", + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_create_or_update": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.createOrUpdate", + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.list_by_database": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.listByDatabase", + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.list_by_database": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.listByDatabase", + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_resume": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.resume", + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_resume": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.resume", + "azure.mgmt.sql.operations.TransparentDataEncryptionsOperations.begin_suspend": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.suspend", + "azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations.begin_suspend": "Microsoft.Sql.LogicalDatabaseTransparentDataEncryptions.suspend", + "azure.mgmt.sql.operations.CapabilitiesOperations.list_by_location": "Microsoft.Sql.CapabilitiesOperationGroup.listByLocation", + "azure.mgmt.sql.aio.operations.CapabilitiesOperations.list_by_location": "Microsoft.Sql.CapabilitiesOperationGroup.listByLocation" } } \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py index 15b918d384b2..62e48fc86217 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._sql_management_client import SqlManagementClient # type: ignore +from ._client import SqlClient # type: ignore from ._version import VERSION __version__ = VERSION @@ -25,7 +25,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "SqlManagementClient", + "SqlClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_client.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_client.py index 5538d08ae444..28b783eacb29 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_client.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,8 +18,7 @@ from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from . import models as _models -from ._configuration import SqlManagementClientConfiguration +from ._configuration import SqlClientConfiguration from ._utils.serialization import Deserializer, Serializer from .operations import ( BackupShortTermRetentionPoliciesOperations, @@ -177,15 +176,31 @@ from azure.core.credentials import TokenCredential -class SqlManagementClient: # pylint: disable=too-many-instance-attributes - """The Azure SQL Database management API provides a RESTful set of web services that interact with - Azure SQL Database services to manage your databases. The API enables you to create, retrieve, - update, and delete databases. +class SqlClient: # pylint: disable=too-many-instance-attributes + """The Azure SQL Database management API provides a RESTful set of web APIs that interact with + Azure SQL Database services to manage your databases. The API enables users to create, + retrieve, update, and delete databases, servers, and other entities. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.sql.operations.Operations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations + :ivar database_columns: DatabaseColumnsOperations operations + :vartype database_columns: azure.mgmt.sql.operations.DatabaseColumnsOperations + :ivar restore_points: RestorePointsOperations operations + :vartype restore_points: azure.mgmt.sql.operations.RestorePointsOperations + :ivar sensitivity_labels: SensitivityLabelsOperations operations + :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations + :ivar databases: DatabasesOperations operations + :vartype databases: azure.mgmt.sql.operations.DatabasesOperations + :ivar firewall_rules: FirewallRulesOperations operations + :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations + :ivar servers: ServersOperations operations + :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations :vartype server_blob_auditing_policies: azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations @@ -200,86 +215,83 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes operations :vartype extended_server_blob_auditing_policies: azure.mgmt.sql.operations.ExtendedServerBlobAuditingPoliciesOperations - :ivar database_advanced_threat_protection_settings: - DatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype database_advanced_threat_protection_settings: - azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations - :ivar database_advisors: DatabaseAdvisorsOperations operations - :vartype database_advisors: azure.mgmt.sql.operations.DatabaseAdvisorsOperations - :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations - :vartype database_automatic_tuning: azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations - :ivar database_columns: DatabaseColumnsOperations operations - :vartype database_columns: azure.mgmt.sql.operations.DatabaseColumnsOperations - :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations - :vartype database_encryption_protectors: - azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations - :ivar database_extensions: DatabaseExtensionsOperations operations - :vartype database_extensions: azure.mgmt.sql.operations.DatabaseExtensionsOperations - :ivar database_operations: DatabaseOperationsOperations operations - :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperationsOperations - :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations - :vartype database_recommended_actions: - azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations - :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.sql.operations.DatabasesOperations + :ivar server_advisors: ServerAdvisorsOperations operations + :vartype server_advisors: azure.mgmt.sql.operations.ServerAdvisorsOperations + :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations + :vartype managed_database_columns: azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations + :ivar database_tables: DatabaseTablesOperations operations + :vartype database_tables: azure.mgmt.sql.operations.DatabaseTablesOperations + :ivar managed_database_tables: ManagedDatabaseTablesOperations operations + :vartype managed_database_tables: azure.mgmt.sql.operations.ManagedDatabaseTablesOperations :ivar database_schemas: DatabaseSchemasOperations operations :vartype database_schemas: azure.mgmt.sql.operations.DatabaseSchemasOperations + :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations + :vartype managed_database_schemas: azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations :ivar database_security_alert_policies: DatabaseSecurityAlertPoliciesOperations operations :vartype database_security_alert_policies: azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations + operations + :vartype sql_vulnerability_assessment_baseline: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations + :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations + :vartype sql_vulnerability_assessments: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations + :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations + operations + :vartype sql_vulnerability_assessments_settings: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations :ivar database_sql_vulnerability_assessment_rule_baselines: DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_sql_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar sql_vulnerability_assessment_rule_baseline: + SqlVulnerabilityAssessmentRuleBaselineOperations operations + :vartype sql_vulnerability_assessment_rule_baseline: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations :ivar database_sql_vulnerability_assessment_scan_result: DatabaseSqlVulnerabilityAssessmentScanResultOperations operations :vartype database_sql_vulnerability_assessment_scan_result: azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations - :ivar database_tables: DatabaseTablesOperations operations - :vartype database_tables: azure.mgmt.sql.operations.DatabaseTablesOperations - :ivar database_usages: DatabaseUsagesOperations operations - :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations + :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations + operations + :vartype sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations + :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations + :vartype sql_vulnerability_assessment_scans: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations + :ivar managed_database_vulnerability_assessment_rule_baselines: + ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype managed_database_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations :ivar database_vulnerability_assessments: DatabaseVulnerabilityAssessmentsOperations operations :vartype database_vulnerability_assessments: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations - :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScansOperations - operations - :vartype database_vulnerability_assessment_scans: - azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar managed_database_vulnerability_assessments: + ManagedDatabaseVulnerabilityAssessmentsOperations operations + :vartype managed_database_vulnerability_assessments: + azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations + :ivar managed_database_vulnerability_assessment_scans: + ManagedDatabaseVulnerabilityAssessmentScansOperations operations + :vartype managed_database_vulnerability_assessment_scans: + azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations :ivar data_masking_policies: DataMaskingPoliciesOperations operations :vartype data_masking_policies: azure.mgmt.sql.operations.DataMaskingPoliciesOperations - :ivar data_masking_rules: DataMaskingRulesOperations operations - :vartype data_masking_rules: azure.mgmt.sql.operations.DataMaskingRulesOperations - :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations - :vartype data_warehouse_user_activities: - azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations :ivar deleted_servers: DeletedServersOperations operations :vartype deleted_servers: azure.mgmt.sql.operations.DeletedServersOperations :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations :vartype distributed_availability_groups: azure.mgmt.sql.operations.DistributedAvailabilityGroupsOperations - :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations - :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperationsOperations + :ivar managed_databases: ManagedDatabasesOperations operations + :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations + :ivar server_trust_groups: ServerTrustGroupsOperations operations + :vartype server_trust_groups: azure.mgmt.sql.operations.ServerTrustGroupsOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar elastic_pools: ElasticPoolsOperations operations :vartype elastic_pools: azure.mgmt.sql.operations.ElasticPoolsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations @@ -288,8 +300,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype endpoint_certificates: azure.mgmt.sql.operations.EndpointCertificatesOperations :ivar failover_groups: FailoverGroupsOperations operations :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations - :ivar firewall_rules: FirewallRulesOperations operations - :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations :ivar geo_backup_policies: GeoBackupPoliciesOperations operations :vartype geo_backup_policies: azure.mgmt.sql.operations.GeoBackupPoliciesOperations :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations @@ -300,30 +310,26 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations :vartype ipv6_firewall_rules: azure.mgmt.sql.operations.IPv6FirewallRulesOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: azure.mgmt.sql.operations.JobExecutionsOperations :ivar job_agents: JobAgentsOperations operations :vartype job_agents: azure.mgmt.sql.operations.JobAgentsOperations :ivar job_credentials: JobCredentialsOperations operations :vartype job_credentials: azure.mgmt.sql.operations.JobCredentialsOperations - :ivar job_executions: JobExecutionsOperations operations - :vartype job_executions: azure.mgmt.sql.operations.JobExecutionsOperations - :ivar job_private_endpoints: JobPrivateEndpointsOperations operations - :vartype job_private_endpoints: azure.mgmt.sql.operations.JobPrivateEndpointsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.sql.operations.JobsOperations :ivar job_step_executions: JobStepExecutionsOperations operations :vartype job_step_executions: azure.mgmt.sql.operations.JobStepExecutionsOperations - :ivar job_steps: JobStepsOperations operations - :vartype job_steps: azure.mgmt.sql.operations.JobStepsOperations :ivar job_target_executions: JobTargetExecutionsOperations operations :vartype job_target_executions: azure.mgmt.sql.operations.JobTargetExecutionsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.sql.operations.JobsOperations + :ivar job_private_endpoints: JobPrivateEndpointsOperations operations + :vartype job_private_endpoints: azure.mgmt.sql.operations.JobPrivateEndpointsOperations + :ivar job_steps: JobStepsOperations operations + :vartype job_steps: azure.mgmt.sql.operations.JobStepsOperations :ivar job_target_groups: JobTargetGroupsOperations operations :vartype job_target_groups: azure.mgmt.sql.operations.JobTargetGroupsOperations :ivar job_versions: JobVersionsOperations operations :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations - :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations - :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations - :ivar capabilities: CapabilitiesOperations operations - :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations @@ -334,73 +340,21 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations - :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations - :vartype maintenance_window_options: - azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations - :ivar maintenance_windows: MaintenanceWindowsOperations operations - :vartype maintenance_windows: azure.mgmt.sql.operations.MaintenanceWindowsOperations :ivar managed_backup_short_term_retention_policies: ManagedBackupShortTermRetentionPoliciesOperations operations :vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations - :ivar managed_database_advanced_threat_protection_settings: - ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype managed_database_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations - :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations - :vartype managed_database_columns: azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations - :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations - :vartype managed_database_move_operations: - azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations - :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations - :vartype managed_database_queries: azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations - :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations - :vartype managed_database_restore_details: - azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations - :ivar managed_databases: ManagedDatabasesOperations operations - :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations - :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations - :vartype managed_database_schemas: azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations + :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: + ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations + :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: + azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations :ivar managed_database_security_alert_policies: ManagedDatabaseSecurityAlertPoliciesOperations operations :vartype managed_database_security_alert_policies: azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations - :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations - :vartype managed_database_security_events: - azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations - :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations - operations - :vartype managed_database_sensitivity_labels: - azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations - :ivar managed_database_recommended_sensitivity_labels: - ManagedDatabaseRecommendedSensitivityLabelsOperations operations - :vartype managed_database_recommended_sensitivity_labels: - azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations - :ivar managed_database_tables: ManagedDatabaseTablesOperations operations - :vartype managed_database_tables: azure.mgmt.sql.operations.ManagedDatabaseTablesOperations - :ivar managed_database_transparent_data_encryption: - ManagedDatabaseTransparentDataEncryptionOperations operations - :vartype managed_database_transparent_data_encryption: - azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations - :ivar managed_database_vulnerability_assessment_rule_baselines: - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype managed_database_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations - :ivar managed_database_vulnerability_assessments: - ManagedDatabaseVulnerabilityAssessmentsOperations operations - :vartype managed_database_vulnerability_assessments: - azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations - :ivar managed_database_vulnerability_assessment_scans: - ManagedDatabaseVulnerabilityAssessmentScansOperations operations - :vartype managed_database_vulnerability_assessment_scans: - azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations :ivar managed_instance_administrators: ManagedInstanceAdministratorsOperations operations :vartype managed_instance_administrators: azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations - :ivar managed_instance_advanced_threat_protection_settings: - ManagedInstanceAdvancedThreatProtectionSettingsOperations operations - :vartype managed_instance_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthenticationsOperations operations :vartype managed_instance_azure_ad_only_authentications: @@ -424,26 +378,10 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes ManagedInstancePrivateEndpointConnectionsOperations operations :vartype managed_instance_private_endpoint_connections: azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations - :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations - operations - :vartype managed_instance_private_link_resources: - azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations - :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations - :vartype managed_instance_tde_certificates: - azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations :ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessmentsOperations operations :vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations - :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations - :vartype managed_ledger_digest_uploads: - azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations - :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations - :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: - azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations :vartype managed_server_dns_aliases: azure.mgmt.sql.operations.ManagedServerDnsAliasesOperations @@ -455,8 +393,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes NetworkSecurityPerimeterConfigurationsOperations operations :vartype network_security_perimeter_configurations: azure.mgmt.sql.operations.NetworkSecurityPerimeterConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.sql.operations.Operations :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations :vartype outbound_firewall_rules: azure.mgmt.sql.operations.OutboundFirewallRulesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -469,8 +405,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :ivar recoverable_managed_databases: RecoverableManagedDatabasesOperations operations :vartype recoverable_managed_databases: azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations @@ -478,21 +412,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes operations :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations - :ivar restore_points: RestorePointsOperations operations - :vartype restore_points: azure.mgmt.sql.operations.RestorePointsOperations - :ivar sensitivity_labels: SensitivityLabelsOperations operations - :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations - :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations - :vartype recommended_sensitivity_labels: - azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations - :ivar server_advanced_threat_protection_settings: - ServerAdvancedThreatProtectionSettingsOperations operations - :vartype server_advanced_threat_protection_settings: - azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations - :ivar server_advisors: ServerAdvisorsOperations operations - :vartype server_advisors: azure.mgmt.sql.operations.ServerAdvisorsOperations - :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations - :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations :ivar server_azure_ad_administrators: ServerAzureADAdministratorsOperations operations :vartype server_azure_ad_administrators: azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations @@ -513,81 +432,28 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype server_dns_aliases: azure.mgmt.sql.operations.ServerDnsAliasesOperations :ivar server_keys: ServerKeysOperations operations :vartype server_keys: azure.mgmt.sql.operations.ServerKeysOperations - :ivar server_operations: ServerOperationsOperations operations - :vartype server_operations: azure.mgmt.sql.operations.ServerOperationsOperations - :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar server_security_alert_policies: ServerSecurityAlertPoliciesOperations operations :vartype server_security_alert_policies: azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations :ivar server_trust_certificates: ServerTrustCertificatesOperations operations :vartype server_trust_certificates: azure.mgmt.sql.operations.ServerTrustCertificatesOperations - :ivar server_trust_groups: ServerTrustGroupsOperations operations - :vartype server_trust_groups: azure.mgmt.sql.operations.ServerTrustGroupsOperations - :ivar server_usages: ServerUsagesOperations operations - :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations :ivar server_vulnerability_assessments: ServerVulnerabilityAssessmentsOperations operations :vartype server_vulnerability_assessments: azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations - :ivar sql_agent: SqlAgentOperations operations - :vartype sql_agent: azure.mgmt.sql.operations.SqlAgentOperations - :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations - operations - :vartype sql_vulnerability_assessment_baseline: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselineOperations - :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations - operations - :vartype sql_vulnerability_assessment_baselines: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations - :ivar sql_vulnerability_assessment_execute_scan: - SqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations - :ivar sql_vulnerability_assessment_rule_baseline: - SqlVulnerabilityAssessmentRuleBaselineOperations operations - :vartype sql_vulnerability_assessment_rule_baseline: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselineOperations - :ivar sql_vulnerability_assessment_rule_baselines: - SqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations - operations - :vartype sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScanResultOperations - :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations - :vartype sql_vulnerability_assessment_scans: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentScansOperations - :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations - operations - :vartype sql_vulnerability_assessments_settings: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsSettingsOperations - :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations - :vartype sql_vulnerability_assessments: - azure.mgmt.sql.operations.SqlVulnerabilityAssessmentsOperations :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations operations :vartype start_stop_managed_instance_schedules: azure.mgmt.sql.operations.StartStopManagedInstanceSchedulesOperations :ivar subscription_usages: SubscriptionUsagesOperations operations :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations - :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations - :vartype synapse_link_workspaces: azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations :ivar sync_agents: SyncAgentsOperations operations :vartype sync_agents: azure.mgmt.sql.operations.SyncAgentsOperations :ivar sync_groups: SyncGroupsOperations operations :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations :ivar sync_members: SyncMembersOperations operations :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations - :ivar tde_certificates: TdeCertificatesOperations operations - :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations :ivar time_zones: TimeZonesOperations operations :vartype time_zones: azure.mgmt.sql.operations.TimeZonesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: - azure.mgmt.sql.operations.TransparentDataEncryptionsOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.sql.operations.UsagesOperations :ivar virtual_clusters: VirtualClustersOperations operations :vartype virtual_clusters: azure.mgmt.sql.operations.VirtualClustersOperations :ivar virtual_network_rules: VirtualNetworkRulesOperations operations @@ -596,17 +462,151 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations + operations + :vartype managed_database_sensitivity_labels: + azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations + :vartype database_encryption_protectors: + azure.mgmt.sql.operations.DatabaseEncryptionProtectorsOperations + :ivar database_operations: DatabaseOperationsOperations operations + :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperationsOperations + :ivar database_usages: DatabaseUsagesOperations operations + :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations + :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations + :vartype recommended_sensitivity_labels: + azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations + :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations + :vartype synapse_link_workspaces: azure.mgmt.sql.operations.SynapseLinkWorkspacesOperations + :ivar server_operations: ServerOperationsOperations operations + :vartype server_operations: azure.mgmt.sql.operations.ServerOperationsOperations + :ivar server_usages: ServerUsagesOperations operations + :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations + :ivar tde_certificates: TdeCertificatesOperations operations + :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations + :ivar database_advanced_threat_protection_settings: + DatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype database_advanced_threat_protection_settings: + azure.mgmt.sql.operations.DatabaseAdvancedThreatProtectionSettingsOperations + :ivar database_advisors: DatabaseAdvisorsOperations operations + :vartype database_advisors: azure.mgmt.sql.operations.DatabaseAdvisorsOperations + :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations + :vartype database_automatic_tuning: azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations + :ivar database_extensions: DatabaseExtensionsOperations operations + :vartype database_extensions: azure.mgmt.sql.operations.DatabaseExtensionsOperations + :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations + :vartype database_recommended_actions: + azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations + operations + :vartype sql_vulnerability_assessment_baselines: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_execute_scan: + SqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_rule_baselines: + SqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScansOperations + operations + :vartype database_vulnerability_assessment_scans: + azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar data_masking_rules: DataMaskingRulesOperations operations + :vartype data_masking_rules: azure.mgmt.sql.operations.DataMaskingRulesOperations + :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations + :vartype data_warehouse_user_activities: + azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations + :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations + :vartype managed_database_security_events: + azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations + :ivar managed_database_recommended_sensitivity_labels: + ManagedDatabaseRecommendedSensitivityLabelsOperations operations + :vartype managed_database_recommended_sensitivity_labels: + azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations + :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations + :vartype managed_instance_tde_certificates: + azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations + :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations + :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperationsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations + :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations + :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations + :vartype maintenance_window_options: + azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations + :ivar maintenance_windows: MaintenanceWindowsOperations operations + :vartype maintenance_windows: azure.mgmt.sql.operations.MaintenanceWindowsOperations + :ivar managed_database_advanced_threat_protection_settings: + ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype managed_database_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations + :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations + :vartype managed_database_move_operations: + azure.mgmt.sql.operations.ManagedDatabaseMoveOperationsOperations + :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations + :vartype managed_database_queries: azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations + :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations + :vartype managed_database_restore_details: + azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations + :ivar managed_database_transparent_data_encryption: + ManagedDatabaseTransparentDataEncryptionOperations operations + :vartype managed_database_transparent_data_encryption: + azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations + :ivar managed_instance_advanced_threat_protection_settings: + ManagedInstanceAdvancedThreatProtectionSettingsOperations operations + :vartype managed_instance_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations + :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations + operations + :vartype managed_instance_private_link_resources: + azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations + :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations + :vartype managed_ledger_digest_uploads: + azure.mgmt.sql.operations.ManagedLedgerDigestUploadsOperations + :ivar server_advanced_threat_protection_settings: + ServerAdvancedThreatProtectionSettingsOperations operations + :vartype server_advanced_threat_protection_settings: + azure.mgmt.sql.operations.ServerAdvancedThreatProtectionSettingsOperations + :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations + :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations + :ivar sql_agent: SqlAgentOperations operations + :vartype sql_agent: azure.mgmt.sql.operations.SqlAgentOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.sql.operations.TransparentDataEncryptionsOperations + :ivar capabilities: CapabilitiesOperations operations + :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID that identifies an Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-02-01-preview". Default value is "2025-02-01-preview". Note that overriding this default + value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -621,14 +621,16 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) - self._config = SqlManagementClientConfiguration( + self._config = SqlClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -652,105 +654,114 @@ def __init__( policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None, self._config.http_logging_policy, ] - self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs) + self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, _endpoint), policies=_policies, **kwargs) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( + self.database_columns = DatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( + self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sensitivity_labels = SensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( + self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_advisors = DatabaseAdvisorsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_automatic_tuning = DatabaseAutomaticTuningOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_columns = DatabaseColumnsOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_extensions = DatabaseExtensionsOperations( + self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_columns = ManagedDatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_operations = DatabaseOperationsOperations( + self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_tables = ManagedDatabaseTablesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_recommended_actions = DatabaseRecommendedActionsOperations( + self.database_schemas = DatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) - self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_schemas = DatabaseSchemasOperations( + self.managed_database_schemas = ManagedDatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( + self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self._client, self._config, self._serialize, self._deserialize ) self.database_sql_vulnerability_assessment_rule_baselines = ( DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) ) + self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_vulnerability_assessment_rule_baselines = ( + ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) self.data_masking_policies = DataMaskingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_masking_rules = DataMaskingRulesOperations( + self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self.server_trust_groups = ServerTrustGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_operations = ElasticPoolOperationsOperations( + self.managed_instances = ManagedInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -761,7 +772,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.geo_backup_policies = GeoBackupPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -775,28 +785,24 @@ def __init__( self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_credentials = JobCredentialsOperations(self._client, self._config, self._serialize, self._deserialize) - self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.job_private_endpoints = JobPrivateEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_step_executions = JobStepExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_steps = JobStepsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_target_executions = JobTargetExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_target_groups = JobTargetGroupsOperations( + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_private_endpoints = JobPrivateEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self.job_steps = JobStepsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_target_groups = JobTargetGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.long_term_retention_backups = LongTermRetentionBackupsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -806,266 +812,261 @@ def __init__( self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.maintenance_window_options = MaintenanceWindowOptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.maintenance_windows = MaintenanceWindowsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( + ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.managed_database_columns = ManagedDatabaseColumnsOperations( + self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_queries = ManagedDatabaseQueriesOperations( + self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_schemas = ManagedDatabaseSchemasOperations( + self.managed_instance_keys = ManagedInstanceKeysOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( + self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( + self.managed_instance_operations = ManagedInstanceOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self.managed_instance_private_endpoint_connections = ManagedInstancePrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_tables = ManagedDatabaseTablesOperations( + self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_transparent_data_encryption = ManagedDatabaseTransparentDataEncryptionOperations( + self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_vulnerability_assessment_rule_baselines = ( - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations( + self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( + self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( + self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_keys = ManagedInstanceKeysOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_operations = ManagedInstanceOperationsOperations( + self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_private_endpoint_connections = ManagedInstancePrivateEndpointConnectionsOperations( + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( + self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( + self.server_dns_aliases = ServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.server_trust_certificates = ServerTrustCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( + self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( + self.subscription_usages = SubscriptionUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.outbound_firewall_rules = OutboundFirewallRulesOperations( + self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) + self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) + self.virtual_clusters = VirtualClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.private_link_resources = PrivateLinkResourcesOperations( + self.workload_classifiers = WorkloadClassifiersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.database_operations = DatabaseOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sensitivity_labels = SensitivityLabelsOperations( + self.server_operations = ServerOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( + self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.tde_certificates = TdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( + self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_automatic_tuning = ServerAutomaticTuningOperations( + self.database_advisors = DatabaseAdvisorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( + self.database_automatic_tuning = DatabaseAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( + self.database_extensions = DatabaseExtensionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_connection_policies = ServerConnectionPoliciesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( + self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_dns_aliases = ServerDnsAliasesOperations( + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_operations = ServerOperationsOperations( + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( + self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_certificates = ServerTrustCertificatesOperations( + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_groups = ServerTrustGroupsOperations( + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( + self.data_masking_rules = DataMaskingRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) - self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( + self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( + self.elastic_pool_operations = ElasticPoolOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.ledger_digest_uploads = LedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( + self.maintenance_window_options = MaintenanceWindowOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self.maintenance_windows = MaintenanceWindowsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.managed_database_queries = ManagedDatabaseQueriesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.subscription_usages = SubscriptionUsagesOperations( + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self.managed_database_transparent_data_encryption = ManagedDatabaseTransparentDataEncryptionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) - self.tde_certificates = TdeCertificatesOperations( + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_clusters = VirtualClustersOperations( + self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.virtual_network_rules = VirtualNetworkRulesOperations( + self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_classifiers = WorkloadClassifiersOperations( + self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: + def send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = client._send_request(request) + >>> response = client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -1078,7 +1079,11 @@ def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore def close(self) -> None: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py index 4abe2d42c73f..8a5fa8c55924 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,21 +18,24 @@ from azure.core.credentials import TokenCredential -class SqlManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for SqlManagementClient. +class SqlClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for SqlClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials.TokenCredential - :param subscription_id: The subscription ID that identifies an Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-02-01-preview". Default value is "2025-02-01-preview". Note that overriding this default + value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,10 +43,11 @@ def __init__( self, credential: "TokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-01") + api_version: str = kwargs.pop("api_version", "2025-02-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) 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 17dbc073e01b..87676c65a8f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py @@ -1,32 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level -# 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(): - pass + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/__init__.py index 0af9b28f6607..8026245c2abc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/__init__.py @@ -1,6 +1,6 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/model_base.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/model_base.py new file mode 100644 index 000000000000..a75a22adbb97 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/model_base.py @@ -0,0 +1,1368 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=protected-access, broad-except + +import copy +import calendar +import decimal +import functools +import sys +import logging +import base64 +import re +import typing +import enum +import email.utils +from datetime import datetime, date, time, timedelta, timezone +from json import JSONEncoder +import xml.etree.ElementTree as ET +from collections.abc import MutableMapping +from typing_extensions import Self +import isodate +from azure.core.exceptions import DeserializationError +from azure.core import CaseInsensitiveEnumMeta +from azure.core.pipeline import PipelineResponse +from azure.core.serialization import _Null +from azure.core.rest import HttpResponse + +_LOGGER = logging.getLogger(__name__) + +__all__ = ["SdkJSONEncoder", "Model", "rest_field", "rest_discriminator"] + +TZ_UTC = timezone.utc +_T = typing.TypeVar("_T") +_NONE_TYPE = type(None) + + +def _timedelta_as_isostr(td: timedelta) -> str: + """Converts a datetime.timedelta object into an ISO 8601 formatted string, e.g. 'P4DT12H30M05S' + + Function adapted from the Tin Can Python project: https://github.com/RusticiSoftware/TinCanPython + + :param timedelta td: The timedelta to convert + :rtype: str + :return: ISO8601 version of this timedelta + """ + + # Split seconds to larger units + seconds = td.total_seconds() + minutes, seconds = divmod(seconds, 60) + hours, minutes = divmod(minutes, 60) + days, hours = divmod(hours, 24) + + days, hours, minutes = list(map(int, (days, hours, minutes))) + seconds = round(seconds, 6) + + # Build date + date_str = "" + if days: + date_str = "%sD" % days + + if hours or minutes or seconds: + # Build time + time_str = "T" + + # Hours + bigger_exists = date_str or hours + if bigger_exists: + time_str += "{:02}H".format(hours) + + # Minutes + bigger_exists = bigger_exists or minutes + if bigger_exists: + time_str += "{:02}M".format(minutes) + + # Seconds + try: + if seconds.is_integer(): + seconds_string = "{:02}".format(int(seconds)) + else: + # 9 chars long w/ leading 0, 6 digits after decimal + seconds_string = "%09.6f" % seconds + # Remove trailing zeros + seconds_string = seconds_string.rstrip("0") + except AttributeError: # int.is_integer() raises + seconds_string = "{:02}".format(seconds) + + time_str += "{}S".format(seconds_string) + else: + time_str = "" + + return "P" + date_str + time_str + + +def _serialize_bytes(o, format: typing.Optional[str] = None) -> str: + encoded = base64.b64encode(o).decode() + if format == "base64url": + return encoded.strip("=").replace("+", "-").replace("/", "_") + return encoded + + +def _serialize_datetime(o, format: typing.Optional[str] = None): + if hasattr(o, "year") and hasattr(o, "hour"): + if format == "rfc7231": + return email.utils.format_datetime(o, usegmt=True) + if format == "unix-timestamp": + return int(calendar.timegm(o.utctimetuple())) + + # astimezone() fails for naive times in Python 2.7, so make make sure o is aware (tzinfo is set) + if not o.tzinfo: + iso_formatted = o.replace(tzinfo=TZ_UTC).isoformat() + else: + iso_formatted = o.astimezone(TZ_UTC).isoformat() + # Replace the trailing "+00:00" UTC offset with "Z" (RFC 3339: https://www.ietf.org/rfc/rfc3339.txt) + return iso_formatted.replace("+00:00", "Z") + # Next try datetime.date or datetime.time + return o.isoformat() + + +def _is_readonly(p): + try: + return p._visibility == ["read"] + except AttributeError: + return False + + +class SdkJSONEncoder(JSONEncoder): + """A JSON encoder that's capable of serializing datetime objects and bytes.""" + + def __init__(self, *args, exclude_readonly: bool = False, format: typing.Optional[str] = None, **kwargs): + super().__init__(*args, **kwargs) + self.exclude_readonly = exclude_readonly + self.format = format + + def default(self, o): # pylint: disable=too-many-return-statements + if _is_model(o): + if self.exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + return {k: v for k, v in o.items() if k not in readonly_props} + return dict(o.items()) + try: + return super(SdkJSONEncoder, self).default(o) + except TypeError: + if isinstance(o, _Null): + return None + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, self.format) + try: + # First try datetime.datetime + return _serialize_datetime(o, self.format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return super(SdkJSONEncoder, self).default(o) + + +_VALID_DATE = re.compile(r"\d{4}[-]\d{2}[-]\d{2}T\d{2}:\d{2}:\d{2}" + r"\.?\d*Z?[-+]?[\d{2}]?:?[\d{2}]?") +_VALID_RFC7231 = re.compile( + r"(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s\d{2}\s" + r"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s\d{4}\s\d{2}:\d{2}:\d{2}\sGMT" +) + +_ARRAY_ENCODE_MAPPING = { + "pipeDelimited": "|", + "spaceDelimited": " ", + "commaDelimited": ",", + "newlineDelimited": "\n", +} + + +def _deserialize_array_encoded(delimit: str, attr): + if isinstance(attr, str): + if attr == "": + return [] + return attr.split(delimit) + return attr + + +def _deserialize_datetime(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize ISO-8601 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + attr = attr.upper() + match = _VALID_DATE.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + check_decimal = attr.split(".") + if len(check_decimal) > 1: + decimal_str = "" + for digit in check_decimal[1]: + if digit.isdigit(): + decimal_str += digit + else: + break + if len(decimal_str) > 6: + attr = attr.replace(decimal_str, decimal_str[0:6]) + + date_obj = isodate.parse_datetime(attr) + test_utc = date_obj.utctimetuple() + if test_utc.tm_year > 9999 or test_utc.tm_year < 1: + raise OverflowError("Hit max or min date") + return date_obj # type: ignore[no-any-return] + + +def _deserialize_datetime_rfc7231(attr: typing.Union[str, datetime]) -> datetime: + """Deserialize RFC7231 formatted string into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + match = _VALID_RFC7231.match(attr) + if not match: + raise ValueError("Invalid datetime string: " + attr) + + return email.utils.parsedate_to_datetime(attr) + + +def _deserialize_datetime_unix_timestamp(attr: typing.Union[float, datetime]) -> datetime: + """Deserialize unix timestamp into Datetime object. + + :param str attr: response string to be deserialized. + :rtype: ~datetime.datetime + :returns: The datetime object from that input + """ + if isinstance(attr, datetime): + # i'm already deserialized + return attr + return datetime.fromtimestamp(attr, TZ_UTC) + + +def _deserialize_date(attr: typing.Union[str, date]) -> date: + """Deserialize ISO-8601 formatted string into Date object. + :param str attr: response string to be deserialized. + :rtype: date + :returns: The date object from that input + """ + # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception. + if isinstance(attr, date): + return attr + return isodate.parse_date(attr, defaultmonth=None, defaultday=None) # type: ignore + + +def _deserialize_time(attr: typing.Union[str, time]) -> time: + """Deserialize ISO-8601 formatted string into time object. + + :param str attr: response string to be deserialized. + :rtype: datetime.time + :returns: The time object from that input + """ + if isinstance(attr, time): + return attr + return isodate.parse_time(attr) # type: ignore[no-any-return] + + +def _deserialize_bytes(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + return bytes(base64.b64decode(attr)) + + +def _deserialize_bytes_base64(attr): + if isinstance(attr, (bytes, bytearray)): + return attr + padding = "=" * (3 - (len(attr) + 3) % 4) # type: ignore + attr = attr + padding # type: ignore + encoded = attr.replace("-", "+").replace("_", "/") + return bytes(base64.b64decode(encoded)) + + +def _deserialize_duration(attr): + if isinstance(attr, timedelta): + return attr + return isodate.parse_duration(attr) + + +def _deserialize_decimal(attr): + if isinstance(attr, decimal.Decimal): + return attr + return decimal.Decimal(str(attr)) + + +def _deserialize_int_as_str(attr): + if isinstance(attr, int): + return attr + return int(attr) + + +_DESERIALIZE_MAPPING = { + datetime: _deserialize_datetime, + date: _deserialize_date, + time: _deserialize_time, + bytes: _deserialize_bytes, + bytearray: _deserialize_bytes, + timedelta: _deserialize_duration, + typing.Any: lambda x: x, + decimal.Decimal: _deserialize_decimal, +} + +_DESERIALIZE_MAPPING_WITHFORMAT = { + "rfc3339": _deserialize_datetime, + "rfc7231": _deserialize_datetime_rfc7231, + "unix-timestamp": _deserialize_datetime_unix_timestamp, + "base64": _deserialize_bytes, + "base64url": _deserialize_bytes_base64, +} + + +def get_deserializer(annotation: typing.Any, rf: typing.Optional["_RestField"] = None): + if annotation is int and rf and rf._format == "str": + return _deserialize_int_as_str + if annotation is str and rf and rf._format in _ARRAY_ENCODE_MAPPING: + return functools.partial(_deserialize_array_encoded, _ARRAY_ENCODE_MAPPING[rf._format]) + if rf and rf._format: + return _DESERIALIZE_MAPPING_WITHFORMAT.get(rf._format) + return _DESERIALIZE_MAPPING.get(annotation) # pyright: ignore + + +def _get_type_alias_type(module_name: str, alias_name: str): + types = { + k: v + for k, v in sys.modules[module_name].__dict__.items() + if isinstance(v, typing._GenericAlias) # type: ignore + } + if alias_name not in types: + return alias_name + return types[alias_name] + + +def _get_model(module_name: str, model_name: str): + models = {k: v for k, v in sys.modules[module_name].__dict__.items() if isinstance(v, type)} + module_end = module_name.rsplit(".", 1)[0] + models.update({k: v for k, v in sys.modules[module_end].__dict__.items() if isinstance(v, type)}) + if isinstance(model_name, str): + model_name = model_name.split(".")[-1] + if model_name not in models: + return model_name + return models[model_name] + + +_UNSET = object() + + +class _MyMutableMapping(MutableMapping[str, typing.Any]): + def __init__(self, data: dict[str, typing.Any]) -> None: + self._data = data + + def __contains__(self, key: typing.Any) -> bool: + return key in self._data + + def __getitem__(self, key: str) -> typing.Any: + # If this key has been deserialized (for mutable types), we need to handle serialization + if hasattr(self, "_attr_to_rest_field"): + cache_attr = f"_deserialized_{key}" + if hasattr(self, cache_attr): + rf = _get_rest_field(getattr(self, "_attr_to_rest_field"), key) + if rf: + value = self._data.get(key) + if isinstance(value, (dict, list, set)): + # For mutable types, serialize and return + # But also update _data with serialized form and clear flag + # so mutations via this returned value affect _data + serialized = _serialize(value, rf._format) + # If serialized form is same type (no transformation needed), + # return _data directly so mutations work + if isinstance(serialized, type(value)) and serialized == value: + return self._data.get(key) + # Otherwise return serialized copy and clear flag + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + # Store serialized form back + self._data[key] = serialized + return serialized + return self._data.__getitem__(key) + + def __setitem__(self, key: str, value: typing.Any) -> None: + # Clear any cached deserialized value when setting through dictionary access + cache_attr = f"_deserialized_{key}" + try: + object.__delattr__(self, cache_attr) + except AttributeError: + pass + self._data.__setitem__(key, value) + + def __delitem__(self, key: str) -> None: + self._data.__delitem__(key) + + def __iter__(self) -> typing.Iterator[typing.Any]: + return self._data.__iter__() + + def __len__(self) -> int: + return self._data.__len__() + + def __ne__(self, other: typing.Any) -> bool: + return not self.__eq__(other) + + def keys(self) -> typing.KeysView[str]: + """ + :returns: a set-like object providing a view on D's keys + :rtype: ~typing.KeysView + """ + return self._data.keys() + + def values(self) -> typing.ValuesView[typing.Any]: + """ + :returns: an object providing a view on D's values + :rtype: ~typing.ValuesView + """ + return self._data.values() + + def items(self) -> typing.ItemsView[str, typing.Any]: + """ + :returns: set-like object providing a view on D's items + :rtype: ~typing.ItemsView + """ + return self._data.items() + + def get(self, key: str, default: typing.Any = None) -> typing.Any: + """ + Get the value for key if key is in the dictionary, else default. + :param str key: The key to look up. + :param any default: The value to return if key is not in the dictionary. Defaults to None + :returns: D[k] if k in D, else d. + :rtype: any + """ + try: + return self[key] + except KeyError: + return default + + @typing.overload + def pop(self, key: str) -> typing.Any: ... # pylint: disable=arguments-differ + + @typing.overload + def pop(self, key: str, default: _T) -> _T: ... # pylint: disable=signature-differs + + @typing.overload + def pop(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def pop(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Removes specified key and return the corresponding value. + :param str key: The key to pop. + :param any default: The value to return if key is not in the dictionary + :returns: The value corresponding to the key. + :rtype: any + :raises KeyError: If key is not found and default is not given. + """ + if default is _UNSET: + return self._data.pop(key) + return self._data.pop(key, default) + + def popitem(self) -> tuple[str, typing.Any]: + """ + Removes and returns some (key, value) pair + :returns: The (key, value) pair. + :rtype: tuple + :raises KeyError: if D is empty. + """ + return self._data.popitem() + + def clear(self) -> None: + """ + Remove all items from D. + """ + self._data.clear() + + def update(self, *args: typing.Any, **kwargs: typing.Any) -> None: # pylint: disable=arguments-differ + """ + Updates D from mapping/iterable E and F. + :param any args: Either a mapping object or an iterable of key-value pairs. + """ + self._data.update(*args, **kwargs) + + @typing.overload + def setdefault(self, key: str, default: None = None) -> None: ... + + @typing.overload + def setdefault(self, key: str, default: typing.Any) -> typing.Any: ... # pylint: disable=signature-differs + + def setdefault(self, key: str, default: typing.Any = _UNSET) -> typing.Any: + """ + Same as calling D.get(k, d), and setting D[k]=d if k not found + :param str key: The key to look up. + :param any default: The value to set if key is not in the dictionary + :returns: D[k] if k in D, else d. + :rtype: any + """ + if default is _UNSET: + return self._data.setdefault(key) + return self._data.setdefault(key, default) + + def __eq__(self, other: typing.Any) -> bool: + if isinstance(other, _MyMutableMapping): + return self._data == other._data + try: + other_model = self.__class__(other) + except Exception: + return False + return self._data == other_model._data + + def __repr__(self) -> str: + return str(self._data) + + +def _is_model(obj: typing.Any) -> bool: + return getattr(obj, "_is_model", False) + + +def _serialize(o, format: typing.Optional[str] = None): # pylint: disable=too-many-return-statements + if isinstance(o, list): + if format in _ARRAY_ENCODE_MAPPING and all(isinstance(x, str) for x in o): + return _ARRAY_ENCODE_MAPPING[format].join(o) + return [_serialize(x, format) for x in o] + if isinstance(o, dict): + return {k: _serialize(v, format) for k, v in o.items()} + if isinstance(o, set): + return {_serialize(x, format) for x in o} + if isinstance(o, tuple): + return tuple(_serialize(x, format) for x in o) + if isinstance(o, (bytes, bytearray)): + return _serialize_bytes(o, format) + if isinstance(o, decimal.Decimal): + return float(o) + if isinstance(o, enum.Enum): + return o.value + if isinstance(o, int): + if format == "str": + return str(o) + return o + try: + # First try datetime.datetime + return _serialize_datetime(o, format) + except AttributeError: + pass + # Last, try datetime.timedelta + try: + return _timedelta_as_isostr(o) + except AttributeError: + # This will be raised when it hits value.total_seconds in the method above + pass + return o + + +def _get_rest_field(attr_to_rest_field: dict[str, "_RestField"], rest_name: str) -> typing.Optional["_RestField"]: + try: + return next(rf for rf in attr_to_rest_field.values() if rf._rest_name == rest_name) + except StopIteration: + return None + + +def _create_value(rf: typing.Optional["_RestField"], value: typing.Any) -> typing.Any: + if not rf: + return _serialize(value, None) + if rf._is_multipart_file_input: + return value + if rf._is_model: + return _deserialize(rf._type, value) + if isinstance(value, ET.Element): + value = _deserialize(rf._type, value) + return _serialize(value, rf._format) + + +class Model(_MyMutableMapping): + _is_model = True + # label whether current class's _attr_to_rest_field has been calculated + # could not see _attr_to_rest_field directly because subclass inherits it from parent class + _calculated: set[str] = set() + + def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: + class_name = self.__class__.__name__ + if len(args) > 1: + raise TypeError(f"{class_name}.__init__() takes 2 positional arguments but {len(args) + 1} were given") + dict_to_pass = { + rest_field._rest_name: rest_field._default + for rest_field in self._attr_to_rest_field.values() + if rest_field._default is not _UNSET + } + if args: # pylint: disable=too-many-nested-blocks + if isinstance(args[0], ET.Element): + existed_attr_keys = [] + model_meta = getattr(self, "_xml", {}) + + for rf in self._attr_to_rest_field.values(): + prop_meta = getattr(rf, "_xml", {}) + xml_name = prop_meta.get("name", rf._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + # attribute + if prop_meta.get("attribute", False) and args[0].get(xml_name) is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].get(xml_name)) + continue + + # unwrapped element is array + if prop_meta.get("unwrapped", False): + # unwrapped array could either use prop items meta/prop meta + if prop_meta.get("itemsName"): + xml_name = prop_meta.get("itemsName") + xml_ns = prop_meta.get("itemNs") + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + items = args[0].findall(xml_name) # pyright: ignore + if len(items) > 0: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, items) + elif not rf._is_optional: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = [] + continue + + # text element is primitive type + if prop_meta.get("text", False): + if args[0].text is not None: + dict_to_pass[rf._rest_name] = _deserialize(rf._type, args[0].text) + continue + + # wrapped element could be normal property or array, it should only have one element + item = args[0].find(xml_name) + if item is not None: + existed_attr_keys.append(xml_name) + dict_to_pass[rf._rest_name] = _deserialize(rf._type, item) + + # rest thing is additional properties + for e in args[0]: + if e.tag not in existed_attr_keys: + dict_to_pass[e.tag] = _convert_element(e) + else: + dict_to_pass.update( + {k: _create_value(_get_rest_field(self._attr_to_rest_field, k), v) for k, v in args[0].items()} + ) + else: + non_attr_kwargs = [k for k in kwargs if k not in self._attr_to_rest_field] + if non_attr_kwargs: + # actual type errors only throw the first wrong keyword arg they see, so following that. + raise TypeError(f"{class_name}.__init__() got an unexpected keyword argument '{non_attr_kwargs[0]}'") + dict_to_pass.update( + { + self._attr_to_rest_field[k]._rest_name: _create_value(self._attr_to_rest_field[k], v) + for k, v in kwargs.items() + if v is not None + } + ) + super().__init__(dict_to_pass) + + def copy(self) -> "Model": + return Model(self.__dict__) + + def __new__(cls, *args: typing.Any, **kwargs: typing.Any) -> Self: + if f"{cls.__module__}.{cls.__qualname__}" not in cls._calculated: + # we know the last nine classes in mro are going to be 'Model', '_MyMutableMapping', 'MutableMapping', + # 'Mapping', 'Collection', 'Sized', 'Iterable', 'Container' and 'object' + mros = cls.__mro__[:-9][::-1] # ignore parents, and reverse the mro order + attr_to_rest_field: dict[str, _RestField] = { # map attribute name to rest_field property + k: v for mro_class in mros for k, v in mro_class.__dict__.items() if k[0] != "_" and hasattr(v, "_type") + } + annotations = { + k: v + for mro_class in mros + if hasattr(mro_class, "__annotations__") + for k, v in mro_class.__annotations__.items() + } + for attr, rf in attr_to_rest_field.items(): + rf._module = cls.__module__ + if not rf._type: + rf._type = rf._get_deserialize_callable_from_annotation(annotations.get(attr, None)) + if not rf._rest_name_input: + rf._rest_name_input = attr + cls._attr_to_rest_field: dict[str, _RestField] = dict(attr_to_rest_field.items()) + cls._backcompat_attr_to_rest_field: dict[str, _RestField] = { + Model._get_backcompat_attribute_name(cls._attr_to_rest_field, attr): rf + for attr, rf in cls._attr_to_rest_field.items() + } + cls._calculated.add(f"{cls.__module__}.{cls.__qualname__}") + + return super().__new__(cls) + + def __init_subclass__(cls, discriminator: typing.Optional[str] = None) -> None: + for base in cls.__bases__: + if hasattr(base, "__mapping__"): + base.__mapping__[discriminator or cls.__name__] = cls # type: ignore + + @classmethod + def _get_backcompat_attribute_name(cls, attr_to_rest_field: dict[str, "_RestField"], attr_name: str) -> str: + rest_field_obj = attr_to_rest_field.get(attr_name) # pylint: disable=protected-access + if rest_field_obj is None: + return attr_name + original_tsp_name = getattr(rest_field_obj, "_original_tsp_name", None) # pylint: disable=protected-access + if original_tsp_name: + return original_tsp_name + return attr_name + + @classmethod + def _get_discriminator(cls, exist_discriminators) -> typing.Optional["_RestField"]: + for v in cls.__dict__.values(): + if isinstance(v, _RestField) and v._is_discriminator and v._rest_name not in exist_discriminators: + return v + return None + + @classmethod + def _deserialize(cls, data, exist_discriminators): + if not hasattr(cls, "__mapping__"): + return cls(data) + discriminator = cls._get_discriminator(exist_discriminators) + if discriminator is None: + return cls(data) + exist_discriminators.append(discriminator._rest_name) + if isinstance(data, ET.Element): + model_meta = getattr(cls, "_xml", {}) + prop_meta = getattr(discriminator, "_xml", {}) + xml_name = prop_meta.get("name", discriminator._rest_name) + xml_ns = prop_meta.get("ns", model_meta.get("ns", None)) + if xml_ns: + xml_name = "{" + xml_ns + "}" + xml_name + + if data.get(xml_name) is not None: + discriminator_value = data.get(xml_name) + else: + discriminator_value = data.find(xml_name).text # pyright: ignore + else: + discriminator_value = data.get(discriminator._rest_name) + mapped_cls = cls.__mapping__.get(discriminator_value, cls) # pyright: ignore # pylint: disable=no-member + return mapped_cls._deserialize(data, exist_discriminators) + + def as_dict(self, *, exclude_readonly: bool = False) -> dict[str, typing.Any]: + """Return a dict that can be turned into json using json.dump. + + :keyword bool exclude_readonly: Whether to remove the readonly properties. + :returns: A dict JSON compatible object + :rtype: dict + """ + + result = {} + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in self._attr_to_rest_field.values() if _is_readonly(p)] + for k, v in self.items(): + if exclude_readonly and k in readonly_props: # pyright: ignore + continue + is_multipart_file_input = False + try: + is_multipart_file_input = next( + rf for rf in self._attr_to_rest_field.values() if rf._rest_name == k + )._is_multipart_file_input + except StopIteration: + pass + result[k] = v if is_multipart_file_input else Model._as_dict_value(v, exclude_readonly=exclude_readonly) + return result + + @staticmethod + def _as_dict_value(v: typing.Any, exclude_readonly: bool = False) -> typing.Any: + if v is None or isinstance(v, _Null): + return None + if isinstance(v, (list, tuple, set)): + return type(v)(Model._as_dict_value(x, exclude_readonly=exclude_readonly) for x in v) + if isinstance(v, dict): + return {dk: Model._as_dict_value(dv, exclude_readonly=exclude_readonly) for dk, dv in v.items()} + return v.as_dict(exclude_readonly=exclude_readonly) if hasattr(v, "as_dict") else v + + +def _deserialize_model(model_deserializer: typing.Optional[typing.Callable], obj): + if _is_model(obj): + return obj + return _deserialize(model_deserializer, obj) + + +def _deserialize_with_optional(if_obj_deserializer: typing.Optional[typing.Callable], obj): + if obj is None: + return obj + return _deserialize_with_callable(if_obj_deserializer, obj) + + +def _deserialize_with_union(deserializers, obj): + for deserializer in deserializers: + try: + return _deserialize(deserializer, obj) + except DeserializationError: + pass + raise DeserializationError() + + +def _deserialize_dict( + value_deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj: dict[typing.Any, typing.Any], +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = {child.tag: child for child in obj} + return {k: _deserialize(value_deserializer, v, module) for k, v in obj.items()} + + +def _deserialize_multiple_sequence( + entry_deserializers: list[typing.Optional[typing.Callable]], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + return type(obj)(_deserialize(deserializer, entry, module) for entry, deserializer in zip(obj, entry_deserializers)) + + +def _is_array_encoded_deserializer(deserializer: functools.partial) -> bool: + return ( + isinstance(deserializer, functools.partial) + and isinstance(deserializer.args[0], functools.partial) + and deserializer.args[0].func == _deserialize_array_encoded # pylint: disable=comparison-with-callable + ) + + +def _deserialize_sequence( + deserializer: typing.Optional[typing.Callable], + module: typing.Optional[str], + obj, +): + if obj is None: + return obj + if isinstance(obj, ET.Element): + obj = list(obj) + + # encoded string may be deserialized to sequence + if isinstance(obj, str) and isinstance(deserializer, functools.partial): + # for list[str] + if _is_array_encoded_deserializer(deserializer): + return deserializer(obj) + + # for list[Union[...]] + if isinstance(deserializer.args[0], list): + for sub_deserializer in deserializer.args[0]: + if _is_array_encoded_deserializer(sub_deserializer): + return sub_deserializer(obj) + + return type(obj)(_deserialize(deserializer, entry, module) for entry in obj) + + +def _sorted_annotations(types: list[typing.Any]) -> list[typing.Any]: + return sorted( + types, + key=lambda x: hasattr(x, "__name__") and x.__name__.lower() in ("str", "float", "int", "bool"), + ) + + +def _get_deserialize_callable_from_annotation( # pylint: disable=too-many-return-statements, too-many-statements, too-many-branches + annotation: typing.Any, + module: typing.Optional[str], + rf: typing.Optional["_RestField"] = None, +) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + if not annotation: + return None + + # is it a type alias? + if isinstance(annotation, str): + if module is not None: + annotation = _get_type_alias_type(module, annotation) + + # is it a forward ref / in quotes? + if isinstance(annotation, (str, typing.ForwardRef)): + try: + model_name = annotation.__forward_arg__ # type: ignore + except AttributeError: + model_name = annotation + if module is not None: + annotation = _get_model(module, model_name) # type: ignore + + try: + if module and _is_model(annotation): + if rf: + rf._is_model = True + + return functools.partial(_deserialize_model, annotation) # pyright: ignore + except Exception: + pass + + # is it a literal? + try: + if annotation.__origin__ is typing.Literal: # pyright: ignore + return None + except AttributeError: + pass + + # is it optional? + try: + if any(a is _NONE_TYPE for a in annotation.__args__): # pyright: ignore + if rf: + rf._is_optional = True + if len(annotation.__args__) <= 2: # pyright: ignore + if_obj_deserializer = _get_deserialize_callable_from_annotation( + next(a for a in annotation.__args__ if a is not _NONE_TYPE), module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_with_optional, if_obj_deserializer) + # the type is Optional[Union[...]], we need to remove the None type from the Union + annotation_copy = copy.copy(annotation) + annotation_copy.__args__ = [a for a in annotation_copy.__args__ if a is not _NONE_TYPE] # pyright: ignore + return _get_deserialize_callable_from_annotation(annotation_copy, module, rf) + except AttributeError: + pass + + # is it union? + if getattr(annotation, "__origin__", None) is typing.Union: + # initial ordering is we make `string` the last deserialization option, because it is often them most generic + deserializers = [ + _get_deserialize_callable_from_annotation(arg, module, rf) + for arg in _sorted_annotations(annotation.__args__) # pyright: ignore + ] + + return functools.partial(_deserialize_with_union, deserializers) + + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() == "dict": + value_deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[1], module, rf # pyright: ignore + ) + + return functools.partial( + _deserialize_dict, + value_deserializer, + module, + ) + except (AttributeError, IndexError): + pass + try: + annotation_name = ( + annotation.__name__ if hasattr(annotation, "__name__") else annotation._name # pyright: ignore + ) + if annotation_name.lower() in ["list", "set", "tuple", "sequence"]: + if len(annotation.__args__) > 1: # pyright: ignore + entry_deserializers = [ + _get_deserialize_callable_from_annotation(dt, module, rf) + for dt in annotation.__args__ # pyright: ignore + ] + return functools.partial(_deserialize_multiple_sequence, entry_deserializers, module) + deserializer = _get_deserialize_callable_from_annotation( + annotation.__args__[0], module, rf # pyright: ignore + ) + + return functools.partial(_deserialize_sequence, deserializer, module) + except (TypeError, IndexError, AttributeError, SyntaxError): + pass + + def _deserialize_default( + deserializer, + obj, + ): + if obj is None: + return obj + try: + return _deserialize_with_callable(deserializer, obj) + except Exception: + pass + return obj + + if get_deserializer(annotation, rf): + return functools.partial(_deserialize_default, get_deserializer(annotation, rf)) + + return functools.partial(_deserialize_default, annotation) + + +def _deserialize_with_callable( + deserializer: typing.Optional[typing.Callable[[typing.Any], typing.Any]], + value: typing.Any, +): # pylint: disable=too-many-return-statements + try: + if value is None or isinstance(value, _Null): + return None + if isinstance(value, ET.Element): + if deserializer is str: + return value.text or "" + if deserializer is int: + return int(value.text) if value.text else None + if deserializer is float: + return float(value.text) if value.text else None + if deserializer is bool: + return value.text == "true" if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING.values(): + return deserializer(value.text) if value.text else None + if deserializer and deserializer in _DESERIALIZE_MAPPING_WITHFORMAT.values(): + return deserializer(value.text) if value.text else None + if deserializer is None: + return value + if deserializer in [int, float, bool]: + return deserializer(value) + if isinstance(deserializer, CaseInsensitiveEnumMeta): + try: + return deserializer(value.text if isinstance(value, ET.Element) else value) + except ValueError: + # for unknown value, return raw value + return value.text if isinstance(value, ET.Element) else value + if isinstance(deserializer, type) and issubclass(deserializer, Model): + return deserializer._deserialize(value, []) + return typing.cast(typing.Callable[[typing.Any], typing.Any], deserializer)(value) + except Exception as e: + raise DeserializationError() from e + + +def _deserialize( + deserializer: typing.Any, + value: typing.Any, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + if isinstance(value, PipelineResponse): + value = value.http_response.json() + if rf is None and format: + rf = _RestField(format=format) + if not isinstance(deserializer, functools.partial): + deserializer = _get_deserialize_callable_from_annotation(deserializer, module, rf) + return _deserialize_with_callable(deserializer, value) + + +def _failsafe_deserialize( + deserializer: typing.Any, + response: HttpResponse, + module: typing.Optional[str] = None, + rf: typing.Optional["_RestField"] = None, + format: typing.Optional[str] = None, +) -> typing.Any: + try: + return _deserialize(deserializer, response.json(), module, rf, format) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +def _failsafe_deserialize_xml( + deserializer: typing.Any, + response: HttpResponse, +) -> typing.Any: + try: + return _deserialize_xml(deserializer, response.text()) + except Exception: # pylint: disable=broad-except + _LOGGER.warning( + "Ran into a deserialization error. Ignoring since this is failsafe deserialization", exc_info=True + ) + return None + + +# pylint: disable=too-many-instance-attributes +class _RestField: + def __init__( + self, + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + is_discriminator: bool = False, + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, + ): + self._type = type + self._rest_name_input = name + self._module: typing.Optional[str] = None + self._is_discriminator = is_discriminator + self._visibility = visibility + self._is_model = False + self._is_optional = False + self._default = default + self._format = format + self._is_multipart_file_input = is_multipart_file_input + self._xml = xml if xml is not None else {} + self._original_tsp_name = original_tsp_name + + @property + def _class_type(self) -> typing.Any: + result = getattr(self._type, "args", [None])[0] + # type may be wrapped by nested functools.partial so we need to check for that + if isinstance(result, functools.partial): + return getattr(result, "args", [None])[0] + return result + + @property + def _rest_name(self) -> str: + if self._rest_name_input is None: + raise ValueError("Rest name was never set") + return self._rest_name_input + + def __get__(self, obj: Model, type=None): # pylint: disable=redefined-builtin + # by this point, type and rest_name will have a value bc we default + # them in __new__ of the Model class + # Use _data.get() directly to avoid triggering __getitem__ which clears the cache + item = obj._data.get(self._rest_name) + if item is None: + return item + if self._is_model: + return item + + # For mutable types, we want mutations to directly affect _data + # Check if we've already deserialized this value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + # Return the value from _data directly (it's been deserialized in place) + return obj._data.get(self._rest_name) + + deserialized = _deserialize(self._type, _serialize(item, self._format), rf=self) + + # For mutable types, store the deserialized value back in _data + # so mutations directly affect _data + if isinstance(deserialized, (dict, list, set)): + obj._data[self._rest_name] = deserialized + object.__setattr__(obj, cache_attr, True) # Mark as deserialized + return deserialized + + return deserialized + + def __set__(self, obj: Model, value) -> None: + # Clear the cached deserialized object when setting a new value + cache_attr = f"_deserialized_{self._rest_name}" + if hasattr(obj, cache_attr): + object.__delattr__(obj, cache_attr) + + if value is None: + # we want to wipe out entries if users set attr to None + try: + obj.__delitem__(self._rest_name) + except KeyError: + pass + return + if self._is_model: + if not _is_model(value): + value = _deserialize(self._type, value) + obj.__setitem__(self._rest_name, value) + return + obj.__setitem__(self._rest_name, _serialize(value, self._format)) + + def _get_deserialize_callable_from_annotation( + self, annotation: typing.Any + ) -> typing.Optional[typing.Callable[[typing.Any], typing.Any]]: + return _get_deserialize_callable_from_annotation(annotation, self._module, self) + + +def rest_field( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + default: typing.Any = _UNSET, + format: typing.Optional[str] = None, + is_multipart_file_input: bool = False, + xml: typing.Optional[dict[str, typing.Any]] = None, + original_tsp_name: typing.Optional[str] = None, +) -> typing.Any: + return _RestField( + name=name, + type=type, + visibility=visibility, + default=default, + format=format, + is_multipart_file_input=is_multipart_file_input, + xml=xml, + original_tsp_name=original_tsp_name, + ) + + +def rest_discriminator( + *, + name: typing.Optional[str] = None, + type: typing.Optional[typing.Callable] = None, # pylint: disable=redefined-builtin + visibility: typing.Optional[list[str]] = None, + xml: typing.Optional[dict[str, typing.Any]] = None, +) -> typing.Any: + return _RestField(name=name, type=type, is_discriminator=True, visibility=visibility, xml=xml) + + +def serialize_xml(model: Model, exclude_readonly: bool = False) -> str: + """Serialize a model to XML. + + :param Model model: The model to serialize. + :param bool exclude_readonly: Whether to exclude readonly properties. + :returns: The XML representation of the model. + :rtype: str + """ + return ET.tostring(_get_element(model, exclude_readonly), encoding="unicode") # type: ignore + + +def _get_element( + o: typing.Any, + exclude_readonly: bool = False, + parent_meta: typing.Optional[dict[str, typing.Any]] = None, + wrapped_element: typing.Optional[ET.Element] = None, +) -> typing.Union[ET.Element, list[ET.Element]]: + if _is_model(o): + model_meta = getattr(o, "_xml", {}) + + # if prop is a model, then use the prop element directly, else generate a wrapper of model + if wrapped_element is None: + wrapped_element = _create_xml_element( + model_meta.get("name", o.__class__.__name__), + model_meta.get("prefix"), + model_meta.get("ns"), + ) + + readonly_props = [] + if exclude_readonly: + readonly_props = [p._rest_name for p in o._attr_to_rest_field.values() if _is_readonly(p)] + + for k, v in o.items(): + # do not serialize readonly properties + if exclude_readonly and k in readonly_props: + continue + + prop_rest_field = _get_rest_field(o._attr_to_rest_field, k) + if prop_rest_field: + prop_meta = getattr(prop_rest_field, "_xml").copy() + # use the wire name as xml name if no specific name is set + if prop_meta.get("name") is None: + prop_meta["name"] = k + else: + # additional properties will not have rest field, use the wire name as xml name + prop_meta = {"name": k} + + # if no ns for prop, use model's + if prop_meta.get("ns") is None and model_meta.get("ns"): + prop_meta["ns"] = model_meta.get("ns") + prop_meta["prefix"] = model_meta.get("prefix") + + if prop_meta.get("unwrapped", False): + # unwrapped could only set on array + wrapped_element.extend(_get_element(v, exclude_readonly, prop_meta)) + elif prop_meta.get("text", False): + # text could only set on primitive type + wrapped_element.text = _get_primitive_type_value(v) + elif prop_meta.get("attribute", False): + xml_name = prop_meta.get("name", k) + if prop_meta.get("ns"): + ET.register_namespace(prop_meta.get("prefix"), prop_meta.get("ns")) # pyright: ignore + xml_name = "{" + prop_meta.get("ns") + "}" + xml_name # pyright: ignore + # attribute should be primitive type + wrapped_element.set(xml_name, _get_primitive_type_value(v)) + else: + # other wrapped prop element + wrapped_element.append(_get_wrapped_element(v, exclude_readonly, prop_meta)) + return wrapped_element + if isinstance(o, list): + return [_get_element(x, exclude_readonly, parent_meta) for x in o] # type: ignore + if isinstance(o, dict): + result = [] + for k, v in o.items(): + result.append( + _get_wrapped_element( + v, + exclude_readonly, + { + "name": k, + "ns": parent_meta.get("ns") if parent_meta else None, + "prefix": parent_meta.get("prefix") if parent_meta else None, + }, + ) + ) + return result + + # primitive case need to create element based on parent_meta + if parent_meta: + return _get_wrapped_element( + o, + exclude_readonly, + { + "name": parent_meta.get("itemsName", parent_meta.get("name")), + "prefix": parent_meta.get("itemsPrefix", parent_meta.get("prefix")), + "ns": parent_meta.get("itemsNs", parent_meta.get("ns")), + }, + ) + + raise ValueError("Could not serialize value into xml: " + o) + + +def _get_wrapped_element( + v: typing.Any, + exclude_readonly: bool, + meta: typing.Optional[dict[str, typing.Any]], +) -> ET.Element: + wrapped_element = _create_xml_element( + meta.get("name") if meta else None, meta.get("prefix") if meta else None, meta.get("ns") if meta else None + ) + if isinstance(v, (dict, list)): + wrapped_element.extend(_get_element(v, exclude_readonly, meta)) + elif _is_model(v): + _get_element(v, exclude_readonly, meta, wrapped_element) + else: + wrapped_element.text = _get_primitive_type_value(v) + return wrapped_element # type: ignore[no-any-return] + + +def _get_primitive_type_value(v) -> str: + if v is True: + return "true" + if v is False: + return "false" + if isinstance(v, _Null): + return "" + return str(v) + + +def _create_xml_element( + tag: typing.Any, prefix: typing.Optional[str] = None, ns: typing.Optional[str] = None +) -> ET.Element: + if prefix and ns: + ET.register_namespace(prefix, ns) + if ns: + return ET.Element("{" + ns + "}" + tag) + return ET.Element(tag) + + +def _deserialize_xml( + deserializer: typing.Any, + value: str, +) -> typing.Any: + element = ET.fromstring(value) # nosec + return _deserialize(deserializer, element) + + +def _convert_element(e: ET.Element): + # dict case + if len(e.attrib) > 0 or len({child.tag for child in e}) > 1: + dict_result: dict[str, typing.Any] = {} + for child in e: + if dict_result.get(child.tag) is not None: + if isinstance(dict_result[child.tag], list): + dict_result[child.tag].append(_convert_element(child)) + else: + dict_result[child.tag] = [dict_result[child.tag], _convert_element(child)] + else: + dict_result[child.tag] = _convert_element(child) + dict_result.update(e.attrib) + return dict_result + # array case + if len(e) > 0: + array_result: list[typing.Any] = [] + for child in e: + array_result.append(_convert_element(child)) + return array_result + # primitive case + return e.text diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py index 6da830e0cf4a..81ec1de5922b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_utils/serialization.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- 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 47babc28d5ed..c4b6891834b3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -2,8 +2,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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.1.0" +VERSION = "4.0.0b25" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py index 387f4a1f8f8a..e4ca397b6ce0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/__init__.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -12,7 +12,7 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._sql_management_client import SqlManagementClient # type: ignore +from ._client import SqlClient # type: ignore try: from ._patch import __all__ as _patch_all @@ -22,7 +22,7 @@ from ._patch import patch_sdk as _patch_sdk __all__ = [ - "SqlManagementClient", + "SqlClient", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore 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/_client.py similarity index 97% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_client.py index d23f8d83b268..23cccbb06b57 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/_client.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,9 +18,8 @@ from azure.mgmt.core.policies import AsyncARMAutoResourceProviderRegistrationPolicy from azure.mgmt.core.tools import get_arm_endpoints -from .. import models as _models from .._utils.serialization import Deserializer, Serializer -from ._configuration import SqlManagementClientConfiguration +from ._configuration import SqlClientConfiguration from .operations import ( BackupShortTermRetentionPoliciesOperations, CapabilitiesOperations, @@ -177,15 +176,31 @@ from azure.core.credentials_async import AsyncTokenCredential -class SqlManagementClient: # pylint: disable=too-many-instance-attributes - """The Azure SQL Database management API provides a RESTful set of web services that interact with - Azure SQL Database services to manage your databases. The API enables you to create, retrieve, - update, and delete databases. +class SqlClient: # pylint: disable=too-many-instance-attributes + """The Azure SQL Database management API provides a RESTful set of web APIs that interact with + Azure SQL Database services to manage your databases. The API enables users to create, + retrieve, update, and delete databases, servers, and other entities. + :ivar operations: Operations operations + :vartype operations: azure.mgmt.sql.aio.operations.Operations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations + :ivar database_columns: DatabaseColumnsOperations operations + :vartype database_columns: azure.mgmt.sql.aio.operations.DatabaseColumnsOperations + :ivar restore_points: RestorePointsOperations operations + :vartype restore_points: azure.mgmt.sql.aio.operations.RestorePointsOperations + :ivar sensitivity_labels: SensitivityLabelsOperations operations + :vartype sensitivity_labels: azure.mgmt.sql.aio.operations.SensitivityLabelsOperations + :ivar databases: DatabasesOperations operations + :vartype databases: azure.mgmt.sql.aio.operations.DatabasesOperations + :ivar firewall_rules: FirewallRulesOperations operations + :vartype firewall_rules: azure.mgmt.sql.aio.operations.FirewallRulesOperations + :ivar replication_links: ReplicationLinksOperations operations + :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations + :ivar servers: ServersOperations operations + :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations :ivar server_blob_auditing_policies: ServerBlobAuditingPoliciesOperations operations :vartype server_blob_auditing_policies: azure.mgmt.sql.aio.operations.ServerBlobAuditingPoliciesOperations @@ -200,87 +215,85 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes operations :vartype extended_server_blob_auditing_policies: azure.mgmt.sql.aio.operations.ExtendedServerBlobAuditingPoliciesOperations - :ivar database_advanced_threat_protection_settings: - DatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype database_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations - :ivar database_advisors: DatabaseAdvisorsOperations operations - :vartype database_advisors: azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations - :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations - :vartype database_automatic_tuning: - azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations - :ivar database_columns: DatabaseColumnsOperations operations - :vartype database_columns: azure.mgmt.sql.aio.operations.DatabaseColumnsOperations - :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations - :vartype database_encryption_protectors: - azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations - :ivar database_extensions: DatabaseExtensionsOperations operations - :vartype database_extensions: azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations - :ivar database_operations: DatabaseOperationsOperations operations - :vartype database_operations: azure.mgmt.sql.aio.operations.DatabaseOperationsOperations - :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations - :vartype database_recommended_actions: - azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations - :ivar databases: DatabasesOperations operations - :vartype databases: azure.mgmt.sql.aio.operations.DatabasesOperations + :ivar server_advisors: ServerAdvisorsOperations operations + :vartype server_advisors: azure.mgmt.sql.aio.operations.ServerAdvisorsOperations + :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations + :vartype managed_database_columns: + azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations + :ivar database_tables: DatabaseTablesOperations operations + :vartype database_tables: azure.mgmt.sql.aio.operations.DatabaseTablesOperations + :ivar managed_database_tables: ManagedDatabaseTablesOperations operations + :vartype managed_database_tables: azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations :ivar database_schemas: DatabaseSchemasOperations operations :vartype database_schemas: azure.mgmt.sql.aio.operations.DatabaseSchemasOperations + :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations + :vartype managed_database_schemas: + azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations :ivar database_security_alert_policies: DatabaseSecurityAlertPoliciesOperations operations :vartype database_security_alert_policies: azure.mgmt.sql.aio.operations.DatabaseSecurityAlertPoliciesOperations - :ivar database_sql_vulnerability_assessment_baselines: - DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations - :vartype database_sql_vulnerability_assessment_baselines: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations - :ivar database_sql_vulnerability_assessment_execute_scan: - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype database_sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations + operations + :vartype sql_vulnerability_assessment_baseline: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations + :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations + :vartype sql_vulnerability_assessments: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations + :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations + operations + :vartype sql_vulnerability_assessments_settings: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations :ivar database_sql_vulnerability_assessment_rule_baselines: DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_sql_vulnerability_assessment_rule_baselines: azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar sql_vulnerability_assessment_rule_baseline: + SqlVulnerabilityAssessmentRuleBaselineOperations operations + :vartype sql_vulnerability_assessment_rule_baseline: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations :ivar database_sql_vulnerability_assessment_scan_result: DatabaseSqlVulnerabilityAssessmentScanResultOperations operations :vartype database_sql_vulnerability_assessment_scan_result: azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScanResultOperations - :ivar database_sql_vulnerability_assessment_scans: - DatabaseSqlVulnerabilityAssessmentScansOperations operations - :vartype database_sql_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations - :ivar database_sql_vulnerability_assessments_settings: - DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations - :vartype database_sql_vulnerability_assessments_settings: - azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations - :ivar database_tables: DatabaseTablesOperations operations - :vartype database_tables: azure.mgmt.sql.aio.operations.DatabaseTablesOperations - :ivar database_usages: DatabaseUsagesOperations operations - :vartype database_usages: azure.mgmt.sql.aio.operations.DatabaseUsagesOperations + :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations + operations + :vartype sql_vulnerability_assessment_scan_result: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations + :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations + :vartype sql_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselinesOperations operations :vartype database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations + :ivar managed_database_vulnerability_assessment_rule_baselines: + ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype managed_database_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations :ivar database_vulnerability_assessments: DatabaseVulnerabilityAssessmentsOperations operations :vartype database_vulnerability_assessments: azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentsOperations - :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScansOperations - operations - :vartype database_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar managed_database_vulnerability_assessments: + ManagedDatabaseVulnerabilityAssessmentsOperations operations + :vartype managed_database_vulnerability_assessments: + azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations + :ivar managed_database_vulnerability_assessment_scans: + ManagedDatabaseVulnerabilityAssessmentScansOperations operations + :vartype managed_database_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations :ivar data_masking_policies: DataMaskingPoliciesOperations operations :vartype data_masking_policies: azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations - :ivar data_masking_rules: DataMaskingRulesOperations operations - :vartype data_masking_rules: azure.mgmt.sql.aio.operations.DataMaskingRulesOperations - :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations - :vartype data_warehouse_user_activities: - azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations :ivar deleted_servers: DeletedServersOperations operations :vartype deleted_servers: azure.mgmt.sql.aio.operations.DeletedServersOperations :ivar distributed_availability_groups: DistributedAvailabilityGroupsOperations operations :vartype distributed_availability_groups: azure.mgmt.sql.aio.operations.DistributedAvailabilityGroupsOperations - :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations - :vartype elastic_pool_operations: azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations + :ivar managed_databases: ManagedDatabasesOperations operations + :vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations + :ivar server_trust_groups: ServerTrustGroupsOperations operations + :vartype server_trust_groups: azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations :ivar elastic_pools: ElasticPoolsOperations operations :vartype elastic_pools: azure.mgmt.sql.aio.operations.ElasticPoolsOperations :ivar encryption_protectors: EncryptionProtectorsOperations operations @@ -289,8 +302,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype endpoint_certificates: azure.mgmt.sql.aio.operations.EndpointCertificatesOperations :ivar failover_groups: FailoverGroupsOperations operations :vartype failover_groups: azure.mgmt.sql.aio.operations.FailoverGroupsOperations - :ivar firewall_rules: FirewallRulesOperations operations - :vartype firewall_rules: azure.mgmt.sql.aio.operations.FirewallRulesOperations :ivar geo_backup_policies: GeoBackupPoliciesOperations operations :vartype geo_backup_policies: azure.mgmt.sql.aio.operations.GeoBackupPoliciesOperations :ivar instance_failover_groups: InstanceFailoverGroupsOperations operations @@ -303,30 +314,26 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype instance_pools: azure.mgmt.sql.aio.operations.InstancePoolsOperations :ivar ipv6_firewall_rules: IPv6FirewallRulesOperations operations :vartype ipv6_firewall_rules: azure.mgmt.sql.aio.operations.IPv6FirewallRulesOperations + :ivar job_executions: JobExecutionsOperations operations + :vartype job_executions: azure.mgmt.sql.aio.operations.JobExecutionsOperations :ivar job_agents: JobAgentsOperations operations :vartype job_agents: azure.mgmt.sql.aio.operations.JobAgentsOperations :ivar job_credentials: JobCredentialsOperations operations :vartype job_credentials: azure.mgmt.sql.aio.operations.JobCredentialsOperations - :ivar job_executions: JobExecutionsOperations operations - :vartype job_executions: azure.mgmt.sql.aio.operations.JobExecutionsOperations - :ivar job_private_endpoints: JobPrivateEndpointsOperations operations - :vartype job_private_endpoints: azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations - :ivar jobs: JobsOperations operations - :vartype jobs: azure.mgmt.sql.aio.operations.JobsOperations :ivar job_step_executions: JobStepExecutionsOperations operations :vartype job_step_executions: azure.mgmt.sql.aio.operations.JobStepExecutionsOperations - :ivar job_steps: JobStepsOperations operations - :vartype job_steps: azure.mgmt.sql.aio.operations.JobStepsOperations :ivar job_target_executions: JobTargetExecutionsOperations operations :vartype job_target_executions: azure.mgmt.sql.aio.operations.JobTargetExecutionsOperations + :ivar jobs: JobsOperations operations + :vartype jobs: azure.mgmt.sql.aio.operations.JobsOperations + :ivar job_private_endpoints: JobPrivateEndpointsOperations operations + :vartype job_private_endpoints: azure.mgmt.sql.aio.operations.JobPrivateEndpointsOperations + :ivar job_steps: JobStepsOperations operations + :vartype job_steps: azure.mgmt.sql.aio.operations.JobStepsOperations :ivar job_target_groups: JobTargetGroupsOperations operations :vartype job_target_groups: azure.mgmt.sql.aio.operations.JobTargetGroupsOperations :ivar job_versions: JobVersionsOperations operations :vartype job_versions: azure.mgmt.sql.aio.operations.JobVersionsOperations - :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations - :vartype ledger_digest_uploads: azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations - :ivar capabilities: CapabilitiesOperations operations - :vartype capabilities: azure.mgmt.sql.aio.operations.CapabilitiesOperations :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations :vartype long_term_retention_backups: azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations @@ -337,76 +344,21 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations - :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations - :vartype maintenance_window_options: - azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations - :ivar maintenance_windows: MaintenanceWindowsOperations operations - :vartype maintenance_windows: azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations :ivar managed_backup_short_term_retention_policies: ManagedBackupShortTermRetentionPoliciesOperations operations :vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.ManagedBackupShortTermRetentionPoliciesOperations - :ivar managed_database_advanced_threat_protection_settings: - ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations - :vartype managed_database_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations - :ivar managed_database_columns: ManagedDatabaseColumnsOperations operations - :vartype managed_database_columns: - azure.mgmt.sql.aio.operations.ManagedDatabaseColumnsOperations - :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations - :vartype managed_database_move_operations: - azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations - :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations - :vartype managed_database_queries: - azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations - :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations - :vartype managed_database_restore_details: - azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations - :ivar managed_databases: ManagedDatabasesOperations operations - :vartype managed_databases: azure.mgmt.sql.aio.operations.ManagedDatabasesOperations - :ivar managed_database_schemas: ManagedDatabaseSchemasOperations operations - :vartype managed_database_schemas: - azure.mgmt.sql.aio.operations.ManagedDatabaseSchemasOperations + :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: + ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations + :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: + azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations :ivar managed_database_security_alert_policies: ManagedDatabaseSecurityAlertPoliciesOperations operations :vartype managed_database_security_alert_policies: azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityAlertPoliciesOperations - :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations - :vartype managed_database_security_events: - azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations - :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations - operations - :vartype managed_database_sensitivity_labels: - azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations - :ivar managed_database_recommended_sensitivity_labels: - ManagedDatabaseRecommendedSensitivityLabelsOperations operations - :vartype managed_database_recommended_sensitivity_labels: - azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations - :ivar managed_database_tables: ManagedDatabaseTablesOperations operations - :vartype managed_database_tables: azure.mgmt.sql.aio.operations.ManagedDatabaseTablesOperations - :ivar managed_database_transparent_data_encryption: - ManagedDatabaseTransparentDataEncryptionOperations operations - :vartype managed_database_transparent_data_encryption: - azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations - :ivar managed_database_vulnerability_assessment_rule_baselines: - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype managed_database_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations - :ivar managed_database_vulnerability_assessments: - ManagedDatabaseVulnerabilityAssessmentsOperations operations - :vartype managed_database_vulnerability_assessments: - azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentsOperations - :ivar managed_database_vulnerability_assessment_scans: - ManagedDatabaseVulnerabilityAssessmentScansOperations operations - :vartype managed_database_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations :ivar managed_instance_administrators: ManagedInstanceAdministratorsOperations operations :vartype managed_instance_administrators: azure.mgmt.sql.aio.operations.ManagedInstanceAdministratorsOperations - :ivar managed_instance_advanced_threat_protection_settings: - ManagedInstanceAdvancedThreatProtectionSettingsOperations operations - :vartype managed_instance_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthenticationsOperations operations :vartype managed_instance_azure_ad_only_authentications: @@ -430,26 +382,10 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes ManagedInstancePrivateEndpointConnectionsOperations operations :vartype managed_instance_private_endpoint_connections: azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations - :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations - operations - :vartype managed_instance_private_link_resources: - azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations - :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations - :vartype managed_instance_tde_certificates: - azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations :ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessmentsOperations operations :vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.aio.operations.ManagedInstanceVulnerabilityAssessmentsOperations - :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations - :vartype managed_ledger_digest_uploads: - azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations - :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations operations - :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: - azure.mgmt.sql.aio.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations :ivar managed_server_dns_aliases: ManagedServerDnsAliasesOperations operations :vartype managed_server_dns_aliases: azure.mgmt.sql.aio.operations.ManagedServerDnsAliasesOperations @@ -461,8 +397,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes NetworkSecurityPerimeterConfigurationsOperations operations :vartype network_security_perimeter_configurations: azure.mgmt.sql.aio.operations.NetworkSecurityPerimeterConfigurationsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.sql.aio.operations.Operations :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations :vartype outbound_firewall_rules: azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -475,8 +409,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :ivar recoverable_managed_databases: RecoverableManagedDatabasesOperations operations :vartype recoverable_managed_databases: azure.mgmt.sql.aio.operations.RecoverableManagedDatabasesOperations - :ivar replication_links: ReplicationLinksOperations operations - :vartype replication_links: azure.mgmt.sql.aio.operations.ReplicationLinksOperations :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations :vartype restorable_dropped_databases: azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations @@ -484,21 +416,6 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes operations :vartype restorable_dropped_managed_databases: azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations - :ivar restore_points: RestorePointsOperations operations - :vartype restore_points: azure.mgmt.sql.aio.operations.RestorePointsOperations - :ivar sensitivity_labels: SensitivityLabelsOperations operations - :vartype sensitivity_labels: azure.mgmt.sql.aio.operations.SensitivityLabelsOperations - :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations - :vartype recommended_sensitivity_labels: - azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations - :ivar server_advanced_threat_protection_settings: - ServerAdvancedThreatProtectionSettingsOperations operations - :vartype server_advanced_threat_protection_settings: - azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations - :ivar server_advisors: ServerAdvisorsOperations operations - :vartype server_advisors: azure.mgmt.sql.aio.operations.ServerAdvisorsOperations - :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations - :vartype server_automatic_tuning: azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations :ivar server_azure_ad_administrators: ServerAzureADAdministratorsOperations operations :vartype server_azure_ad_administrators: azure.mgmt.sql.aio.operations.ServerAzureADAdministratorsOperations @@ -519,82 +436,29 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype server_dns_aliases: azure.mgmt.sql.aio.operations.ServerDnsAliasesOperations :ivar server_keys: ServerKeysOperations operations :vartype server_keys: azure.mgmt.sql.aio.operations.ServerKeysOperations - :ivar server_operations: ServerOperationsOperations operations - :vartype server_operations: azure.mgmt.sql.aio.operations.ServerOperationsOperations - :ivar servers: ServersOperations operations - :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations :ivar server_security_alert_policies: ServerSecurityAlertPoliciesOperations operations :vartype server_security_alert_policies: azure.mgmt.sql.aio.operations.ServerSecurityAlertPoliciesOperations :ivar server_trust_certificates: ServerTrustCertificatesOperations operations :vartype server_trust_certificates: azure.mgmt.sql.aio.operations.ServerTrustCertificatesOperations - :ivar server_trust_groups: ServerTrustGroupsOperations operations - :vartype server_trust_groups: azure.mgmt.sql.aio.operations.ServerTrustGroupsOperations - :ivar server_usages: ServerUsagesOperations operations - :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations :ivar server_vulnerability_assessments: ServerVulnerabilityAssessmentsOperations operations :vartype server_vulnerability_assessments: azure.mgmt.sql.aio.operations.ServerVulnerabilityAssessmentsOperations - :ivar sql_agent: SqlAgentOperations operations - :vartype sql_agent: azure.mgmt.sql.aio.operations.SqlAgentOperations - :ivar sql_vulnerability_assessment_baseline: SqlVulnerabilityAssessmentBaselineOperations - operations - :vartype sql_vulnerability_assessment_baseline: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselineOperations - :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations - operations - :vartype sql_vulnerability_assessment_baselines: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations - :ivar sql_vulnerability_assessment_execute_scan: - SqlVulnerabilityAssessmentExecuteScanOperations operations - :vartype sql_vulnerability_assessment_execute_scan: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations - :ivar sql_vulnerability_assessment_rule_baseline: - SqlVulnerabilityAssessmentRuleBaselineOperations operations - :vartype sql_vulnerability_assessment_rule_baseline: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselineOperations - :ivar sql_vulnerability_assessment_rule_baselines: - SqlVulnerabilityAssessmentRuleBaselinesOperations operations - :vartype sql_vulnerability_assessment_rule_baselines: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations - :ivar sql_vulnerability_assessment_scan_result: SqlVulnerabilityAssessmentScanResultOperations - operations - :vartype sql_vulnerability_assessment_scan_result: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScanResultOperations - :ivar sql_vulnerability_assessment_scans: SqlVulnerabilityAssessmentScansOperations operations - :vartype sql_vulnerability_assessment_scans: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentScansOperations - :ivar sql_vulnerability_assessments_settings: SqlVulnerabilityAssessmentsSettingsOperations - operations - :vartype sql_vulnerability_assessments_settings: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsSettingsOperations - :ivar sql_vulnerability_assessments: SqlVulnerabilityAssessmentsOperations operations - :vartype sql_vulnerability_assessments: - azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentsOperations :ivar start_stop_managed_instance_schedules: StartStopManagedInstanceSchedulesOperations operations :vartype start_stop_managed_instance_schedules: azure.mgmt.sql.aio.operations.StartStopManagedInstanceSchedulesOperations :ivar subscription_usages: SubscriptionUsagesOperations operations :vartype subscription_usages: azure.mgmt.sql.aio.operations.SubscriptionUsagesOperations - :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations - :vartype synapse_link_workspaces: azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations :ivar sync_agents: SyncAgentsOperations operations :vartype sync_agents: azure.mgmt.sql.aio.operations.SyncAgentsOperations :ivar sync_groups: SyncGroupsOperations operations :vartype sync_groups: azure.mgmt.sql.aio.operations.SyncGroupsOperations :ivar sync_members: SyncMembersOperations operations :vartype sync_members: azure.mgmt.sql.aio.operations.SyncMembersOperations - :ivar tde_certificates: TdeCertificatesOperations operations - :vartype tde_certificates: azure.mgmt.sql.aio.operations.TdeCertificatesOperations :ivar time_zones: TimeZonesOperations operations :vartype time_zones: azure.mgmt.sql.aio.operations.TimeZonesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: - azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations - :ivar usages: UsagesOperations operations - :vartype usages: azure.mgmt.sql.aio.operations.UsagesOperations :ivar virtual_clusters: VirtualClustersOperations operations :vartype virtual_clusters: azure.mgmt.sql.aio.operations.VirtualClustersOperations :ivar virtual_network_rules: VirtualNetworkRulesOperations operations @@ -603,17 +467,153 @@ class SqlManagementClient: # pylint: disable=too-many-instance-attributes :vartype workload_classifiers: azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.aio.operations.WorkloadGroupsOperations - :param credential: Credential needed for the client to connect to Azure. Required. + :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabelsOperations + operations + :vartype managed_database_sensitivity_labels: + azure.mgmt.sql.aio.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar database_encryption_protectors: DatabaseEncryptionProtectorsOperations operations + :vartype database_encryption_protectors: + azure.mgmt.sql.aio.operations.DatabaseEncryptionProtectorsOperations + :ivar database_operations: DatabaseOperationsOperations operations + :vartype database_operations: azure.mgmt.sql.aio.operations.DatabaseOperationsOperations + :ivar database_usages: DatabaseUsagesOperations operations + :vartype database_usages: azure.mgmt.sql.aio.operations.DatabaseUsagesOperations + :ivar recommended_sensitivity_labels: RecommendedSensitivityLabelsOperations operations + :vartype recommended_sensitivity_labels: + azure.mgmt.sql.aio.operations.RecommendedSensitivityLabelsOperations + :ivar synapse_link_workspaces: SynapseLinkWorkspacesOperations operations + :vartype synapse_link_workspaces: azure.mgmt.sql.aio.operations.SynapseLinkWorkspacesOperations + :ivar server_operations: ServerOperationsOperations operations + :vartype server_operations: azure.mgmt.sql.aio.operations.ServerOperationsOperations + :ivar server_usages: ServerUsagesOperations operations + :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations + :ivar tde_certificates: TdeCertificatesOperations operations + :vartype tde_certificates: azure.mgmt.sql.aio.operations.TdeCertificatesOperations + :ivar database_advanced_threat_protection_settings: + DatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype database_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.DatabaseAdvancedThreatProtectionSettingsOperations + :ivar database_advisors: DatabaseAdvisorsOperations operations + :vartype database_advisors: azure.mgmt.sql.aio.operations.DatabaseAdvisorsOperations + :ivar database_automatic_tuning: DatabaseAutomaticTuningOperations operations + :vartype database_automatic_tuning: + azure.mgmt.sql.aio.operations.DatabaseAutomaticTuningOperations + :ivar database_extensions: DatabaseExtensionsOperations operations + :vartype database_extensions: azure.mgmt.sql.aio.operations.DatabaseExtensionsOperations + :ivar database_recommended_actions: DatabaseRecommendedActionsOperations operations + :vartype database_recommended_actions: + azure.mgmt.sql.aio.operations.DatabaseRecommendedActionsOperations + :ivar database_sql_vulnerability_assessment_baselines: + DatabaseSqlVulnerabilityAssessmentBaselinesOperations operations + :vartype database_sql_vulnerability_assessment_baselines: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentBaselinesOperations + :ivar sql_vulnerability_assessment_baselines: SqlVulnerabilityAssessmentBaselinesOperations + operations + :vartype sql_vulnerability_assessment_baselines: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentBaselinesOperations + :ivar database_sql_vulnerability_assessments_settings: + DatabaseSqlVulnerabilityAssessmentsSettingsOperations operations + :vartype database_sql_vulnerability_assessments_settings: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentsSettingsOperations + :ivar database_sql_vulnerability_assessment_execute_scan: + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype database_sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_execute_scan: + SqlVulnerabilityAssessmentExecuteScanOperations operations + :vartype sql_vulnerability_assessment_execute_scan: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentExecuteScanOperations + :ivar sql_vulnerability_assessment_rule_baselines: + SqlVulnerabilityAssessmentRuleBaselinesOperations operations + :vartype sql_vulnerability_assessment_rule_baselines: + azure.mgmt.sql.aio.operations.SqlVulnerabilityAssessmentRuleBaselinesOperations + :ivar database_sql_vulnerability_assessment_scans: + DatabaseSqlVulnerabilityAssessmentScansOperations operations + :vartype database_sql_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.DatabaseSqlVulnerabilityAssessmentScansOperations + :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScansOperations + operations + :vartype database_vulnerability_assessment_scans: + azure.mgmt.sql.aio.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar data_masking_rules: DataMaskingRulesOperations operations + :vartype data_masking_rules: azure.mgmt.sql.aio.operations.DataMaskingRulesOperations + :ivar data_warehouse_user_activities: DataWarehouseUserActivitiesOperations operations + :vartype data_warehouse_user_activities: + azure.mgmt.sql.aio.operations.DataWarehouseUserActivitiesOperations + :ivar managed_database_security_events: ManagedDatabaseSecurityEventsOperations operations + :vartype managed_database_security_events: + azure.mgmt.sql.aio.operations.ManagedDatabaseSecurityEventsOperations + :ivar managed_database_recommended_sensitivity_labels: + ManagedDatabaseRecommendedSensitivityLabelsOperations operations + :vartype managed_database_recommended_sensitivity_labels: + azure.mgmt.sql.aio.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations + :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations + :vartype managed_instance_tde_certificates: + azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations + :ivar elastic_pool_operations: ElasticPoolOperationsOperations operations + :vartype elastic_pool_operations: azure.mgmt.sql.aio.operations.ElasticPoolOperationsOperations + :ivar usages: UsagesOperations operations + :vartype usages: azure.mgmt.sql.aio.operations.UsagesOperations + :ivar ledger_digest_uploads: LedgerDigestUploadsOperations operations + :vartype ledger_digest_uploads: azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations + :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations + :vartype maintenance_window_options: + azure.mgmt.sql.aio.operations.MaintenanceWindowOptionsOperations + :ivar maintenance_windows: MaintenanceWindowsOperations operations + :vartype maintenance_windows: azure.mgmt.sql.aio.operations.MaintenanceWindowsOperations + :ivar managed_database_advanced_threat_protection_settings: + ManagedDatabaseAdvancedThreatProtectionSettingsOperations operations + :vartype managed_database_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ManagedDatabaseAdvancedThreatProtectionSettingsOperations + :ivar managed_database_move_operations: ManagedDatabaseMoveOperationsOperations operations + :vartype managed_database_move_operations: + azure.mgmt.sql.aio.operations.ManagedDatabaseMoveOperationsOperations + :ivar managed_database_queries: ManagedDatabaseQueriesOperations operations + :vartype managed_database_queries: + azure.mgmt.sql.aio.operations.ManagedDatabaseQueriesOperations + :ivar managed_database_restore_details: ManagedDatabaseRestoreDetailsOperations operations + :vartype managed_database_restore_details: + azure.mgmt.sql.aio.operations.ManagedDatabaseRestoreDetailsOperations + :ivar managed_database_transparent_data_encryption: + ManagedDatabaseTransparentDataEncryptionOperations operations + :vartype managed_database_transparent_data_encryption: + azure.mgmt.sql.aio.operations.ManagedDatabaseTransparentDataEncryptionOperations + :ivar managed_instance_advanced_threat_protection_settings: + ManagedInstanceAdvancedThreatProtectionSettingsOperations operations + :vartype managed_instance_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ManagedInstanceAdvancedThreatProtectionSettingsOperations + :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations + operations + :vartype managed_instance_private_link_resources: + azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations + :ivar managed_ledger_digest_uploads: ManagedLedgerDigestUploadsOperations operations + :vartype managed_ledger_digest_uploads: + azure.mgmt.sql.aio.operations.ManagedLedgerDigestUploadsOperations + :ivar server_advanced_threat_protection_settings: + ServerAdvancedThreatProtectionSettingsOperations operations + :vartype server_advanced_threat_protection_settings: + azure.mgmt.sql.aio.operations.ServerAdvancedThreatProtectionSettingsOperations + :ivar server_automatic_tuning: ServerAutomaticTuningOperations operations + :vartype server_automatic_tuning: azure.mgmt.sql.aio.operations.ServerAutomaticTuningOperations + :ivar sql_agent: SqlAgentOperations operations + :vartype sql_agent: azure.mgmt.sql.aio.operations.SqlAgentOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: + azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations + :ivar capabilities: CapabilitiesOperations operations + :vartype capabilities: azure.mgmt.sql.aio.operations.CapabilitiesOperations + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID that identifies an Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str - :param base_url: Service URL. Default value is None. + :param base_url: Service host. Default value is None. :type base_url: str :keyword cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :paramtype cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-02-01-preview". Default value is "2025-02-01-preview". Note that overriding this default + value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -628,14 +628,16 @@ def __init__( cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: + _endpoint = "{endpoint}" _cloud = cloud_setting or settings.current.azure_cloud # type: ignore _endpoints = get_arm_endpoints(_cloud) if not base_url: base_url = _endpoints["resource_manager"] credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"]) - self._config = SqlManagementClientConfiguration( + self._config = SqlClientConfiguration( credential=credential, subscription_id=subscription_id, + base_url=cast(str, base_url), cloud_setting=cloud_setting, credential_scopes=credential_scopes, **kwargs @@ -660,106 +662,115 @@ def __init__( self._config.http_logging_policy, ] self._client: AsyncARMPipelineClient = AsyncARMPipelineClient( - base_url=cast(str, base_url), policies=_policies, **kwargs + base_url=cast(str, _endpoint), policies=_policies, **kwargs ) - client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} - self._serialize = Serializer(client_models) - self._deserialize = Deserializer(client_models) + self._serialize = Serializer() + self._deserialize = Deserializer() self._serialize.client_side_validation = False + self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( + self.database_columns = DatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( + self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sensitivity_labels = SensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( + self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) + self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) + self.replication_links = ReplicationLinksOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_advisors = DatabaseAdvisorsOperations( + self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_automatic_tuning = DatabaseAutomaticTuningOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_columns = DatabaseColumnsOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_extensions = DatabaseExtensionsOperations( + self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_columns = ManagedDatabaseColumnsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_operations = DatabaseOperationsOperations( + self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_tables = ManagedDatabaseTablesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_recommended_actions = DatabaseRecommendedActionsOperations( + self.database_schemas = DatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) - self.databases = DatabasesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_schemas = DatabaseSchemasOperations( + self.managed_database_schemas = ManagedDatabaseSchemasOperations( self._client, self._config, self._serialize, self._deserialize ) self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( + self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_execute_scan = ( - DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self._client, self._config, self._serialize, self._deserialize ) self.database_sql_vulnerability_assessment_rule_baselines = ( DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) ) + self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self._client, self._config, self._serialize, self._deserialize + ) self.database_sql_vulnerability_assessment_scan_result = DatabaseSqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( + self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( + self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_tables = DatabaseTablesOperations(self._client, self._config, self._serialize, self._deserialize) - self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.managed_database_vulnerability_assessment_rule_baselines = ( + ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) self.data_masking_policies = DataMaskingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_masking_rules = DataMaskingRulesOperations( + self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) + self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self.managed_databases = ManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.deleted_servers = DeletedServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.distributed_availability_groups = DistributedAvailabilityGroupsOperations( + self.server_trust_groups = ServerTrustGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.elastic_pool_operations = ElasticPoolOperationsOperations( + self.managed_instances = ManagedInstancesOperations( self._client, self._config, self._serialize, self._deserialize ) self.elastic_pools = ElasticPoolsOperations(self._client, self._config, self._serialize, self._deserialize) @@ -770,7 +781,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.failover_groups = FailoverGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.firewall_rules = FirewallRulesOperations(self._client, self._config, self._serialize, self._deserialize) self.geo_backup_policies = GeoBackupPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -784,28 +794,24 @@ def __init__( self.ipv6_firewall_rules = IPv6FirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) + self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_credentials = JobCredentialsOperations(self._client, self._config, self._serialize, self._deserialize) - self.job_executions = JobExecutionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.job_private_endpoints = JobPrivateEndpointsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_step_executions = JobStepExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_steps = JobStepsOperations(self._client, self._config, self._serialize, self._deserialize) self.job_target_executions = JobTargetExecutionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_target_groups = JobTargetGroupsOperations( + self.jobs = JobsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_private_endpoints = JobPrivateEndpointsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) - self.ledger_digest_uploads = LedgerDigestUploadsOperations( + self.job_steps = JobStepsOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_target_groups = JobTargetGroupsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) + self.job_versions = JobVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.long_term_retention_backups = LongTermRetentionBackupsOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -815,260 +821,255 @@ def __init__( self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.maintenance_window_options = MaintenanceWindowOptionsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.maintenance_windows = MaintenanceWindowsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_advanced_threat_protection_settings = ( - ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( + ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) ) - self.managed_database_columns = ManagedDatabaseColumnsOperations( + self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( + self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_queries = ManagedDatabaseQueriesOperations( + self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.managed_instance_dtcs = ManagedInstanceDtcsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_databases = ManagedDatabasesOperations( + self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_schemas = ManagedDatabaseSchemasOperations( + self.managed_instance_keys = ManagedInstanceKeysOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( + self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( + self.managed_instance_operations = ManagedInstanceOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self.managed_instance_private_endpoint_connections = ManagedInstancePrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( + self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_tables = ManagedDatabaseTablesOperations( + self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_transparent_data_encryption = ManagedDatabaseTransparentDataEncryptionOperations( + self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_vulnerability_assessment_rule_baselines = ( - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations( + self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( + self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( + self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_advanced_threat_protection_settings = ( - ManagedInstanceAdvancedThreatProtectionSettingsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - ) - self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( + self.private_link_resources = PrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_dtcs = ManagedInstanceDtcsOperations( + self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( + self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_keys = ManagedInstanceKeysOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_operations = ManagedInstanceOperationsOperations( + self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_private_endpoint_connections = ManagedInstancePrivateEndpointConnectionsOperations( + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( + self.server_configuration_options = ServerConfigurationOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instances = ManagedInstancesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( + self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( + self.server_dns_aliases = ServerDnsAliasesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( + self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_restorable_dropped_database_backup_short_term_retention_policies = ( - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize - ) + self.server_trust_certificates = ServerTrustCertificatesOperations( + self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_dns_aliases = ManagedServerDnsAliasesOperations( + self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( + self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( + self.subscription_usages = SubscriptionUsagesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.operations = Operations(self._client, self._config, self._serialize, self._deserialize) - self.outbound_firewall_rules = OutboundFirewallRulesOperations( + self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) + self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) + self.virtual_clusters = VirtualClustersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.private_endpoint_connections = PrivateEndpointConnectionsOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.private_link_resources = PrivateLinkResourcesOperations( + self.workload_classifiers = WorkloadClassifiersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_databases = RecoverableDatabasesOperations( + self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( + self.database_encryption_protectors = DatabaseEncryptionProtectorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.replication_links = ReplicationLinksOperations( + self.database_operations = DatabaseOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( + self.database_usages = DatabaseUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( + self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.restore_points = RestorePointsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sensitivity_labels = SensitivityLabelsOperations( + self.server_operations = ServerOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( + self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.tde_certificates = TdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( + self.database_advanced_threat_protection_settings = DatabaseAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_advisors = ServerAdvisorsOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_automatic_tuning = ServerAutomaticTuningOperations( + self.database_advisors = DatabaseAdvisorsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( + self.database_automatic_tuning = DatabaseAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( + self.database_extensions = DatabaseExtensionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_configuration_options = ServerConfigurationOptionsOperations( + self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_connection_policies = ServerConnectionPoliciesOperations( + self.database_sql_vulnerability_assessment_baselines = DatabaseSqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( + self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_dns_aliases = ServerDnsAliasesOperations( + self.database_sql_vulnerability_assessments_settings = DatabaseSqlVulnerabilityAssessmentsSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_keys = ServerKeysOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_operations = ServerOperationsOperations( + self.database_sql_vulnerability_assessment_execute_scan = ( + DatabaseSqlVulnerabilityAssessmentExecuteScanOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( self._client, self._config, self._serialize, self._deserialize ) - self.servers = ServersOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( + self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_certificates = ServerTrustCertificatesOperations( + self.database_sql_vulnerability_assessment_scans = DatabaseSqlVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_trust_groups = ServerTrustGroupsOperations( + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( self._client, self._config, self._serialize, self._deserialize ) - self.server_usages = ServerUsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( + self.data_masking_rules = DataMaskingRulesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) - self.sql_vulnerability_assessment_baseline = SqlVulnerabilityAssessmentBaselineOperations( + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_baselines = SqlVulnerabilityAssessmentBaselinesOperations( + self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_execute_scan = SqlVulnerabilityAssessmentExecuteScanOperations( + self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baseline = SqlVulnerabilityAssessmentRuleBaselineOperations( + self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_rule_baselines = SqlVulnerabilityAssessmentRuleBaselinesOperations( + self.elastic_pool_operations = ElasticPoolOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scan_result = SqlVulnerabilityAssessmentScanResultOperations( + self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) + self.ledger_digest_uploads = LedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessment_scans = SqlVulnerabilityAssessmentScansOperations( + self.maintenance_window_options = MaintenanceWindowOptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments_settings = SqlVulnerabilityAssessmentsSettingsOperations( + self.maintenance_windows = MaintenanceWindowsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sql_vulnerability_assessments = SqlVulnerabilityAssessmentsOperations( + self.managed_database_advanced_threat_protection_settings = ( + ManagedDatabaseAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_database_move_operations = ManagedDatabaseMoveOperationsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.start_stop_managed_instance_schedules = StartStopManagedInstanceSchedulesOperations( + self.managed_database_queries = ManagedDatabaseQueriesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.subscription_usages = SubscriptionUsagesOperations( + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.synapse_link_workspaces = SynapseLinkWorkspacesOperations( + self.managed_database_transparent_data_encryption = ManagedDatabaseTransparentDataEncryptionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.sync_agents = SyncAgentsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_groups = SyncGroupsOperations(self._client, self._config, self._serialize, self._deserialize) - self.sync_members = SyncMembersOperations(self._client, self._config, self._serialize, self._deserialize) - self.tde_certificates = TdeCertificatesOperations( + self.managed_instance_advanced_threat_protection_settings = ( + ManagedInstanceAdvancedThreatProtectionSettingsOperations( + self._client, self._config, self._serialize, self._deserialize + ) + ) + self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize ) - self.time_zones = TimeZonesOperations(self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.managed_ledger_digest_uploads = ManagedLedgerDigestUploadsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.usages = UsagesOperations(self._client, self._config, self._serialize, self._deserialize) - self.virtual_clusters = VirtualClustersOperations( + self.server_advanced_threat_protection_settings = ServerAdvancedThreatProtectionSettingsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.virtual_network_rules = VirtualNetworkRulesOperations( + self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_classifiers = WorkloadClassifiersOperations( + self.sql_agent = SqlAgentOperations(self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self._config, self._serialize, self._deserialize ) - self.workload_groups = WorkloadGroupsOperations(self._client, self._config, self._serialize, self._deserialize) + self.capabilities = CapabilitiesOperations(self._client, self._config, self._serialize, self._deserialize) - def _send_request( + def send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any ) -> Awaitable[AsyncHttpResponse]: """Runs the network request through the client's chained policies. @@ -1076,7 +1077,7 @@ def _send_request( >>> from azure.core.rest import HttpRequest >>> request = HttpRequest("GET", "https://www.example.org/") - >>> response = await client._send_request(request) + >>> response = await client.send_request(request) For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request @@ -1089,7 +1090,11 @@ def _send_request( """ request_copy = deepcopy(request) - request_copy.url = self._client.format_url(request_copy.url) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + request_copy.url = self._client.format_url(request_copy.url, **path_format_arguments) return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore async def close(self) -> None: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py index e0256b86d59b..97ae84750f5d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_configuration.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -18,21 +18,24 @@ from azure.core.credentials_async import AsyncTokenCredential -class SqlManagementClientConfiguration: # pylint: disable=too-many-instance-attributes - """Configuration for SqlManagementClient. +class SqlClientConfiguration: # pylint: disable=too-many-instance-attributes + """Configuration for SqlClient. Note that all parameters used to create this instance are saved as instance attributes. - :param credential: Credential needed for the client to connect to Azure. Required. + :param credential: Credential used to authenticate requests to the service. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential - :param subscription_id: The subscription ID that identifies an Azure subscription. Required. + :param subscription_id: The ID of the target subscription. The value must be an UUID. Required. :type subscription_id: str + :param base_url: Service host. Default value is "https://management.azure.com". + :type base_url: str :param cloud_setting: The cloud setting for which to get the ARM endpoint. Default value is None. :type cloud_setting: ~azure.core.AzureClouds - :keyword api_version: Api Version. Default value is "2025-01-01". Note that overriding this - default value may result in unsupported behavior. + :keyword api_version: The API version to use for this operation. Known values are + "2025-02-01-preview". Default value is "2025-02-01-preview". Note that overriding this default + value may result in unsupported behavior. :paramtype api_version: str """ @@ -40,10 +43,11 @@ def __init__( self, credential: "AsyncTokenCredential", subscription_id: str, + base_url: str = "https://management.azure.com", cloud_setting: Optional["AzureClouds"] = None, **kwargs: Any ) -> None: - api_version: str = kwargs.pop("api_version", "2025-01-01") + api_version: str = kwargs.pop("api_version", "2025-02-01-preview") if credential is None: raise ValueError("Parameter 'credential' must not be None.") @@ -52,6 +56,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id + self.base_url = base_url self.cloud_setting = cloud_setting self.api_version = api_version self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"]) 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 17dbc073e01b..87676c65a8f0 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 @@ -1,32 +1,21 @@ # coding=utf-8 # -------------------------------------------------------------------------- -# # Copyright (c) Microsoft Corporation. All rights reserved. -# -# The MIT License (MIT) -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the ""Software""), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. -# +# Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------- +"""Customize generated code here. + +Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize +""" + + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level -# 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(): - pass + """Do not remove from this file. + + `patch_sdk` is a last resort escape hatch that allows you to do customizations + you can't accomplish using the techniques described in + https://aka.ms/azsdk/python/dpcodegen/python/customize + """ 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 8add9d7322c9..52d6388fc113 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 @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,239 +12,225 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore -from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore -from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore -from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._database_advisors_operations import DatabaseAdvisorsOperations # type: ignore -from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations # type: ignore -from ._database_columns_operations import DatabaseColumnsOperations # type: ignore -from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore -from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore -from ._database_operations_operations import DatabaseOperationsOperations # type: ignore -from ._database_recommended_actions_operations import DatabaseRecommendedActionsOperations # type: ignore -from ._databases_operations import DatabasesOperations # type: ignore -from ._database_schemas_operations import DatabaseSchemasOperations # type: ignore -from ._database_security_alert_policies_operations import DatabaseSecurityAlertPoliciesOperations # type: ignore -from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore -from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._database_tables_operations import DatabaseTablesOperations # type: ignore -from ._database_usages_operations import DatabaseUsagesOperations # type: ignore -from ._database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore -from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore -from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore -from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore -from ._data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations # type: ignore -from ._deleted_servers_operations import DeletedServersOperations # type: ignore -from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore -from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations # type: ignore -from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore -from ._encryption_protectors_operations import EncryptionProtectorsOperations # type: ignore -from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore -from ._failover_groups_operations import FailoverGroupsOperations # type: ignore -from ._firewall_rules_operations import FirewallRulesOperations # type: ignore -from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore -from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore -from ._instance_pool_operations_operations import InstancePoolOperationsOperations # type: ignore -from ._instance_pools_operations import InstancePoolsOperations # type: ignore -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore -from ._job_agents_operations import JobAgentsOperations # type: ignore -from ._job_credentials_operations import JobCredentialsOperations # type: ignore -from ._job_executions_operations import JobExecutionsOperations # type: ignore -from ._job_private_endpoints_operations import JobPrivateEndpointsOperations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._job_step_executions_operations import JobStepExecutionsOperations # type: ignore -from ._job_steps_operations import JobStepsOperations # type: ignore -from ._job_target_executions_operations import JobTargetExecutionsOperations # type: ignore -from ._job_target_groups_operations import JobTargetGroupsOperations # type: ignore -from ._job_versions_operations import JobVersionsOperations # type: ignore -from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore -from ._capabilities_operations import CapabilitiesOperations # type: ignore -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore -from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore -from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations # type: ignore -from ._maintenance_windows_operations import MaintenanceWindowsOperations # type: ignore -from ._managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore -from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_database_columns_operations import ManagedDatabaseColumnsOperations # type: ignore -from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore -from ._managed_database_queries_operations import ManagedDatabaseQueriesOperations # type: ignore -from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore -from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore -from ._managed_database_schemas_operations import ManagedDatabaseSchemasOperations # type: ignore -from ._managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore -from ._managed_database_security_events_operations import ManagedDatabaseSecurityEventsOperations # type: ignore -from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore -from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore -from ._managed_database_tables_operations import ManagedDatabaseTablesOperations # type: ignore -from ._managed_database_transparent_data_encryption_operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore -from ._managed_database_vulnerability_assessment_rule_baselines_operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore -from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore -from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations # type: ignore -from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore -from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore -from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore -from ._managed_instance_keys_operations import ManagedInstanceKeysOperations # type: ignore -from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore -from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations # type: ignore -from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore -from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore -from ._managed_instances_operations import ManagedInstancesOperations # type: ignore -from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations # type: ignore -from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore -from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore -from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore -from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore -from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._operations import Operations # type: ignore -from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore -from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations # type: ignore -from ._replication_links_operations import ReplicationLinksOperations # type: ignore -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore -from ._restore_points_operations import RestorePointsOperations # type: ignore -from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore -from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore -from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore -from ._server_advisors_operations import ServerAdvisorsOperations # type: ignore -from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations # type: ignore -from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations # type: ignore -from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore -from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore -from ._server_dev_ops_audit_settings_operations import ServerDevOpsAuditSettingsOperations # type: ignore -from ._server_dns_aliases_operations import ServerDnsAliasesOperations # type: ignore -from ._server_keys_operations import ServerKeysOperations # type: ignore -from ._server_operations_operations import ServerOperationsOperations # type: ignore -from ._servers_operations import ServersOperations # type: ignore -from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations # type: ignore -from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore -from ._server_trust_groups_operations import ServerTrustGroupsOperations # type: ignore -from ._server_usages_operations import ServerUsagesOperations # type: ignore -from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations # type: ignore -from ._sql_agent_operations import SqlAgentOperations # type: ignore -from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore -from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations # type: ignore -from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations # type: ignore -from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations # type: ignore -from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore -from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore -from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore -from ._sync_agents_operations import SyncAgentsOperations # type: ignore -from ._sync_groups_operations import SyncGroupsOperations # type: ignore -from ._sync_members_operations import SyncMembersOperations # type: ignore -from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore -from ._time_zones_operations import TimeZonesOperations # type: ignore -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore -from ._usages_operations import UsagesOperations # type: ignore -from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore -from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore -from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore -from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore +from ._operations import BackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import DatabaseColumnsOperations # type: ignore +from ._operations import RestorePointsOperations # type: ignore +from ._operations import SensitivityLabelsOperations # type: ignore +from ._operations import DatabasesOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import ReplicationLinksOperations # type: ignore +from ._operations import ServersOperations # type: ignore +from ._operations import ServerBlobAuditingPoliciesOperations # type: ignore +from ._operations import DatabaseBlobAuditingPoliciesOperations # type: ignore +from ._operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore +from ._operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore +from ._operations import ServerAdvisorsOperations # type: ignore +from ._operations import ManagedDatabaseColumnsOperations # type: ignore +from ._operations import DatabaseTablesOperations # type: ignore +from ._operations import ManagedDatabaseTablesOperations # type: ignore +from ._operations import DatabaseSchemasOperations # type: ignore +from ._operations import ManagedDatabaseSchemasOperations # type: ignore +from ._operations import DatabaseSecurityAlertPoliciesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentsOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentRuleBaselineOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DataMaskingPoliciesOperations # type: ignore +from ._operations import DeletedServersOperations # type: ignore +from ._operations import DistributedAvailabilityGroupsOperations # type: ignore +from ._operations import ManagedDatabasesOperations # type: ignore +from ._operations import ServerTrustGroupsOperations # type: ignore +from ._operations import ManagedInstancesOperations # type: ignore +from ._operations import ElasticPoolsOperations # type: ignore +from ._operations import EncryptionProtectorsOperations # type: ignore +from ._operations import EndpointCertificatesOperations # type: ignore +from ._operations import FailoverGroupsOperations # type: ignore +from ._operations import GeoBackupPoliciesOperations # type: ignore +from ._operations import InstanceFailoverGroupsOperations # type: ignore +from ._operations import InstancePoolOperationsOperations # type: ignore +from ._operations import InstancePoolsOperations # type: ignore +from ._operations import IPv6FirewallRulesOperations # type: ignore +from ._operations import JobExecutionsOperations # type: ignore +from ._operations import JobAgentsOperations # type: ignore +from ._operations import JobCredentialsOperations # type: ignore +from ._operations import JobStepExecutionsOperations # type: ignore +from ._operations import JobTargetExecutionsOperations # type: ignore +from ._operations import JobsOperations # type: ignore +from ._operations import JobPrivateEndpointsOperations # type: ignore +from ._operations import JobStepsOperations # type: ignore +from ._operations import JobTargetGroupsOperations # type: ignore +from ._operations import JobVersionsOperations # type: ignore +from ._operations import LongTermRetentionBackupsOperations # type: ignore +from ._operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore +from ._operations import LongTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore +from ._operations import ManagedInstanceAdministratorsOperations # type: ignore +from ._operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore +from ._operations import ManagedInstanceDtcsOperations # type: ignore +from ._operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore +from ._operations import ManagedInstanceKeysOperations # type: ignore +from ._operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedInstanceOperationsOperations # type: ignore +from ._operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore +from ._operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedServerDnsAliasesOperations # type: ignore +from ._operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore +from ._operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore +from ._operations import OutboundFirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import RecoverableDatabasesOperations # type: ignore +from ._operations import RecoverableManagedDatabasesOperations # type: ignore +from ._operations import RestorableDroppedDatabasesOperations # type: ignore +from ._operations import RestorableDroppedManagedDatabasesOperations # type: ignore +from ._operations import ServerAzureADAdministratorsOperations # type: ignore +from ._operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore +from ._operations import ServerConfigurationOptionsOperations # type: ignore +from ._operations import ServerConnectionPoliciesOperations # type: ignore +from ._operations import ServerDevOpsAuditSettingsOperations # type: ignore +from ._operations import ServerDnsAliasesOperations # type: ignore +from ._operations import ServerKeysOperations # type: ignore +from ._operations import ServerSecurityAlertPoliciesOperations # type: ignore +from ._operations import ServerTrustCertificatesOperations # type: ignore +from ._operations import ServerVulnerabilityAssessmentsOperations # type: ignore +from ._operations import StartStopManagedInstanceSchedulesOperations # type: ignore +from ._operations import SubscriptionUsagesOperations # type: ignore +from ._operations import SyncAgentsOperations # type: ignore +from ._operations import SyncGroupsOperations # type: ignore +from ._operations import SyncMembersOperations # type: ignore +from ._operations import TimeZonesOperations # type: ignore +from ._operations import VirtualClustersOperations # type: ignore +from ._operations import VirtualNetworkRulesOperations # type: ignore +from ._operations import WorkloadClassifiersOperations # type: ignore +from ._operations import WorkloadGroupsOperations # type: ignore +from ._operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore +from ._operations import DatabaseEncryptionProtectorsOperations # type: ignore +from ._operations import DatabaseOperationsOperations # type: ignore +from ._operations import DatabaseUsagesOperations # type: ignore +from ._operations import RecommendedSensitivityLabelsOperations # type: ignore +from ._operations import SynapseLinkWorkspacesOperations # type: ignore +from ._operations import ServerOperationsOperations # type: ignore +from ._operations import ServerUsagesOperations # type: ignore +from ._operations import TdeCertificatesOperations # type: ignore +from ._operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import DatabaseAdvisorsOperations # type: ignore +from ._operations import DatabaseAutomaticTuningOperations # type: ignore +from ._operations import DatabaseExtensionsOperations # type: ignore +from ._operations import DatabaseRecommendedActionsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DataMaskingRulesOperations # type: ignore +from ._operations import DataWarehouseUserActivitiesOperations # type: ignore +from ._operations import ManagedDatabaseSecurityEventsOperations # type: ignore +from ._operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore +from ._operations import ManagedInstanceTdeCertificatesOperations # type: ignore +from ._operations import ElasticPoolOperationsOperations # type: ignore +from ._operations import UsagesOperations # type: ignore +from ._operations import LedgerDigestUploadsOperations # type: ignore +from ._operations import MaintenanceWindowOptionsOperations # type: ignore +from ._operations import MaintenanceWindowsOperations # type: ignore +from ._operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ManagedDatabaseMoveOperationsOperations # type: ignore +from ._operations import ManagedDatabaseQueriesOperations # type: ignore +from ._operations import ManagedDatabaseRestoreDetailsOperations # type: ignore +from ._operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore +from ._operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore +from ._operations import ManagedLedgerDigestUploadsOperations # type: ignore +from ._operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ServerAutomaticTuningOperations # type: ignore +from ._operations import SqlAgentOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import CapabilitiesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Operations", "BackupShortTermRetentionPoliciesOperations", + "DatabaseColumnsOperations", + "RestorePointsOperations", + "SensitivityLabelsOperations", + "DatabasesOperations", + "FirewallRulesOperations", + "ReplicationLinksOperations", + "ServersOperations", "ServerBlobAuditingPoliciesOperations", "DatabaseBlobAuditingPoliciesOperations", "ExtendedDatabaseBlobAuditingPoliciesOperations", "ExtendedServerBlobAuditingPoliciesOperations", - "DatabaseAdvancedThreatProtectionSettingsOperations", - "DatabaseAdvisorsOperations", - "DatabaseAutomaticTuningOperations", - "DatabaseColumnsOperations", - "DatabaseEncryptionProtectorsOperations", - "DatabaseExtensionsOperations", - "DatabaseOperationsOperations", - "DatabaseRecommendedActionsOperations", - "DatabasesOperations", + "ServerAdvisorsOperations", + "ManagedDatabaseColumnsOperations", + "DatabaseTablesOperations", + "ManagedDatabaseTablesOperations", "DatabaseSchemasOperations", + "ManagedDatabaseSchemasOperations", "DatabaseSecurityAlertPoliciesOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentBaselineOperations", + "SqlVulnerabilityAssessmentsOperations", + "SqlVulnerabilityAssessmentsSettingsOperations", "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "SqlVulnerabilityAssessmentRuleBaselineOperations", "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", - "DatabaseTablesOperations", - "DatabaseUsagesOperations", + "SqlVulnerabilityAssessmentScanResultOperations", + "SqlVulnerabilityAssessmentScansOperations", "DatabaseVulnerabilityAssessmentRuleBaselinesOperations", + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", "DatabaseVulnerabilityAssessmentsOperations", - "DatabaseVulnerabilityAssessmentScansOperations", + "ManagedDatabaseVulnerabilityAssessmentsOperations", + "ManagedDatabaseVulnerabilityAssessmentScansOperations", "DataMaskingPoliciesOperations", - "DataMaskingRulesOperations", - "DataWarehouseUserActivitiesOperations", "DeletedServersOperations", "DistributedAvailabilityGroupsOperations", - "ElasticPoolOperationsOperations", + "ManagedDatabasesOperations", + "ServerTrustGroupsOperations", + "ManagedInstancesOperations", "ElasticPoolsOperations", "EncryptionProtectorsOperations", "EndpointCertificatesOperations", "FailoverGroupsOperations", - "FirewallRulesOperations", "GeoBackupPoliciesOperations", "InstanceFailoverGroupsOperations", "InstancePoolOperationsOperations", "InstancePoolsOperations", "IPv6FirewallRulesOperations", + "JobExecutionsOperations", "JobAgentsOperations", "JobCredentialsOperations", - "JobExecutionsOperations", - "JobPrivateEndpointsOperations", - "JobsOperations", "JobStepExecutionsOperations", - "JobStepsOperations", "JobTargetExecutionsOperations", + "JobsOperations", + "JobPrivateEndpointsOperations", + "JobStepsOperations", "JobTargetGroupsOperations", "JobVersionsOperations", - "LedgerDigestUploadsOperations", - "CapabilitiesOperations", "LongTermRetentionBackupsOperations", "LongTermRetentionManagedInstanceBackupsOperations", "LongTermRetentionPoliciesOperations", - "MaintenanceWindowOptionsOperations", - "MaintenanceWindowsOperations", "ManagedBackupShortTermRetentionPoliciesOperations", - "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", - "ManagedDatabaseColumnsOperations", - "ManagedDatabaseMoveOperationsOperations", - "ManagedDatabaseQueriesOperations", - "ManagedDatabaseRestoreDetailsOperations", - "ManagedDatabasesOperations", - "ManagedDatabaseSchemasOperations", + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", "ManagedDatabaseSecurityAlertPoliciesOperations", - "ManagedDatabaseSecurityEventsOperations", - "ManagedDatabaseSensitivityLabelsOperations", - "ManagedDatabaseRecommendedSensitivityLabelsOperations", - "ManagedDatabaseTablesOperations", - "ManagedDatabaseTransparentDataEncryptionOperations", - "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", - "ManagedDatabaseVulnerabilityAssessmentsOperations", - "ManagedDatabaseVulnerabilityAssessmentScansOperations", "ManagedInstanceAdministratorsOperations", - "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAzureADOnlyAuthenticationsOperations", "ManagedInstanceDtcsOperations", "ManagedInstanceEncryptionProtectorsOperations", @@ -253,30 +238,17 @@ "ManagedInstanceLongTermRetentionPoliciesOperations", "ManagedInstanceOperationsOperations", "ManagedInstancePrivateEndpointConnectionsOperations", - "ManagedInstancePrivateLinkResourcesOperations", - "ManagedInstancesOperations", - "ManagedInstanceTdeCertificatesOperations", "ManagedInstanceVulnerabilityAssessmentsOperations", - "ManagedLedgerDigestUploadsOperations", - "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", "ManagedServerDnsAliasesOperations", "ManagedServerSecurityAlertPoliciesOperations", "NetworkSecurityPerimeterConfigurationsOperations", - "Operations", "OutboundFirewallRulesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", "RecoverableDatabasesOperations", "RecoverableManagedDatabasesOperations", - "ReplicationLinksOperations", "RestorableDroppedDatabasesOperations", "RestorableDroppedManagedDatabasesOperations", - "RestorePointsOperations", - "SensitivityLabelsOperations", - "RecommendedSensitivityLabelsOperations", - "ServerAdvancedThreatProtectionSettingsOperations", - "ServerAdvisorsOperations", - "ServerAutomaticTuningOperations", "ServerAzureADAdministratorsOperations", "ServerAzureADOnlyAuthenticationsOperations", "ServerConfigurationOptionsOperations", @@ -284,37 +256,64 @@ "ServerDevOpsAuditSettingsOperations", "ServerDnsAliasesOperations", "ServerKeysOperations", - "ServerOperationsOperations", - "ServersOperations", "ServerSecurityAlertPoliciesOperations", "ServerTrustCertificatesOperations", - "ServerTrustGroupsOperations", - "ServerUsagesOperations", "ServerVulnerabilityAssessmentsOperations", - "SqlAgentOperations", - "SqlVulnerabilityAssessmentBaselineOperations", - "SqlVulnerabilityAssessmentBaselinesOperations", - "SqlVulnerabilityAssessmentExecuteScanOperations", - "SqlVulnerabilityAssessmentRuleBaselineOperations", - "SqlVulnerabilityAssessmentRuleBaselinesOperations", - "SqlVulnerabilityAssessmentScanResultOperations", - "SqlVulnerabilityAssessmentScansOperations", - "SqlVulnerabilityAssessmentsSettingsOperations", - "SqlVulnerabilityAssessmentsOperations", "StartStopManagedInstanceSchedulesOperations", "SubscriptionUsagesOperations", - "SynapseLinkWorkspacesOperations", "SyncAgentsOperations", "SyncGroupsOperations", "SyncMembersOperations", - "TdeCertificatesOperations", "TimeZonesOperations", - "TransparentDataEncryptionsOperations", - "UsagesOperations", "VirtualClustersOperations", "VirtualNetworkRulesOperations", "WorkloadClassifiersOperations", "WorkloadGroupsOperations", + "ManagedDatabaseSensitivityLabelsOperations", + "DatabaseEncryptionProtectorsOperations", + "DatabaseOperationsOperations", + "DatabaseUsagesOperations", + "RecommendedSensitivityLabelsOperations", + "SynapseLinkWorkspacesOperations", + "ServerOperationsOperations", + "ServerUsagesOperations", + "TdeCertificatesOperations", + "DatabaseAdvancedThreatProtectionSettingsOperations", + "DatabaseAdvisorsOperations", + "DatabaseAutomaticTuningOperations", + "DatabaseExtensionsOperations", + "DatabaseRecommendedActionsOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "SqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseVulnerabilityAssessmentScansOperations", + "DataMaskingRulesOperations", + "DataWarehouseUserActivitiesOperations", + "ManagedDatabaseSecurityEventsOperations", + "ManagedDatabaseRecommendedSensitivityLabelsOperations", + "ManagedInstanceTdeCertificatesOperations", + "ElasticPoolOperationsOperations", + "UsagesOperations", + "LedgerDigestUploadsOperations", + "MaintenanceWindowOptionsOperations", + "MaintenanceWindowsOperations", + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", + "ManagedDatabaseMoveOperationsOperations", + "ManagedDatabaseQueriesOperations", + "ManagedDatabaseRestoreDetailsOperations", + "ManagedDatabaseTransparentDataEncryptionOperations", + "ManagedInstanceAdvancedThreatProtectionSettingsOperations", + "ManagedInstancePrivateLinkResourcesOperations", + "ManagedLedgerDigestUploadsOperations", + "ServerAdvancedThreatProtectionSettingsOperations", + "ServerAutomaticTuningOperations", + "SqlAgentOperations", + "TransparentDataEncryptionsOperations", + "CapabilitiesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 deleted file mode 100644 index ae5df95ea141..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,684 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._backup_short_term_retention_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class BackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.BackupShortTermRetentionPolicy"]: - """Gets a database's short term retention policy. - - :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 - :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.BackupShortTermRetentionPolicy: - """Gets a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :return: BackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: _models.BackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :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 BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - BackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_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.BackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BackupShortTermRetentionPolicy]( - 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, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: _models.BackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :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 BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - BackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either BackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_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.BackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.BackupShortTermRetentionPolicy]( - 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/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py deleted file mode 100644 index f9bec1fb429a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_capabilities_operations.py +++ /dev/null @@ -1,116 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._capabilities_operations import build_list_by_location_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class CapabilitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`capabilities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_by_location( - self, location_name: str, include: Optional[Union[str, _models.CapabilityGroup]] = None, **kwargs: Any - ) -> _models.LocationCapabilities: - """Gets the subscription capabilities available for the specified location. - - :param location_name: The location name whose capabilities are retrieved. Required. - :type location_name: str - :param include: If specified, restricts the response to only include the selected item. Known - values are: "supportedEditions", "supportedElasticPoolEditions", - "supportedManagedInstanceVersions", "supportedInstancePoolEditions", - "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. - :type include: str or ~azure.mgmt.sql.models.CapabilityGroup - :return: LocationCapabilities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LocationCapabilities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - include=include, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LocationCapabilities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7585863d06c6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_policies_operations.py +++ /dev/null @@ -1,284 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._data_masking_policies_operations import build_create_or_update_request, build_get_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DataMaskingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`data_masking_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Gets the database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: _models.DataMaskingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. 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: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: Union[_models.DataMaskingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. Is either a - DataMaskingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or IO[bytes] - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataMaskingPolicy] = 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, "DataMaskingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index aadbddc44faf..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_masking_rules_operations.py +++ /dev/null @@ -1,325 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._data_masking_rules_operations import build_create_or_update_request, build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DataMaskingRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`data_masking_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - **kwargs: Any - ) -> AsyncItemPaged["_models.DataMaskingRule"]: - """Gets a list of database data masking rules. - - :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 data_masking_policy_name: The name of the database for which the data masking rule - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :return: An iterator like instance of either DataMaskingRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataMaskingRule] - :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", self._config.api_version)) - cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: _models.DataMaskingRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. - Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. - 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: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: Union[_models.DataMaskingRule, IO[bytes]], - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. Is - either a DataMaskingRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingRule or IO[bytes] - :return: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataMaskingRule] = 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, "DataMaskingRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - data_masking_rule_name=data_masking_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DataMaskingRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 6e5e7a0dfad2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_data_warehouse_user_activities_operations.py +++ /dev/null @@ -1,222 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._data_warehouse_user_activities_operations import build_get_request, build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DataWarehouseUserActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`data_warehouse_user_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DataWarehouseUserActivities"]: - """List the user activities of a data warehouse which includes running and suspended queries. - - :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 - :return: An iterator like instance of either DataWarehouseUserActivities or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataWarehouseUserActivities] - :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", self._config.api_version)) - cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataWarehouseUserActivitiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - **kwargs: Any - ) -> _models.DataWarehouseUserActivities: - """Gets the user activities of a data warehouse which includes running and suspended queries. - - :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" - Required. - :type data_warehouse_user_activity_name: str or - ~azure.mgmt.sql.models.DataWarehouseUserActivityName - :return: DataWarehouseUserActivities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_warehouse_user_activity_name=data_warehouse_user_activity_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 56dfe4fd62bd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,387 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_advanced_threat_protection_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseAdvancedThreatProtection"]: - """Gets a list of database's Advanced Threat Protection states. - - :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 - :return: An iterator like instance of either DatabaseAdvancedThreatProtection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Gets a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.DatabaseAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. 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: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.DatabaseAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. Is either a - DatabaseAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection or IO[bytes] - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseAdvancedThreatProtection] = 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, "DatabaseAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 790b8adaaa3b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_advisors_operations.py +++ /dev/null @@ -1,351 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_advisors_operations import ( - build_get_request, - build_list_by_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseAdvisorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_advisors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> List[_models.Advisor]: - """Gets a list of database advisors. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: list of Advisor or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.Advisor] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[Advisor]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> _models.Advisor: - """Gets a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: _models.Advisor, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. 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: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: Union[_models.Advisor, IO[bytes]], - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Is either a Advisor type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor or IO[bytes] - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Advisor] = 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, "Advisor") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 63a8dde7d110..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_automatic_tuning_operations.py +++ /dev/null @@ -1,262 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_automatic_tuning_operations import build_get_request, build_update_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseAutomaticTuningOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_automatic_tuning` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Gets a database's automatic tuning. - - :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 - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseAutomaticTuning, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. 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: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseAutomaticTuning, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. Is either a - DatabaseAutomaticTuning type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning or IO[bytes] - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseAutomaticTuning] = 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, "DatabaseAutomaticTuning") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 1c9fe8f3cf9e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_blob_auditing_policies_operations.py +++ /dev/null @@ -1,365 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_blob_auditing_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseBlobAuditingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseBlobAuditingPolicy"]: - """Lists auditing settings of a database. - - :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 - :return: An iterator like instance of either DatabaseBlobAuditingPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Gets a database's blob auditing policy. - - :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 - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. 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: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. Is either a DatabaseBlobAuditingPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy or IO[bytes] - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseBlobAuditingPolicy] = 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, "DatabaseBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 00f928428263..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_columns_operations.py +++ /dev/null @@ -1,362 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_columns_operations import ( - build_get_request, - build_list_by_database_request, - build_list_by_table_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseColumnsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_columns` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseColumn"]: - """List database columns. - - :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 schema: Default value is None. - :type schema: list[str] - :param table: Default value is None. - :type table: list[str] - :param column: Default value is None. - :type column: list[str] - :param order_by: Default value is None. - :type order_by: list[str] - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - schema=schema, - table=table, - column=column, - order_by=order_by, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_table( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseColumn"]: - """List database columns. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_table_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> _models.DatabaseColumn: - """Get database column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: DatabaseColumn or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseColumn - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseColumn", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index dd09f5ab6fa5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_encryption_protectors_operations.py +++ /dev/null @@ -1,325 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_encryption_protectors_operations import build_revalidate_request, build_revert_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseEncryptionProtectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _revalidate_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_revalidate( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revalidates an existing encryption protector for a particular database. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _revert_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revert_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_revert( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reverts an existing encryption protector for a particular database. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revert_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py deleted file mode 100644 index f6a1ff20e110..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_extensions_operations.py +++ /dev/null @@ -1,450 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_extensions_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseExtensionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_extensions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ImportExportExtensionsOperationResult"]: - """List database extension. This will return an empty list as it is not supported. - - :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 - :return: An iterator like instance of either ImportExportExtensionsOperationResult or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any - ) -> None: - """Gets a database extension. This will return resource not found as it is not supported. - - :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 extension_name: Required. - :type extension_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: Union[_models.DatabaseExtensions, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DatabaseExtensions") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: _models.DatabaseExtensions, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions - :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 - ImportExportExtensionsOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import 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 - ImportExportExtensionsOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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, - extension_name: str, - parameters: Union[_models.DatabaseExtensions, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import request parameters. Is either a DatabaseExtensions type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ImportExportExtensionsOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportExtensionsOperationResult] = 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, - extension_name=extension_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationResult", pipeline_response.http_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.ImportExportExtensionsOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ImportExportExtensionsOperationResult]( - 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/_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py deleted file mode 100644 index 3480329204c1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_operations_operations.py +++ /dev/null @@ -1,209 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_operations_operations import build_cancel_request, build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseOperation"]: - """Gets a list of operations performed on the database. - - :param resource_group_name: The name of the resource group that contains the resource. - 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 - :return: An iterator like instance of either DatabaseOperation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseOperation] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel( - self, resource_group_name: str, server_name: str, database_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the database. - - :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 operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 1e2ba9161d7e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_recommended_actions_operations.py +++ /dev/null @@ -1,365 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_recommended_actions_operations import ( - build_get_request, - build_list_by_database_advisor_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseRecommendedActionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_recommended_actions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_by_database_advisor( - self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> List[_models.RecommendedActionAutoGenerated]: - """Gets list of Database Recommended Actions. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :return: list of RecommendedActionAutoGenerated or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.RecommendedActionAutoGenerated] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.RecommendedActionAutoGenerated]] = kwargs.pop("cls", None) - - _request = build_list_by_database_advisor_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[RecommendedActionAutoGenerated]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Gets a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - recommended_action_name=recommended_action_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: _models.RecommendedActionAutoGenerated, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. 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: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: Union[_models.RecommendedActionAutoGenerated, IO[bytes]], - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. Is either a - RecommendedActionAutoGenerated type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated or IO[bytes] - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RecommendedActionAutoGenerated] = 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, "RecommendedActionAutoGenerated") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - recommended_action_name=recommended_action_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b3aac1b573e5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_schemas_operations.py +++ /dev/null @@ -1,222 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_schemas_operations import build_get_request, build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_schemas` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSchema"]: - """List database schemas. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseSchema or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSchema] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, schema_name: str, **kwargs: Any - ) -> _models.DatabaseSchema: - """Get database schema. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :return: DatabaseSchema or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSchema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSchema", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 3516ce81ccfa..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_security_alert_policies_operations.py +++ /dev/null @@ -1,384 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_security_alert_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSecurityAlertPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSecurityAlertPolicy"]: - """Gets a list of database's security alert policies. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Gets a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: _models.DatabaseSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. 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: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: Union[_models.DatabaseSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Is either a DatabaseSecurityAlertPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or IO[bytes] - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSecurityAlertPolicy] = 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, "DatabaseSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 3e877f854e21..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ /dev/null @@ -1,414 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessment_baselines_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_sql_vulnerability_assessment_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessment( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentBaselineSet or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessment_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0ec13ee3f0cc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ /dev/null @@ -1,189 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessment_execute_scan_operations import build_execute_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_execute_scan` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _execute_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_execute_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_execute( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :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", self._config.api_version)) - 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._execute_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index bf0448e5d5c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,509 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessment_rule_baselines_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_baseline_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_baseline( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentRuleBaseline or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_baseline_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Gets a database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineInput type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or - IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 6c319ba0e545..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ /dev/null @@ -1,249 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessment_scan_result_operations import ( - build_get_request, - build_list_by_scan_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_scan_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanResults or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] - :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", self._config.api_version)) - cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanResults: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :param scan_result_id: The scan result id of the specific result to retrieve. Required. - :type scan_result_id: str - :return: SqlVulnerabilityAssessmentScanResults or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - scan_result_id=scan_result_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c41bbbc2ec8e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,237 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessment_scans_operations import ( - build_get_request, - build_list_by_sql_vulnerability_assessments_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessments( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanRecord or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessments_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanRecord: - """Get a database vulnerability assessment scan result. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: SqlVulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index fae0af0fade0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ /dev/null @@ -1,225 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_sql_vulnerability_assessments_settings_operations import ( - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseSqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessments_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessment"]: - """Lists SQL Vulnerability Assessment policies associated with a database. - - :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 - :return: An iterator like instance of either SqlVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Gets SQL Vulnerability Assessment policy for database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b8a1c43164e6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_tables_operations.py +++ /dev/null @@ -1,235 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_tables_operations import build_get_request, build_list_by_schema_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseTablesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_tables` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_schema( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseTable"]: - """List database tables. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseTable or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseTable] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseTableListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - **kwargs: Any - ) -> _models.DatabaseTable: - """Get database table. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :return: DatabaseTable or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseTable - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseTable", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 381caddb3140..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_usages_operations.py +++ /dev/null @@ -1,145 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_usages_operations import build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseUsage"]: - """Gets database usages. - - :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 - :return: An iterator like instance of either DatabaseUsage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseUsage] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 651ec563aa72..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,409 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_vulnerability_assessment_rule_baselines_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Gets a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseVulnerabilityAssessmentRuleBaseline type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or - IO[bytes] - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseVulnerabilityAssessmentRuleBaseline") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 1519d2780023..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,458 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_vulnerability_assessment_scans_operations import ( - build_export_request, - build_get_request, - build_initiate_scan_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentScansExport: - """Convert an existing scan result to a human readable format. If already exists nothing happens. - - :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 scanned database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id. Required. - :type scan_id: str - :return: DatabaseVulnerabilityAssessmentScansExport or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) - - _request = build_export_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _initiate_scan_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_initiate_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", self._config.api_version)) - 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._initiate_scan_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py deleted file mode 100644 index 5d3c388b76c8..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_database_vulnerability_assessments_operations.py +++ /dev/null @@ -1,459 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._database_vulnerability_assessments_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`database_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a database. - - :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 for which the vulnerability assessment policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Gets the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.DatabaseVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.DatabaseVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a DatabaseVulnerabilityAssessment type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or IO[bytes] - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = 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, "DatabaseVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index c92a3d32b7cd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py +++ /dev/null @@ -1,2026 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._databases_operations import ( - build_create_or_update_request, - build_delete_request, - build_export_request, - build_failover_request, - build_get_request, - build_import_method_request, - build_list_by_elastic_pool_request, - build_list_by_server_request, - build_list_inaccessible_by_server_request, - build_pause_request, - build_rename_request, - build_resume_request, - build_update_request, - build_upgrade_data_warehouse_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DatabasesOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Database"]: - """Gets a list of databases. - - :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 skip_token: Default value is None. - :type skip_token: str - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.Database: - """Gets a database. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: Database or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Database - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Database] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Database", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.Database, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Database") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.Database, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Database - :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 Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. 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 Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :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, - parameters: Union[_models.Database, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. Is either a Database type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Database or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Database] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the database. - - :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 - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - parameters: Union[_models.DatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate - :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 Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. 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 Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. Is either a DatabaseUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Database] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _export_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ExportDatabaseDefinition") - - _request = build_export_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ExportDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition - :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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export 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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export request parameters. Is either a ExportDatabaseDefinition - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ImportExportOperationResult]( - 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, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - replica_type=replica_type, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, - resource_group_name: str, - server_name: str, - database_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Failovers a database. - - :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 to failover. Required. - :type database_name: str - :param replica_type: The type of replica to be failed over. Known values are: "Primary" and - "ReadableSecondary". Default value is None. - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - replica_type=replica_type, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _import_method_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ImportExistingDatabaseDefinition") - - _request = build_import_method_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ImportExistingDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition - :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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import 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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Is either a - ImportExistingDatabaseDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ImportExportOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - async def rename( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ResourceMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. Required. - :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def rename( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def rename( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ResourceMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. Is either a - ResourceMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "ResourceMoveDefinition") - - _request = build_rename_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - async def _pause_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_pause( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Pauses a database. - - :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 to be paused. Required. - :type database_name: str - :return: An instance of AsyncLROPoller that returns either Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.Database] = 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._pause_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _resume_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_resume( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.Database]: - """Resumes a database. - - :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 to be resumed. Required. - :type database_name: str - :return: An instance of AsyncLROPoller that returns either Database or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.Database] = 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._resume_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _upgrade_data_warehouse_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_upgrade_data_warehouse_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_upgrade_data_warehouse( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Upgrades a data warehouse. - - :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 to be upgraded. Required. - :type database_name: str - :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", self._config.api_version)) - 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._upgrade_data_warehouse_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Database"]: - """Gets a list of databases in an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_inaccessible_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Database"]: - """Gets a list of inaccessible databases in a logical server. - - :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 - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_inaccessible_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index a4b4c826dfd4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_deleted_servers_operations.py +++ /dev/null @@ -1,399 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._deleted_servers_operations import ( - build_get_request, - build_list_by_location_request, - build_list_request, - build_recover_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DeletedServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`deleted_servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: - """Gets a list of all deleted servers in a subscription. - - :return: An iterator like instance of either DeletedServer or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DeletedServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: - """Gets a list of deleted servers for a location. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either DeletedServer or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DeletedServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: - """Gets a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: DeletedServer or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DeletedServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DeletedServer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _recover_initial( - self, location_name: str, deleted_server_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_recover_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_recover( - self, location_name: str, deleted_server_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.DeletedServer]: - """Recovers a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: An instance of AsyncLROPoller that returns either DeletedServer or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServer] = 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._recover_initial( - location_name=location_name, - deleted_server_name=deleted_server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DeletedServer", pipeline_response.http_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.DeletedServer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.DeletedServer]( - 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/_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py deleted file mode 100644 index f1a7885e72cd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_distributed_availability_groups_operations.py +++ /dev/null @@ -1,1205 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -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, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class DistributedAvailabilityGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`distributed_availability_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DistributedAvailabilityGroup"]: - """Gets a list of a distributed availability groups in instance. - - :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 iterator like instance of either DistributedAvailabilityGroup or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :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", self._config.api_version)) - cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroupsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> _models.DistributedAvailabilityGroup: - """Gets a distributed availability group info. - - :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 - :return: DistributedAvailabilityGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") - - _request = build_create_or_update_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :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_create_or_update( - 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]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. 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_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. Is either a - DistributedAvailabilityGroup type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup 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", self._config.api_version)) - 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._create_or_update_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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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.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 _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") - - _request = build_update_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Updates a distributed availability group replication mode. - - :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 info. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :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_update( - 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]: - """Updates a distributed availability group replication mode. - - :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 info. 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_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: - """Updates a distributed availability group replication mode. - - :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 info. Is either a - DistributedAvailabilityGroup type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup 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", self._config.api_version)) - 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._update_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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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.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 _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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", self._config.api_version)) - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py deleted file mode 100644 index d43979849ec2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pool_operations_operations.py +++ /dev/null @@ -1,210 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._elastic_pool_operations_operations import build_cancel_request, build_list_by_elastic_pool_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ElasticPoolOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`elastic_pool_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticPoolOperation"]: - """Gets a list of operations performed on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolOperation or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPoolOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def cancel( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :param operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 4a0126e2f863..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_elastic_pools_operations.py +++ /dev/null @@ -1,887 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._elastic_pools_operations import ( - build_create_or_update_request, - build_delete_request, - build_failover_request, - build_get_request, - build_list_by_server_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ElasticPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`elastic_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, skip: Optional[int] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ElasticPool"]: - """Gets all elastic pools in a server. - - :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 skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :return: An iterator like instance of either ElasticPool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> _models.ElasticPool: - """Gets an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: ElasticPool or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ElasticPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ElasticPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPool, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ElasticPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: _models.ElasticPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPool - :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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool 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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPool, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool parameters. Is either a ElasticPool type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPool or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticPool] = 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, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ElasticPool", pipeline_response.http_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": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ElasticPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - elastic_pool_name: str, - parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ElasticPoolUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: _models.ElasticPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate - :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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update 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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update parameters. Is either a ElasticPoolUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticPool] = 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, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ElasticPool", pipeline_response.http_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.ElasticPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ElasticPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _failover_initial( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Failovers an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool to failover. Required. - :type elastic_pool_name: str - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py deleted file mode 100644 index 51929cdc1d16..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_encryption_protectors_operations.py +++ /dev/null @@ -1,563 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._encryption_protectors_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, - build_revalidate_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class EncryptionProtectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.EncryptionProtector"]: - """Gets a list of server encryption protectors. - - :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 - :return: An iterator like instance of either EncryptionProtector or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.EncryptionProtector] - :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", self._config.api_version)) - cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EncryptionProtectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> _models.EncryptionProtector: - """Gets a server encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be retrieved. - "current" Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :return: EncryptionProtector or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.EncryptionProtector - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("EncryptionProtector", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.EncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "EncryptionProtector") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: _models.EncryptionProtector, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Required. - :type parameters: ~azure.mgmt.sql.models.EncryptionProtector - :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 EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. 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 EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.EncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Is either a - EncryptionProtector type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.EncryptionProtector or IO[bytes] - :return: An instance of AsyncLROPoller that returns either EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EncryptionProtector] = 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, - encryption_protector_name=encryption_protector_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("EncryptionProtector", pipeline_response.http_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.EncryptionProtector].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.EncryptionProtector]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _revalidate_initial( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_revalidate( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py deleted file mode 100644 index c31609cb68fa..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_endpoint_certificates_operations.py +++ /dev/null @@ -1,208 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._endpoint_certificates_operations import build_get_request, build_list_by_instance_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class EndpointCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`endpoint_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.EndpointCertificate"]: - """List certificates used on endpoints on the target instance. - - :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 iterator like instance of either EndpointCertificate or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.EndpointCertificate] - :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", self._config.api_version)) - cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointCertificateListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, endpoint_type: str, **kwargs: Any - ) -> _models.EndpointCertificate: - """Gets a certificate used on the endpoint with the given id. - - :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 endpoint_type: Type of the endpoint whose certificate the customer is looking for. - Required. - :type endpoint_type: str - :return: EndpointCertificate or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.EndpointCertificate - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - endpoint_type=endpoint_type, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("EndpointCertificate", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b0c61bc6cfc4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_database_blob_auditing_policies_operations.py +++ /dev/null @@ -1,365 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._extended_database_blob_auditing_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ExtendedDatabaseBlobAuditingPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`extended_database_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ExtendedDatabaseBlobAuditingPolicy"]: - """Lists extended auditing settings of a database. - - :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 - :return: An iterator like instance of either ExtendedDatabaseBlobAuditingPolicy or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Gets an extended database's blob auditing policy. - - :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 - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ExtendedDatabaseBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. 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: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExtendedDatabaseBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. Is either a - ExtendedDatabaseBlobAuditingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy or IO[bytes] - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = 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, "ExtendedDatabaseBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 8ae425aea90e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_extended_server_blob_auditing_policies_operations.py +++ /dev/null @@ -1,424 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._extended_server_blob_auditing_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ExtendedServerBlobAuditingPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`extended_server_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ExtendedServerBlobAuditingPolicy"]: - """Lists extended auditing settings of a server. - - :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 - :return: An iterator like instance of either ExtendedServerBlobAuditingPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ExtendedServerBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> _models.ExtendedServerBlobAuditingPolicy: - """Gets an extended server's blob auditing policy. - - :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 - :return: ExtendedServerBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ExtendedServerBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ExtendedServerBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy - :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 ExtendedServerBlobAuditingPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. 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 ExtendedServerBlobAuditingPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. Is either a - ExtendedServerBlobAuditingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ExtendedServerBlobAuditingPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = 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, - parameters=parameters, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_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.ExtendedServerBlobAuditingPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ExtendedServerBlobAuditingPolicy]( - 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/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py deleted file mode 100644 index 92253aa07f7a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_failover_groups_operations.py +++ /dev/null @@ -1,1133 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._failover_groups_operations import ( - build_create_or_update_request, - build_delete_request, - build_failover_request, - build_force_failover_allow_data_loss_request, - build_get_request, - build_list_by_server_request, - build_try_planned_before_forced_failover_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class FailoverGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`failover_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.FailoverGroup"]: - """Lists the failover groups in a server. - - :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 containing the failover group. Required. - :type server_name: str - :return: An iterator like instance of either FailoverGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> _models.FailoverGroup: - """Gets a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: FailoverGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FailoverGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("FailoverGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "FailoverGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: _models.FailoverGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroup - :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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a FailoverGroup type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - failover_group_name: str, - parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "FailoverGroupUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: _models.FailoverGroupUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate - :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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a FailoverGroupUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _failover_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. - - :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 containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _force_failover_allow_data_loss_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_force_failover_allow_data_loss_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_force_failover_allow_data_loss( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. This operation might result in data - loss. - - :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 containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._force_failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - 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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_try_planned_before_forced_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_try_planned_before_forced_failover( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. This operation tries planned before - forced failover but might still result in data loss. - - :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 failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of AsyncLROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._try_planned_before_forced_failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.FailoverGroup]( - 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/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py deleted file mode 100644 index cb531551b386..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_firewall_rules_operations.py +++ /dev/null @@ -1,551 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._firewall_rules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, - build_replace_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class FirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.FirewallRule"]: - """Gets a list of firewall rules. - - :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 - :return: An iterator like instance of either FirewallRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def replace( - self, - resource_group_name: str, - server_name: str, - parameters: _models.FirewallRuleList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def replace( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 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: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def replace( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.FirewallRuleList, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.FirewallRule]] = 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, "FirewallRuleList") - - _request = build_replace_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.FirewallRule: - """Gets a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: _models.FirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: Union[_models.FirewallRule, IO[bytes]], - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Is either - a FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FirewallRule] = 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, "FirewallRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: - """Deletes a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 63310a98d4a6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_geo_backup_policies_operations.py +++ /dev/null @@ -1,383 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._geo_backup_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class GeoBackupPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`geo_backup_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.GeoBackupPolicy"]: - """Gets a list of Geo backup policies for the given database resource. - - :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 - :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Gets a Geo backup policy for the given database resource. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: _models.GeoBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. - Required. - :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. - 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: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: Union[_models.GeoBackupPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. Is - either a GeoBackupPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy or IO[bytes] - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GeoBackupPolicy] = 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, "GeoBackupPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index bf37d74b8c0a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_failover_groups_operations.py +++ /dev/null @@ -1,794 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._instance_failover_groups_operations import ( - build_create_or_update_request, - build_delete_request, - build_failover_request, - build_force_failover_allow_data_loss_request, - build_get_request, - build_list_by_location_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class InstanceFailoverGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`instance_failover_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.InstanceFailoverGroup"]: - """Lists the failover groups in a location. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> _models.InstanceFailoverGroup: - """Gets a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: InstanceFailoverGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstanceFailoverGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstanceFailoverGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: _models.InstanceFailoverGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup - :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 InstanceFailoverGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 InstanceFailoverGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a InstanceFailoverGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either InstanceFailoverGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstanceFailoverGroup] = 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, - location_name=location_name, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InstanceFailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _failover_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: - """Fails over from the current primary managed instance to this managed instance. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of AsyncLROPoller that returns either InstanceFailoverGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = 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, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InstanceFailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _force_failover_allow_data_loss_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_force_failover_allow_data_loss_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_force_failover_allow_data_loss( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: - """Fails over from the current primary managed instance to this managed instance. This operation - might result in data loss. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of AsyncLROPoller that returns either InstanceFailoverGroup or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InstanceFailoverGroup]( - 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/_instance_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pool_operations_operations.py deleted file mode 100644 index 8080c5e33465..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pool_operations_operations.py +++ /dev/null @@ -1,208 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._instance_pool_operations_operations import build_get_request, build_list_by_instance_pool_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class InstancePoolOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`instance_pool_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.InstancePoolOperation"]: - """Gets a list of operations performed on the instance pool. - - :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 instance_pool_name: The name of the managed instance pool. Required. - :type instance_pool_name: str - :return: An iterator like instance of either InstancePoolOperation or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any - ) -> _models.InstancePoolOperation: - """Gets a management operation on a instance pool. - - :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 instance_pool_name: The name of the managed instance pool. Required. - :type instance_pool_name: str - :param operation_id: Required. - :type operation_id: str - :return: InstancePoolOperation or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstancePoolOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstancePoolOperation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 62c9ebef2fd2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_instance_pools_operations.py +++ /dev/null @@ -1,800 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._instance_pools_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class InstancePoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`instance_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.InstancePool"]: - """Gets a list of all instance pools in the subscription. - - :return: An iterator like instance of either InstancePool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.InstancePool"]: - """Gets a list of instance pools in the resource 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 - :return: An iterator like instance of either InstancePool or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> _models.InstancePool: - """Gets an instance pool. - - :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 instance_pool_name: The name of the instance pool to be retrieved. Required. - :type instance_pool_name: str - :return: InstancePool or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstancePool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstancePool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePool, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstancePool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: _models.InstancePool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePool - :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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. 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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePool, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Is either a InstancePool type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePool or IO[bytes] - :return: An instance of AsyncLROPoller that returns either InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstancePool] = 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, - instance_pool_name=instance_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstancePool", pipeline_response.http_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.InstancePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InstancePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, instance_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, instance_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an instance pool. - - :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 instance_pool_name: The name of the instance pool to be deleted. Required. - :type instance_pool_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstancePoolUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: _models.InstancePoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate - :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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. 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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePoolUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Is either a InstancePoolUpdate - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstancePool] = 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, - instance_pool_name=instance_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstancePool", pipeline_response.http_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.InstancePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.InstancePool]( - 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/_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py deleted file mode 100644 index 1b5e72e52294..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ipv6_firewall_rules_operations.py +++ /dev/null @@ -1,417 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._ipv6_firewall_rules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class IPv6FirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`ipv6_firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.IPv6FirewallRule"]: - """Gets a list of IPv6 firewall rules. - - :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 - :return: An iterator like instance of either IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.IPv6FirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("IPv6FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Gets an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: _models.IPv6FirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. - Required. - :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. - 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: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: Union[_models.IPv6FirewallRule, IO[bytes]], - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. Is - either a IPv6FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule or IO[bytes] - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IPv6FirewallRule] = 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, "IPv6FirewallRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: - """Deletes an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 8ad6bdc19415..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_agents_operations.py +++ /dev/null @@ -1,759 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_agents_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobAgentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_agents` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobAgent"]: - """Gets a list of job agents in a server. - - :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 - :return: An iterator like instance of either JobAgent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> _models.JobAgent: - """Gets a job agent. - - :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 job_agent_name: The name of the job agent to be retrieved. Required. - :type job_agent_name: str - :return: JobAgent or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobAgent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobAgent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobAgent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: _models.JobAgent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgent - :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 JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. 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 JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. Is either a JobAgent type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobAgent] = 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, - job_agent_name=job_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobAgent", pipeline_response.http_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.JobAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobAgent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a job agent. - - :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 job_agent_name: The name of the job agent to be deleted. Required. - :type job_agent_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - job_agent_name: str, - parameters: Union[_models.JobAgentUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobAgentUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: _models.JobAgentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate - :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 JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. 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 JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgentUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. Is either a JobAgentUpdate type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JobAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobAgent] = 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, - job_agent_name=job_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobAgent", pipeline_response.http_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.JobAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobAgent]( - 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/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py deleted file mode 100644 index f19284d52770..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_credentials_operations.py +++ /dev/null @@ -1,436 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_credentials_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_agent_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobCredentialsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_credentials` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobCredential"]: - """Gets a list of jobs credentials. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobCredential or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobCredential] - :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", self._config.api_version)) - cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobCredentialListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any - ) -> _models.JobCredential: - """Gets a jobs credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: _models.JobCredential, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. Required. - :type parameters: ~azure.mgmt.sql.models.JobCredential - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. 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: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: Union[_models.JobCredential, IO[bytes]], - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. Is either a JobCredential type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobCredential or IO[bytes] - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobCredential] = 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, "JobCredential") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("JobCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any - ) -> None: - """Deletes a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 4c6c2c81f537..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_executions_operations.py +++ /dev/null @@ -1,742 +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 collections.abc import MutableMapping -import datetime -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_executions_operations import ( - build_cancel_request, - build_create_or_update_request, - build_create_request, - build_get_request, - build_list_by_agent_request, - build_list_by_job_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists all executions in a job agent. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_job( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists a job's executions. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.JobExecution]: - """Creates or updates a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The job execution id to create the job execution under. Required. - :type job_execution_id: str - :return: An instance of AsyncLROPoller that returns either JobExecution or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecution] = 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, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobExecution", pipeline_response.http_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.JobExecution].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobExecution]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def cancel( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> None: - """Requests cancellation of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_execution_id: The id of the job execution to cancel. Required. - :type job_execution_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - async def _create_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.JobExecution]: - """Starts an elastic job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An instance of AsyncLROPoller that returns either JobExecution or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecution] = 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_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobExecution", pipeline_response.http_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.JobExecution].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobExecution]( - 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/_job_private_endpoints_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py deleted file mode 100644 index ea53bd6d0afa..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_private_endpoints_operations.py +++ /dev/null @@ -1,572 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_private_endpoints_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_agent_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobPrivateEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_private_endpoints` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobPrivateEndpoint"]: - """Gets a list of job agent private endpoints. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobPrivateEndpoint or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobPrivateEndpoint] - :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", self._config.api_version)) - cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobPrivateEndpointListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> _models.JobPrivateEndpoint: - """Gets a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint to get. Required. - :type private_endpoint_name: str - :return: JobPrivateEndpoint or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobPrivateEndpoint", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobPrivateEndpoint") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: _models.JobPrivateEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. Required. - :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint - :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 JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. 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 JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. Is either a JobPrivateEndpoint type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint or IO[bytes] - :return: An instance of AsyncLROPoller that returns either JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobPrivateEndpoint] = 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, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobPrivateEndpoint", pipeline_response.http_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.JobPrivateEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.JobPrivateEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint to delete. Required. - :type private_endpoint_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py deleted file mode 100644 index 87f1f7ec5757..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_step_executions_operations.py +++ /dev/null @@ -1,272 +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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_step_executions_operations import build_get_request, build_list_by_job_execution_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobStepExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_step_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job_execution( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists the step executions of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_execution_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a step execution of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 73a73b0492f2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_steps_operations.py +++ /dev/null @@ -1,651 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_steps_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_by_version_request, - build_get_request, - build_list_by_job_request, - build_list_by_version_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobStepsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_steps` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobStep"]: - """Gets all job steps for a job's current version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] - :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", self._config.api_version)) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets a job step in a job's current version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: _models.JobStep, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. Required. - :type parameters: ~azure.mgmt.sql.models.JobStep - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. 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: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: Union[_models.JobStep, IO[bytes]], - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. Is either a JobStep type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.JobStep or IO[bytes] - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobStep] = 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, "JobStep") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - **kwargs: Any - ) -> None: - """Deletes a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step to delete. Required. - :type step_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobStep"]: - """Gets all job steps in the specified job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] - :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", self._config.api_version)) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets the specified version of a job step. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 69d20209e8e4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_executions_operations.py +++ /dev/null @@ -1,419 +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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_target_executions_operations import ( - build_get_request, - build_list_by_job_execution_request, - build_list_by_step_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobTargetExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_target_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_step( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists the target executions of a job step execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_step_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - target_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a target execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param target_id: The target id. Required. - :type target_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - target_id=target_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_job_execution( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.JobExecution"]: - """Lists target executions for all steps of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_execution_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 4304645b50db..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_target_groups_operations.py +++ /dev/null @@ -1,436 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_target_groups_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_agent_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobTargetGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_target_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobTargetGroup"]: - """Gets all target groups in an agent. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobTargetGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobTargetGroup] - :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", self._config.api_version)) - cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobTargetGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any - ) -> _models.JobTargetGroup: - """Gets a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobTargetGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: _models.JobTargetGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. Required. - :type parameters: ~azure.mgmt.sql.models.JobTargetGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. 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: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: Union[_models.JobTargetGroup, IO[bytes]], - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. Is either a JobTargetGroup type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobTargetGroup or IO[bytes] - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobTargetGroup] = 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, "JobTargetGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_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.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, 201]: - 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 = self._deserialize("JobTargetGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any - ) -> None: - """Deletes a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 661f345a48ea..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_job_versions_operations.py +++ /dev/null @@ -1,225 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._job_versions_operations import build_get_request, build_list_by_job_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`job_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.JobVersion"]: - """Gets all versions of a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An iterator like instance of either JobVersion or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobVersion] - :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", self._config.api_version)) - cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> _models.JobVersion: - """Gets a job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: JobVersion or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 37ca44243d70..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_jobs_operations.py +++ /dev/null @@ -1,435 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._jobs_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_agent_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.Job"]: - """Gets a list of jobs. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either Job or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Job] - :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", self._config.api_version)) - cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("JobListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> _models.Job: - """Gets a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: _models.Job, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. Required. - :type parameters: ~azure.mgmt.sql.models.Job - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. 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: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: Union[_models.Job, IO[bytes]], - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. Is either a Job type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Job or IO[bytes] - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Job] = 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, "Job") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> None: - """Deletes a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to delete. Required. - :type job_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index f65005344a74..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py +++ /dev/null @@ -1,591 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._ledger_digest_uploads_operations import ( - build_create_or_update_request, - build_disable_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class LedgerDigestUploadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`ledger_digest_uploads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.LedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 - :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> _models.LedgerDigestUploads: - """Gets the current ledger digest upload configuration for a database. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :return: LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LedgerDigestUploads", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: Union[_models.LedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LedgerDigestUploads") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: _models.LedgerDigestUploads, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :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 LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :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 LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :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, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: Union[_models.LedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: Is either a LedgerDigestUploads type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads or IO[bytes] - :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LedgerDigestUploads] = 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, - ledger_digest_uploads=ledger_digest_uploads, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_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.LedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _disable_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_disable_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_disable( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> AsyncLROPoller[_models.LedgerDigestUploads]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_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.LedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LedgerDigestUploads]( - 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/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py deleted file mode 100644 index 24fb49846e99..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py +++ /dev/null @@ -1,3605 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._long_term_retention_backups_operations import ( - build_change_access_tier_by_resource_group_request, - build_change_access_tier_request, - build_copy_by_resource_group_request, - build_copy_request, - build_delete_by_resource_group_request, - build_delete_request, - build_get_by_resource_group_request, - build_get_request, - build_list_by_database_request, - build_list_by_location_request, - build_list_by_resource_group_database_request, - build_list_by_resource_group_location_request, - build_list_by_resource_group_server_request, - build_list_by_server_request, - build_lock_time_based_immutability_by_resource_group_request, - build_lock_time_based_immutability_request, - build_remove_legal_hold_immutability_by_resource_group_request, - build_remove_legal_hold_immutability_request, - build_remove_time_based_immutability_by_resource_group_request, - build_remove_time_based_immutability_request, - build_set_legal_hold_immutability_by_resource_group_request, - build_set_legal_hold_immutability_request, - build_update_by_resource_group_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class LongTermRetentionBackupsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`long_term_retention_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given location. - - :param location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_server( - self, - location_name: str, - long_term_retention_server_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given server. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists all long term retention backups for a database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.LongTermRetentionBackup: - """Gets a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: LongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - 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._delete_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _change_access_tier_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ChangeLongTermRetentionBackupAccessTierParameters") - - _request = build_change_access_tier_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters - :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 LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: 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 LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Is either a ChangeLongTermRetentionBackupAccessTierParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _copy_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") - - _request = build_copy_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.CopyLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters - :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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. 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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Is either a - CopyLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _lock_time_based_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_lock_time_based_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_lock_time_based_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Lock time based immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _remove_legal_hold_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_legal_hold_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_remove_legal_hold_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Remove legal hold immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _remove_time_based_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_time_based_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_remove_time_based_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Remove time based immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _set_legal_hold_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_set_legal_hold_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_set_legal_hold_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Set legal hold immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") - - _request = build_update_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.UpdateLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters - :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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. 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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Is either a - UpdateLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given location based on resource 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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_server( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given server based on resource groups. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_server_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: - """Lists all long term retention backups for a database based on a particular resource 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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.LongTermRetentionBackup: - """Gets a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: LongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - 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._delete_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ChangeLongTermRetentionBackupAccessTierParameters") - - _request = build_change_access_tier_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters - :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 LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: 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 LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Is either a ChangeLongTermRetentionBackupAccessTierParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or - IO[bytes] - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _copy_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") - - _request = build_copy_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.CopyLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters - :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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. 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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Is either a - CopyLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_lock_time_based_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_lock_time_based_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Lock time based immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_legal_hold_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_remove_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Remove legal hold immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _remove_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_time_based_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_remove_time_based_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Remove time based immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _set_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_set_legal_hold_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_set_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: - """Set legal hold immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of AsyncLROPoller that returns either LongTermRetentionBackup or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") - - _request = build_update_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.UpdateLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters - :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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. 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 - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Is either a - UpdateLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - LongTermRetentionBackupOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( - 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/_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 deleted file mode 100644 index 65b9e7cd72db..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py +++ /dev/null @@ -1,1118 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._long_term_retention_managed_instance_backups_operations import ( - build_delete_by_resource_group_request, - build_delete_request, - build_get_by_resource_group_request, - build_get_request, - build_list_by_database_request, - build_list_by_instance_request, - build_list_by_location_request, - build_list_by_resource_group_database_request, - build_list_by_resource_group_instance_request, - build_list_by_resource_group_location_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class LongTermRetentionManagedInstanceBackupsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`long_term_retention_managed_instance_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :param location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - skip=skip, - top=top, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionBackup: - """Gets a long term retention backup for a managed database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: ManagedInstanceLongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_initial( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - 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._delete_initial( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, - location_name: str, - managed_instance_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - skip=skip, - top=top, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_by_resource_group( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionBackup: - """Gets a long term retention backup for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: ManagedInstanceLongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _delete_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_by_resource_group( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - 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._delete_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group_instance( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_instance_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 8f6b1331cb50..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_policies_operations.py +++ /dev/null @@ -1,452 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._long_term_retention_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class LongTermRetentionPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`long_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.LongTermRetentionPolicy"]: - """Gets a database's long term retention policy. - - :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 - :return: An iterator like instance of either LongTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - **kwargs: Any - ) -> _models.LongTermRetentionPolicy: - """Gets a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :return: LongTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LongTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: _models.LongTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy - :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 LongTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. 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 LongTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :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, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. Is either a LongTermRetentionPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either LongTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_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.LongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LongTermRetentionPolicy]( - 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/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py deleted file mode 100644 index cc30fc1cb8a5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_window_options_operations.py +++ /dev/null @@ -1,126 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._maintenance_window_options_operations import build_get_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class MaintenanceWindowOptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`maintenance_window_options` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_options_name: str, - **kwargs: Any - ) -> _models.MaintenanceWindowOptions: - """Gets a list of available maintenance windows. - - :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 to get maintenance windows options for. - Required. - :type database_name: str - :param maintenance_window_options_name: Maintenance window options name. Required. - :type maintenance_window_options_name: str - :return: MaintenanceWindowOptions or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_options_name=maintenance_window_options_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("MaintenanceWindowOptions", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 6bc2ff326a91..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_maintenance_windows_operations.py +++ /dev/null @@ -1,267 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._maintenance_windows_operations import build_create_or_update_request, build_get_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class MaintenanceWindowsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`maintenance_windows` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - **kwargs: Any - ) -> _models.MaintenanceWindows: - """Gets maintenance windows settings for a database. - - :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 to get maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :return: MaintenanceWindows or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.MaintenanceWindows - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_name=maintenance_window_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceWindows", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: _models.MaintenanceWindows, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: Union[_models.MaintenanceWindows, IO[bytes]], - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :param parameters: Is either a MaintenanceWindows type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "MaintenanceWindows") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_name=maintenance_window_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 6df11ab27184..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,684 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_backup_short_term_retention_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a managed database's short term retention policy list. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedBackupShortTermRetentionPolicy: - """Gets a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :return: ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - 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/_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 deleted file mode 100644 index 0f11c7ccf55b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,387 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_advanced_threat_protection_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabaseAdvancedThreatProtection"]: - """Gets a list of managed database's Advanced Threat Protection states. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseAdvancedThreatProtection or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Gets a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ManagedDatabaseAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. 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: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedDatabaseAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. Is either a - ManagedDatabaseAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection or IO[bytes] - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = 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, "ManagedDatabaseAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c29ee7b545cf..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_columns_operations.py +++ /dev/null @@ -1,362 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_columns_operations import ( - build_get_request, - build_list_by_database_request, - build_list_by_table_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseColumnsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_columns` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseColumn"]: - """List managed database columns. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema: Default value is None. - :type schema: list[str] - :param table: Default value is None. - :type table: list[str] - :param column: Default value is None. - :type column: list[str] - :param order_by: Default value is None. - :type order_by: list[str] - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - schema=schema, - table=table, - column=column, - order_by=order_by, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_table( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseColumn"]: - """List managed database columns. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_table_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> _models.DatabaseColumn: - """Get managed database column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: DatabaseColumn or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseColumn - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseColumn", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 6fa03fe90cbd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_move_operations_operations.py +++ /dev/null @@ -1,222 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_move_operations_operations import build_get_request, build_list_by_location_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseMoveOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_move_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabaseMoveOperationResult"]: - """Lists managed database move operations. - - :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 location_name: Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest operation for each - database. Has higher priority than $filter. Default value is None. - :type only_latest_per_database: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedDatabaseMoveOperationResult or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseMoveOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, location_name: str, operation_id: str, **kwargs: Any - ) -> _models.ManagedDatabaseMoveOperationResult: - """Gets a managed database move operation. - - :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 location_name: Required. - :type location_name: str - :param operation_id: Required. - :type operation_id: str - :return: ManagedDatabaseMoveOperationResult or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseMoveOperationResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 717f0da067d0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_queries_operations.py +++ /dev/null @@ -1,234 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_queries_operations import build_get_request, build_list_by_query_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseQueriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_queries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, **kwargs: Any - ) -> _models.ManagedInstanceQuery: - """Get query by query id. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param query_id: Required. - :type query_id: str - :return: ManagedInstanceQuery or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - query_id=query_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceQuery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_query( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - query_id: str, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.QueryStatistics"]: - """Get query execution statistics by query id. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param query_id: Required. - :type query_id: str - :param start_time: Start time for observed period. Default value is None. - :type start_time: str - :param end_time: End time for observed period. Default value is None. - :type end_time: str - :param interval: The time step to be used to summarize the metric values. Known values are: - "PT1H" and "P1D". Default value is None. - :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :return: An iterator like instance of either QueryStatistics or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.QueryStatistics] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_query_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - query_id=query_id, - subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - interval=interval, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceQueryStatistics", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 84bbf63fc457..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ /dev/null @@ -1,194 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_recommended_sensitivity_labels_operations import build_update_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseRecommendedSensitivityLabelsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_recommended_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.RecommendedSensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.RecommendedSensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a RecommendedSensitivityLabelUpdateList type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "RecommendedSensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 75778afa7d06..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_restore_details_operations.py +++ /dev/null @@ -1,125 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_restore_details_operations import build_get_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseRestoreDetailsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_restore_details` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - restore_details_name: Union[str, _models.RestoreDetailsName], - **kwargs: Any - ) -> _models.ManagedDatabaseRestoreDetailsResult: - """Gets managed database restore details. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param restore_details_name: The name of the restore details to retrieve. "Default" Required. - :type restore_details_name: str or ~azure.mgmt.sql.models.RestoreDetailsName - :return: ManagedDatabaseRestoreDetailsResult or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - restore_details_name=restore_details_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseRestoreDetailsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7b2402bcf409..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_schemas_operations.py +++ /dev/null @@ -1,222 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_schemas_operations import build_get_request, build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseSchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_schemas` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSchema"]: - """List managed database schemas. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseSchema or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSchema] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, schema_name: str, **kwargs: Any - ) -> _models.DatabaseSchema: - """Get managed database schema. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :return: DatabaseSchema or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSchema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSchema", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 69762d125637..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_alert_policies_operations.py +++ /dev/null @@ -1,384 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_security_alert_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseSecurityAlertPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: - """Gets a list of managed database's security alert policies. - - :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 database_name: The name of the managed database for which the security alert policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Gets a managed database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: _models.ManagedDatabaseSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. 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: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: Union[_models.ManagedDatabaseSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Is either a - ManagedDatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy or IO[bytes] - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = 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, "ManagedDatabaseSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 8798206da9c2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_security_events_operations.py +++ /dev/null @@ -1,168 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_security_events_operations import build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseSecurityEventsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_security_events` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SecurityEvent"]: - """Gets a list of security events. - - :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 database_name: The name of the managed database for which the security events are - retrieved. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either SecurityEvent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SecurityEvent] - :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", self._config.api_version)) - cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - skip=skip, - top=top, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SecurityEventCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 132770f6e954..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_sensitivity_labels_operations.py +++ /dev/null @@ -1,1017 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_sensitivity_labels_operations import ( - build_create_or_update_request, - build_delete_request, - build_disable_recommendation_request, - build_enable_recommendation_request, - build_get_request, - build_list_by_database_request, - build_list_current_by_database_request, - build_list_recommended_by_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseSensitivityLabelsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_recommended_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_recommended_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Gets the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param sensitivity_label_source: The source of the sensitivity label. Known values are: - "current" and "recommended". Required. - :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - sensitivity_label_source=sensitivity_label_source, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: _models.SensitivityLabel, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. 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: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: Union[_models.SensitivityLabel, IO[bytes]], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Is either a SensitivityLabel type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or IO[bytes] - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SensitivityLabel] = 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, "SensitivityLabel") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Deletes the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def disable_recommendation( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def enable_recommendation( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index b1dad8aab2c6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_tables_operations.py +++ /dev/null @@ -1,235 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_tables_operations import build_get_request, build_list_by_schema_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseTablesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_tables` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_schema( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseTable"]: - """List managed database tables. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseTable or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseTable] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_schema_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseTableListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - **kwargs: Any - ) -> _models.DatabaseTable: - """Get managed database table. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :return: DatabaseTable or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseTable - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseTable", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c0633b7c3fe1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_transparent_data_encryption_operations.py +++ /dev/null @@ -1,384 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_transparent_data_encryption_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseTransparentDataEncryptionOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_transparent_data_encryption` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedTransparentDataEncryption"]: - """Gets a list of managed database's transparent data encryptions. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Gets a managed database's transparent data encryption. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: _models.ManagedTransparentDataEncryption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. 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: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.ManagedTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Is either a - ManagedTransparentDataEncryption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or IO[bytes] - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedTransparentDataEncryption] = 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, "ManagedTransparentDataEncryption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 2324b2617e1f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,409 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_vulnerability_assessment_rule_baselines_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Gets a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseVulnerabilityAssessmentRuleBaseline type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or - IO[bytes] - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseVulnerabilityAssessmentRuleBaseline") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 2e989517f22a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,458 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_vulnerability_assessment_scans_operations import ( - build_export_request, - build_get_request, - build_initiate_scan_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def export( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentScansExport: - """Convert an existing scan result to a human readable format. If already exists nothing happens. - - :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 database_name: The name of the scanned database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id. Required. - :type scan_id: str - :return: DatabaseVulnerabilityAssessmentScansExport or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) - - _request = build_export_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _initiate_scan_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_initiate_scan( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", self._config.api_version)) - 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._initiate_scan_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py deleted file mode 100644 index d4639db96be0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_database_vulnerability_assessments_operations.py +++ /dev/null @@ -1,459 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_database_vulnerability_assessments_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessments of a managed database. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Gets the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.DatabaseVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.DatabaseVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a DatabaseVulnerabilityAssessment type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or IO[bytes] - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = 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, "DatabaseVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 7dff44d6aa54..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_databases_operations.py +++ /dev/null @@ -1,1797 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_databases_operations import ( - build_cancel_move_request, - build_complete_move_request, - build_complete_restore_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, - build_list_inaccessible_by_instance_request, - build_reevaluate_inaccessible_database_state_request, - build_start_move_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabase"]: - """Gets a list of managed databases. - - :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 iterator like instance of either ManagedDatabase or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> _models.ManagedDatabase: - """Gets a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: ManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabase, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabase") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabase - :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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. 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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabase, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Is either a ManagedDatabase type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabase or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabase] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate - :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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. 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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Is either a ManagedDatabaseUpdate - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabase] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _cancel_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") - - _request = build_cancel_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. Is either a - ManagedDatabaseMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._cancel_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _complete_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") - - _request = build_complete_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. Is either a - ManagedDatabaseMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._complete_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _complete_restore_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CompleteDatabaseRestoreDefinition") - - _request = build_complete_restore_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.CompleteDatabaseRestoreDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. - Required. - :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. - 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. Is - either a CompleteDatabaseRestoreDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._complete_restore_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reevaluate_inaccessible_database_state_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedDatabase]: - """Reevaluates the inaccessibility state of a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An instance of AsyncLROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _start_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseStartMoveDefinition") - - _request = build_start_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseStartMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. Is either a - ManagedDatabaseStartMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_inaccessible_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedDatabase"]: - """Gets a list of inaccessible managed databases in a managed instance. - - :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 iterator like instance of either ManagedDatabase or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_inaccessible_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 25d026c23cd3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_administrators_operations.py +++ /dev/null @@ -1,560 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_administrators_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceAdministratorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_administrators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceAdministrator"]: - """Gets a list of managed instance administrators. - - :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 iterator like instance of either ManagedInstanceAdministrator or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> _models.ManagedInstanceAdministrator: - """Gets a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :return: ManagedInstanceAdministrator or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAdministrator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: _models.ManagedInstanceAdministrator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator - :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 ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator 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 ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator parameters. Is either a - ManagedInstanceAdministrator type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAdministrator] = 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, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_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.ManagedInstanceAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index 785a17b4e65c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,445 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_advanced_threat_protection_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceAdvancedThreatProtection"]: - """Get the managed instance's Advanced Threat Protection settings. - - :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 iterator like instance of either ManagedInstanceAdvancedThreatProtection or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ManagedInstanceAdvancedThreatProtection: - """Get a managed instance's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ManagedInstanceAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ManagedInstanceAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection - :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 - ManagedInstanceAdvancedThreatProtection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. 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 - ManagedInstanceAdvancedThreatProtection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. Is either a - ManagedInstanceAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedInstanceAdvancedThreatProtection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = 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, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_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.ManagedInstanceAdvancedThreatProtection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]( - 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/_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 deleted file mode 100644 index cf76c18ae8e1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ /dev/null @@ -1,576 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_azure_ad_only_authentications_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_azure_ad_only_authentications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> _models.ManagedInstanceAzureADOnlyAuthentication: - """Gets a specific Azure Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :return: ManagedInstanceAzureADOnlyAuthentication or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAzureADOnlyAuthentication") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: _models.ManagedInstanceAzureADOnlyAuthentication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication - :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 - ManagedInstanceAzureADOnlyAuthentication or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. 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 - ManagedInstanceAzureADOnlyAuthentication or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Is either a ManagedInstanceAzureADOnlyAuthentication type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedInstanceAzureADOnlyAuthentication or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = 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, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_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.ManagedInstanceAzureADOnlyAuthentication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing server Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py deleted file mode 100644 index 06b358136661..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_dtcs_operations.py +++ /dev/null @@ -1,424 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_dtcs_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceDtcsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_dtcs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceDtc"]: - """Gets a list of managed instance DTC settings. - - :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 iterator like instance of either ManagedInstanceDtc or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceDtc] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceDtcListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, dtc_name: Union[str, _models.DtcName], **kwargs: Any - ) -> _models.ManagedInstanceDtc: - """Gets managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :return: ManagedInstanceDtc or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceDtc", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceDtc") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: _models.ManagedInstanceDtc, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc - :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 ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. 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 ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. Is either a ManagedInstanceDtc type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceDtc] = 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, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceDtc", pipeline_response.http_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.ManagedInstanceDtc].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceDtc]( - 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/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py deleted file mode 100644 index d3a7ea51a2f3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_encryption_protectors_operations.py +++ /dev/null @@ -1,568 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_encryption_protectors_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_instance_request, - build_revalidate_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceEncryptionProtectorsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceEncryptionProtector"]: - """Gets a list of managed instance encryption protectors. - - :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 iterator like instance of either ManagedInstanceEncryptionProtector or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceEncryptionProtectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> _models.ManagedInstanceEncryptionProtector: - """Gets a managed instance encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be retrieved. - "current" Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :return: ManagedInstanceEncryptionProtector or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceEncryptionProtector") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: _models.ManagedInstanceEncryptionProtector, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector - :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 ManagedInstanceEncryptionProtector - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. 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 ManagedInstanceEncryptionProtector - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Is either a - ManagedInstanceEncryptionProtector type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedInstanceEncryptionProtector - or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_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.ManagedInstanceEncryptionProtector].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _revalidate_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_revalidate( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py deleted file mode 100644 index 34bbf7a3d474..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_keys_operations.py +++ /dev/null @@ -1,553 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_keys_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceKeysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_keys` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceKey"]: - """Gets a list of managed instance keys. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceKey or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceKey] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceKeyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> _models.ManagedInstanceKey: - """Gets a managed instance key. - - :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 key_name: The name of the managed instance key to be retrieved. Required. - :type key_name: str - :return: ManagedInstanceKey or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceKey", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: Union[_models.ManagedInstanceKey, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceKey") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: _models.ManagedInstanceKey, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey - :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 ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. 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 ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: Union[_models.ManagedInstanceKey, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. Is either a - ManagedInstanceKey type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceKey] = 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, - managed_instance_name=managed_instance_name, - key_name=key_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceKey", pipeline_response.http_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.ManagedInstanceKey].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceKey]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the managed instance key with the given name. - - :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 key_name: The name of the managed instance key to be deleted. Required. - :type key_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index 53a6c74251d7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_long_term_retention_policies_operations.py +++ /dev/null @@ -1,594 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_long_term_retention_policies_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceLongTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_long_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: - """Gets a database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionPolicy: - """Gets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :return: ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceLongTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: _models.ManagedInstanceLongTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy - :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 - ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. 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 - ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. Is either a - ManagedInstanceLongTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Deletes a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :return: An instance of AsyncLROPoller that returns either - ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( - 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/_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py deleted file mode 100644 index a0e3383da603..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_operations_operations.py +++ /dev/null @@ -1,273 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_operations_operations import ( - build_cancel_request, - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceOperation"]: - """Gets a list of operations performed on the managed instance. - - :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 iterator like instance of either ManagedInstanceOperation or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any - ) -> _models.ManagedInstanceOperation: - """Gets a management operation on a managed instance. - - :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 operation_id: Required. - :type operation_id: str - :return: ManagedInstanceOperation or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceOperation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def cancel( - self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the managed instance. - - :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 operation_id: Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index be55a258063f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_endpoint_connections_operations.py +++ /dev/null @@ -1,553 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_private_endpoint_connections_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstancePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.ManagedInstancePrivateEndpointConnection: - """Gets a private endpoint connection. - - :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: ManagedInstancePrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstancePrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstancePrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: _models.ManagedInstancePrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection - :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 - ManagedInstancePrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: 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 - ManagedInstancePrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Is either a ManagedInstancePrivateEndpointConnection type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedInstancePrivateEndpointConnection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = 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, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "ManagedInstancePrivateEndpointConnection", pipeline_response.http_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.ManagedInstancePrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedInstancePrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index 26ec2f821f1a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_private_link_resources_operations.py +++ /dev/null @@ -1,212 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_private_link_resources_operations import ( - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstancePrivateLinkResourcesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstancePrivateLink"]: - """Gets the private link resources for SQL server. - - :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 iterator like instance of either ManagedInstancePrivateLink or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateLink] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, group_name: str, **kwargs: Any - ) -> _models.ManagedInstancePrivateLink: - """Gets a private link resource for SQL server. - - :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 group_name: The name of the private link resource. Required. - :type group_name: str - :return: ManagedInstancePrivateLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstancePrivateLink", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 33fe51f7d64e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_tde_certificates_operations.py +++ /dev/null @@ -1,251 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_tde_certificates_operations import build_create_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceTdeCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_tde_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TdeCertificate") - - _request = build_create_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.TdeCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Is either a - TdeCertificate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._create_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py deleted file mode 100644 index c019d1e10789..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instance_vulnerability_assessments_operations.py +++ /dev/null @@ -1,444 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instance_vulnerability_assessments_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstanceVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instance_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: - """Gets the managed instance's vulnerability assessment policies. - - :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 for which the vulnerability - assessments is defined. Required. - :type managed_instance_name: str - :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Gets the managed instance's vulnerability assessment. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.ManagedInstanceVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.ManagedInstanceVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a ManagedInstanceVulnerabilityAssessment - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment or IO[bytes] - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = 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, "ManagedInstanceVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the managed instance's vulnerability assessment. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 344152ade434..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py +++ /dev/null @@ -1,1922 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_instances_operations import ( - build_create_or_update_request, - build_delete_request, - build_failover_request, - build_get_request, - build_list_by_instance_pool_request, - build_list_by_managed_instance_request, - build_list_by_resource_group_request, - build_list_outbound_network_dependencies_by_managed_instance_request, - build_list_request, - build_reevaluate_inaccessible_database_state_request, - build_refresh_status_request, - build_start_request, - build_stop_request, - build_update_request, - build_validate_azure_key_vault_encryption_key_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedInstancesOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_instances` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.ManagedInstance"]: - """Gets a list of all managed instances in the subscription. - - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstance"]: - """Gets a list of all managed instances in an instance pool. - - :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 instance_pool_name: The instance pool name. Required. - :type instance_pool_name: str - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedInstance"]: - """Gets a list of managed instances in a resource 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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.ManagedInstance: - """Gets a managed instance. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: ManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstance, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstance") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstance - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. 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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstance, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. Is either a ManagedInstance - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstance or IO[bytes] - :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] - :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", self._config.api_version)) - 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) - 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, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a managed instance. - - :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 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", self._config.api_version)) - 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._delete_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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. 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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. Is either a - ManagedInstanceUpdate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate or IO[bytes] - :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] - :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", self._config.api_version)) - 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) - 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, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - async def _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - replica_type=replica_type, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Failovers a managed instance. - - :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 to failover. Required. - :type managed_instance_name: str - :param replica_type: The type of replica to be failed over. Known values are: "Primary" and - "ReadableSecondary". Default value is None. - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - replica_type=replica_type, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundEnvironmentEndpoint"]: - """Gets the collection of outbound network dependencies for the given managed instance. - - :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 iterator like instance of either OutboundEnvironmentEndpoint or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundEnvironmentEndpoint] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_outbound_network_dependencies_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reevaluate_inaccessible_database_state_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Reevaluates the inaccessibility state of all managed databases. - - :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 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", self._config.api_version)) - 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._reevaluate_inaccessible_database_state_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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _refresh_status_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = 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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "RefreshExternalGovernanceStatusOperationResultMI", pipeline_response.http_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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_start_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_start( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Starts the managed instance. - - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = 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( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - async def _stop_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_stop_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_stop( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedInstance]: - """Stops the managed instance. - - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = 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( - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - @distributed_trace - def list_by_managed_instance( - self, - resource_group_name: str, - managed_instance_name: str, - number_of_queries: Optional[int] = None, - databases: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, - observation_metric: Optional[Union[str, _models.MetricType]] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.TopQueries"]: - """Get top resource consuming queries of a managed instance. - - :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 number_of_queries: How many 'top queries' to return. Default is 5. Default value is - None. - :type number_of_queries: int - :param databases: Comma separated list of databases to be included into search. All DB's are - included if this parameter is not specified. Default value is None. - :type databases: str - :param start_time: Start time for observed period. Default value is None. - :type start_time: str - :param end_time: End time for observed period. Default value is None. - :type end_time: str - :param interval: The time step to be used to summarize the metric values. Default value is - PT1H. Known values are: "PT1H" and "P1D". Default value is None. - :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :param aggregation_function: Aggregation function to be used, default value is 'sum'. Known - values are: "avg", "min", "max", "stdev", and "sum". Default value is None. - :type aggregation_function: str or ~azure.mgmt.sql.models.AggregationFunctionType - :param observation_metric: Metric to be used for ranking top queries. Default is 'cpu'. Known - values are: "cpu", "io", "logIo", "duration", and "dtu". Default value is None. - :type observation_metric: str or ~azure.mgmt.sql.models.MetricType - :return: An iterator like instance of either TopQueries or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TopQueries] - :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", self._config.api_version)) - cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - number_of_queries=number_of_queries, - databases=databases, - start_time=start_time, - end_time=end_time, - interval=interval, - aggregation_function=aggregation_function, - observation_metric=observation_metric, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TopQueriesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest") - - _request = build_validate_azure_key_vault_encryption_key_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key parameters. Required. - :type parameters: - ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key parameters. Is either a - ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._validate_azure_key_vault_encryption_key_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py deleted file mode 100644 index 9852e0695e6a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_ledger_digest_uploads_operations.py +++ /dev/null @@ -1,597 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_ledger_digest_uploads_operations import ( - build_create_or_update_request, - build_disable_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedLedgerDigestUploadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_ledger_digest_uploads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedLedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedLedgerDigestUploads or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> _models.ManagedLedgerDigestUploads: - """Gets the current ledger digest upload configuration for a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :return: ManagedLedgerDigestUploads or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedLedgerDigestUploads") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: _models.ManagedLedgerDigestUploads, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads - :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 ManagedLedgerDigestUploads or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. 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 ManagedLedgerDigestUploads or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. Is either a ManagedLedgerDigestUploads - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedLedgerDigestUploads or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_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.ManagedLedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedLedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _disable_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_disable_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_disable( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedLedgerDigestUploads]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :return: An instance of AsyncLROPoller that returns either ManagedLedgerDigestUploads or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = 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._disable_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_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.ManagedLedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedLedgerDigestUploads]( - 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/_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 deleted file mode 100644 index 1c10ac67031a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,684 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_restorable_dropped_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_restorable_dropped_database_backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_restorable_dropped_database( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a dropped database's short term retention policy list. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_restorable_dropped_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedBackupShortTermRetentionPolicy: - """Gets a dropped database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :return: ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - 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/_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py deleted file mode 100644 index 82ccd6f8d893..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_dns_aliases_operations.py +++ /dev/null @@ -1,760 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_server_dns_aliases_operations import ( - build_acquire_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedServerDnsAliasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_server_dns_aliases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedServerDnsAlias"]: - """Gets a list of managed server DNS aliases for a managed server. - - :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 iterator like instance of either ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> _models.ManagedServerDnsAlias: - """Gets a server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :return: ManagedServerDnsAlias or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerDnsAliasCreation") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: _models.ManagedServerDnsAliasCreation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation - :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 ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: 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 ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Is either a ManagedServerDnsAliasCreation type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerDnsAlias] = 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, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_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.ManagedServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the managed server DNS alias with the given name. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _acquire_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerDnsAliasAcquisition") - - _request = build_acquire_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: _models.ManagedServerDnsAliasAcquisition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition - :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 ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: 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 ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Is either a ManagedServerDnsAliasAcquisition type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedServerDnsAlias or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerDnsAlias] = 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._acquire_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_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.ManagedServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedServerDnsAlias]( - 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/_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 deleted file mode 100644 index 916a2b1bae18..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py +++ /dev/null @@ -1,441 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._managed_server_security_alert_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ManagedServerSecurityAlertPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`managed_server_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ManagedServerSecurityAlertPolicy"]: - """Get the managed server's threat detection policies. - - :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - **kwargs: Any - ) -> _models.ManagedServerSecurityAlertPolicy: - """Get a managed server's threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :return: ManagedServerSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: _models.ManagedServerSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy - :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 ManagedServerSecurityAlertPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. 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 ManagedServerSecurityAlertPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. Is either a - ManagedServerSecurityAlertPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ManagedServerSecurityAlertPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = 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, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_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.ManagedServerSecurityAlertPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]( - 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/_network_security_perimeter_configurations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index ccafa51b9827..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,342 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._network_security_perimeter_configurations_operations import ( - build_get_request, - build_list_by_server_request, - build_reconcile_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets a list of NSP configurations for a server. - - :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 - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] - :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", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets a network security perimeter configuration. - - :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 nsp_config_name: Required. - :type nsp_config_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _reconcile_initial( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_reconcile( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]: - """Reconcile network security perimeter configuration for SQL Resource Provider. - - :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 nsp_config_name: Required. - :type nsp_config_name: str - :return: An instance of AsyncLROPoller that returns either - NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] - :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", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_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.NetworkSecurityPerimeterConfiguration].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]( - 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/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_operations.py index 89e0f5bed465..94235be12633 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 @@ -1,12 +1,16 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +import datetime +from io import IOBase +import json +from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import AsyncPipelineClient @@ -17,21 +21,574 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.pipeline import PipelineResponse +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.core.rest import AsyncHttpResponse, HttpRequest from azure.core.tracing.decorator import distributed_trace +from azure.core.tracing.decorator_async import distributed_trace_async from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models +from ..._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from ..._utils.serialization import Deserializer, Serializer -from ...operations._operations import build_list_request -from .._configuration import SqlManagementClientConfiguration +from ...operations._operations import ( + build_backup_short_term_retention_policies_create_or_update_request, + build_backup_short_term_retention_policies_get_request, + build_backup_short_term_retention_policies_list_by_database_request, + build_backup_short_term_retention_policies_update_request, + build_capabilities_list_by_location_request, + build_data_masking_policies_create_or_update_request, + build_data_masking_policies_get_request, + build_data_masking_rules_create_or_update_request, + build_data_masking_rules_list_by_database_request, + build_data_warehouse_user_activities_get_request, + build_data_warehouse_user_activities_list_by_database_request, + build_database_advanced_threat_protection_settings_create_or_update_request, + build_database_advanced_threat_protection_settings_get_request, + build_database_advanced_threat_protection_settings_list_by_database_request, + build_database_advisors_get_request, + build_database_advisors_list_by_database_request, + build_database_advisors_update_request, + build_database_automatic_tuning_get_request, + build_database_automatic_tuning_update_request, + build_database_blob_auditing_policies_create_or_update_request, + build_database_blob_auditing_policies_get_request, + build_database_blob_auditing_policies_list_by_database_request, + build_database_columns_get_request, + build_database_columns_list_by_database_request, + build_database_columns_list_by_table_request, + build_database_encryption_protectors_revalidate_request, + build_database_encryption_protectors_revert_request, + build_database_extensions_create_or_update_request, + build_database_extensions_get_request, + build_database_extensions_list_by_database_request, + build_database_operations_cancel_request, + build_database_operations_list_by_database_request, + build_database_recommended_actions_get_request, + build_database_recommended_actions_list_by_database_advisor_request, + build_database_recommended_actions_update_request, + build_database_schemas_get_request, + build_database_schemas_list_by_database_request, + build_database_security_alert_policies_create_or_update_request, + build_database_security_alert_policies_get_request, + build_database_security_alert_policies_list_by_database_request, + build_database_sql_vulnerability_assessment_baselines_create_or_update_request, + build_database_sql_vulnerability_assessment_baselines_get_request, + build_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment_request, + build_database_sql_vulnerability_assessment_execute_scan_execute_request, + build_database_sql_vulnerability_assessment_rule_baselines_create_or_update_request, + build_database_sql_vulnerability_assessment_rule_baselines_delete_request, + build_database_sql_vulnerability_assessment_rule_baselines_get_request, + build_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline_request, + build_database_sql_vulnerability_assessment_scan_result_get_request, + build_database_sql_vulnerability_assessment_scan_result_list_by_scan_request, + build_database_sql_vulnerability_assessment_scans_get_request, + build_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request, + build_database_sql_vulnerability_assessments_settings_get_request, + build_database_sql_vulnerability_assessments_settings_list_by_database_request, + build_database_tables_get_request, + build_database_tables_list_by_schema_request, + build_database_usages_list_by_database_request, + build_database_vulnerability_assessment_rule_baselines_create_or_update_request, + build_database_vulnerability_assessment_rule_baselines_delete_request, + build_database_vulnerability_assessment_rule_baselines_get_request, + build_database_vulnerability_assessment_scans_export_request, + build_database_vulnerability_assessment_scans_get_request, + build_database_vulnerability_assessment_scans_initiate_scan_request, + build_database_vulnerability_assessment_scans_list_by_database_request, + build_database_vulnerability_assessments_create_or_update_request, + build_database_vulnerability_assessments_delete_request, + build_database_vulnerability_assessments_get_request, + build_database_vulnerability_assessments_list_by_database_request, + build_databases_create_or_update_request, + build_databases_delete_request, + build_databases_export_request, + build_databases_failover_request, + build_databases_get_request, + build_databases_import_method_request, + build_databases_list_by_elastic_pool_request, + build_databases_list_by_server_request, + build_databases_list_inaccessible_by_server_request, + build_databases_pause_request, + build_databases_rename_request, + build_databases_resume_request, + build_databases_update_request, + build_databases_upgrade_data_warehouse_request, + build_deleted_servers_get_request, + build_deleted_servers_list_by_location_request, + build_deleted_servers_list_request, + build_deleted_servers_recover_request, + build_distributed_availability_groups_create_or_update_request, + build_distributed_availability_groups_delete_request, + build_distributed_availability_groups_failover_request, + build_distributed_availability_groups_get_request, + build_distributed_availability_groups_list_by_instance_request, + build_distributed_availability_groups_set_role_request, + build_distributed_availability_groups_update_request, + build_elastic_pool_operations_cancel_request, + build_elastic_pool_operations_list_by_elastic_pool_request, + build_elastic_pools_create_or_update_request, + build_elastic_pools_delete_request, + build_elastic_pools_failover_request, + build_elastic_pools_get_request, + build_elastic_pools_list_by_server_request, + build_elastic_pools_update_request, + build_encryption_protectors_create_or_update_request, + build_encryption_protectors_get_request, + build_encryption_protectors_list_by_server_request, + build_encryption_protectors_revalidate_request, + build_endpoint_certificates_get_request, + build_endpoint_certificates_list_by_instance_request, + build_extended_database_blob_auditing_policies_create_or_update_request, + build_extended_database_blob_auditing_policies_get_request, + build_extended_database_blob_auditing_policies_list_by_database_request, + build_extended_server_blob_auditing_policies_create_or_update_request, + build_extended_server_blob_auditing_policies_get_request, + build_extended_server_blob_auditing_policies_list_by_server_request, + build_failover_groups_create_or_update_request, + build_failover_groups_delete_request, + build_failover_groups_failover_request, + build_failover_groups_force_failover_allow_data_loss_request, + build_failover_groups_get_request, + build_failover_groups_list_by_server_request, + build_failover_groups_try_planned_before_forced_failover_request, + build_failover_groups_update_request, + build_firewall_rules_create_or_update_request, + build_firewall_rules_delete_request, + build_firewall_rules_get_request, + build_firewall_rules_list_by_server_request, + build_firewall_rules_replace_request, + build_geo_backup_policies_create_or_update_request, + build_geo_backup_policies_get_request, + build_geo_backup_policies_list_request, + build_instance_failover_groups_create_or_update_request, + build_instance_failover_groups_delete_request, + build_instance_failover_groups_failover_request, + build_instance_failover_groups_force_failover_allow_data_loss_request, + build_instance_failover_groups_get_request, + build_instance_failover_groups_list_by_location_request, + build_instance_pool_operations_get_request, + build_instance_pool_operations_list_by_instance_pool_request, + build_instance_pools_create_or_update_request, + build_instance_pools_delete_request, + build_instance_pools_get_request, + build_instance_pools_list_by_resource_group_request, + build_instance_pools_list_request, + build_instance_pools_update_request, + build_ipv6_firewall_rules_create_or_update_request, + build_ipv6_firewall_rules_delete_request, + build_ipv6_firewall_rules_get_request, + build_ipv6_firewall_rules_list_by_server_request, + build_job_agents_create_or_update_request, + build_job_agents_delete_request, + build_job_agents_get_request, + build_job_agents_list_by_server_request, + build_job_agents_update_request, + build_job_credentials_create_or_update_request, + build_job_credentials_delete_request, + build_job_credentials_get_request, + build_job_credentials_list_by_agent_request, + build_job_executions_cancel_request, + build_job_executions_create_or_update_request, + build_job_executions_create_request, + build_job_executions_get_request, + build_job_executions_list_by_agent_request, + build_job_executions_list_by_job_request, + build_job_private_endpoints_create_or_update_request, + build_job_private_endpoints_delete_request, + build_job_private_endpoints_get_request, + build_job_private_endpoints_list_by_agent_request, + build_job_step_executions_get_request, + build_job_step_executions_list_by_job_execution_request, + build_job_steps_create_or_update_request, + build_job_steps_delete_request, + build_job_steps_get_by_version_request, + build_job_steps_get_request, + build_job_steps_list_by_job_request, + build_job_steps_list_by_version_request, + build_job_target_executions_get_request, + build_job_target_executions_list_by_job_execution_request, + build_job_target_executions_list_by_step_request, + build_job_target_groups_create_or_update_request, + build_job_target_groups_delete_request, + build_job_target_groups_get_request, + build_job_target_groups_list_by_agent_request, + build_job_versions_get_request, + build_job_versions_list_by_job_request, + build_jobs_create_or_update_request, + build_jobs_delete_request, + build_jobs_get_request, + build_jobs_list_by_agent_request, + build_ledger_digest_uploads_create_or_update_request, + build_ledger_digest_uploads_disable_request, + build_ledger_digest_uploads_get_request, + build_ledger_digest_uploads_list_by_database_request, + build_long_term_retention_backups_change_access_tier_by_resource_group_request, + build_long_term_retention_backups_change_access_tier_request, + build_long_term_retention_backups_copy_by_resource_group_request, + build_long_term_retention_backups_copy_request, + build_long_term_retention_backups_delete_by_resource_group_request, + build_long_term_retention_backups_delete_request, + build_long_term_retention_backups_get_by_resource_group_request, + build_long_term_retention_backups_get_request, + build_long_term_retention_backups_list_by_database_request, + build_long_term_retention_backups_list_by_location_request, + build_long_term_retention_backups_list_by_resource_group_database_request, + build_long_term_retention_backups_list_by_resource_group_location_request, + build_long_term_retention_backups_list_by_resource_group_server_request, + build_long_term_retention_backups_list_by_server_request, + build_long_term_retention_backups_lock_time_based_immutability_by_resource_group_request, + build_long_term_retention_backups_lock_time_based_immutability_request, + build_long_term_retention_backups_remove_legal_hold_immutability_by_resource_group_request, + build_long_term_retention_backups_remove_legal_hold_immutability_request, + build_long_term_retention_backups_remove_time_based_immutability_by_resource_group_request, + build_long_term_retention_backups_remove_time_based_immutability_request, + build_long_term_retention_backups_set_legal_hold_immutability_by_resource_group_request, + build_long_term_retention_backups_set_legal_hold_immutability_request, + build_long_term_retention_backups_update_by_resource_group_request, + build_long_term_retention_backups_update_request, + build_long_term_retention_managed_instance_backups_delete_by_resource_group_request, + build_long_term_retention_managed_instance_backups_delete_request, + build_long_term_retention_managed_instance_backups_get_by_resource_group_request, + build_long_term_retention_managed_instance_backups_get_request, + build_long_term_retention_managed_instance_backups_list_by_database_request, + build_long_term_retention_managed_instance_backups_list_by_instance_request, + build_long_term_retention_managed_instance_backups_list_by_location_request, + build_long_term_retention_managed_instance_backups_list_by_resource_group_database_request, + build_long_term_retention_managed_instance_backups_list_by_resource_group_instance_request, + build_long_term_retention_managed_instance_backups_list_by_resource_group_location_request, + build_long_term_retention_policies_create_or_update_request, + build_long_term_retention_policies_get_request, + build_long_term_retention_policies_list_by_database_request, + build_maintenance_window_options_get_request, + build_maintenance_windows_create_or_update_request, + build_maintenance_windows_get_request, + build_managed_backup_short_term_retention_policies_create_or_update_request, + build_managed_backup_short_term_retention_policies_get_request, + build_managed_backup_short_term_retention_policies_list_by_database_request, + build_managed_backup_short_term_retention_policies_update_request, + build_managed_database_advanced_threat_protection_settings_create_or_update_request, + build_managed_database_advanced_threat_protection_settings_get_request, + build_managed_database_advanced_threat_protection_settings_list_by_database_request, + build_managed_database_columns_get_request, + build_managed_database_columns_list_by_database_request, + build_managed_database_columns_list_by_table_request, + build_managed_database_move_operations_get_request, + build_managed_database_move_operations_list_by_location_request, + build_managed_database_queries_get_request, + build_managed_database_queries_list_by_query_request, + build_managed_database_recommended_sensitivity_labels_update_request, + build_managed_database_restore_details_get_request, + build_managed_database_schemas_get_request, + build_managed_database_schemas_list_by_database_request, + build_managed_database_security_alert_policies_create_or_update_request, + build_managed_database_security_alert_policies_get_request, + build_managed_database_security_alert_policies_list_by_database_request, + build_managed_database_security_events_list_by_database_request, + build_managed_database_sensitivity_labels_create_or_update_request, + build_managed_database_sensitivity_labels_delete_request, + build_managed_database_sensitivity_labels_disable_recommendation_request, + build_managed_database_sensitivity_labels_enable_recommendation_request, + build_managed_database_sensitivity_labels_get_request, + build_managed_database_sensitivity_labels_list_by_database_request, + build_managed_database_sensitivity_labels_list_current_by_database_request, + build_managed_database_sensitivity_labels_list_recommended_by_database_request, + build_managed_database_sensitivity_labels_update_request, + build_managed_database_tables_get_request, + build_managed_database_tables_list_by_schema_request, + build_managed_database_transparent_data_encryption_create_or_update_request, + build_managed_database_transparent_data_encryption_get_request, + build_managed_database_transparent_data_encryption_list_by_database_request, + build_managed_database_vulnerability_assessment_rule_baselines_create_or_update_request, + build_managed_database_vulnerability_assessment_rule_baselines_delete_request, + build_managed_database_vulnerability_assessment_rule_baselines_get_request, + build_managed_database_vulnerability_assessment_scans_export_request, + build_managed_database_vulnerability_assessment_scans_get_request, + build_managed_database_vulnerability_assessment_scans_initiate_scan_request, + build_managed_database_vulnerability_assessment_scans_list_by_database_request, + build_managed_database_vulnerability_assessments_create_or_update_request, + build_managed_database_vulnerability_assessments_delete_request, + build_managed_database_vulnerability_assessments_get_request, + build_managed_database_vulnerability_assessments_list_by_database_request, + build_managed_databases_cancel_move_request, + build_managed_databases_complete_move_request, + build_managed_databases_complete_restore_request, + build_managed_databases_create_or_update_request, + build_managed_databases_delete_request, + build_managed_databases_get_request, + build_managed_databases_list_by_instance_request, + build_managed_databases_list_inaccessible_by_instance_request, + build_managed_databases_reevaluate_inaccessible_database_state_request, + build_managed_databases_start_move_request, + build_managed_databases_update_request, + build_managed_instance_administrators_create_or_update_request, + build_managed_instance_administrators_delete_request, + build_managed_instance_administrators_get_request, + build_managed_instance_administrators_list_by_instance_request, + build_managed_instance_advanced_threat_protection_settings_create_or_update_request, + build_managed_instance_advanced_threat_protection_settings_get_request, + build_managed_instance_advanced_threat_protection_settings_list_by_instance_request, + build_managed_instance_azure_ad_only_authentications_create_or_update_request, + build_managed_instance_azure_ad_only_authentications_delete_request, + build_managed_instance_azure_ad_only_authentications_get_request, + build_managed_instance_azure_ad_only_authentications_list_by_instance_request, + build_managed_instance_dtcs_create_or_update_request, + build_managed_instance_dtcs_get_request, + build_managed_instance_dtcs_list_by_managed_instance_request, + build_managed_instance_encryption_protectors_create_or_update_request, + build_managed_instance_encryption_protectors_get_request, + build_managed_instance_encryption_protectors_list_by_instance_request, + build_managed_instance_encryption_protectors_revalidate_request, + build_managed_instance_keys_create_or_update_request, + build_managed_instance_keys_delete_request, + build_managed_instance_keys_get_request, + build_managed_instance_keys_list_by_instance_request, + build_managed_instance_long_term_retention_policies_create_or_update_request, + build_managed_instance_long_term_retention_policies_delete_request, + build_managed_instance_long_term_retention_policies_get_request, + build_managed_instance_long_term_retention_policies_list_by_database_request, + build_managed_instance_operations_cancel_request, + build_managed_instance_operations_get_request, + build_managed_instance_operations_list_by_managed_instance_request, + build_managed_instance_private_endpoint_connections_create_or_update_request, + build_managed_instance_private_endpoint_connections_delete_request, + build_managed_instance_private_endpoint_connections_get_request, + build_managed_instance_private_endpoint_connections_list_by_managed_instance_request, + build_managed_instance_private_link_resources_get_request, + build_managed_instance_private_link_resources_list_by_managed_instance_request, + build_managed_instance_tde_certificates_create_request, + build_managed_instance_vulnerability_assessments_create_or_update_request, + build_managed_instance_vulnerability_assessments_delete_request, + build_managed_instance_vulnerability_assessments_get_request, + build_managed_instance_vulnerability_assessments_list_by_instance_request, + build_managed_instances_create_or_update_request, + build_managed_instances_delete_request, + build_managed_instances_failover_request, + build_managed_instances_get_request, + build_managed_instances_list_by_instance_pool_request, + build_managed_instances_list_by_managed_instance_request, + build_managed_instances_list_by_resource_group_request, + build_managed_instances_list_outbound_network_dependencies_by_managed_instance_request, + build_managed_instances_list_request, + build_managed_instances_reevaluate_inaccessible_database_state_request, + build_managed_instances_refresh_status_request, + build_managed_instances_start_request, + build_managed_instances_stop_request, + build_managed_instances_update_request, + build_managed_instances_validate_azure_key_vault_encryption_key_request, + build_managed_ledger_digest_uploads_create_or_update_request, + build_managed_ledger_digest_uploads_disable_request, + build_managed_ledger_digest_uploads_get_request, + build_managed_ledger_digest_uploads_list_by_database_request, + build_managed_restorable_dropped_database_backup_short_term_retention_policies_create_or_update_request, + build_managed_restorable_dropped_database_backup_short_term_retention_policies_get_request, + build_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database_request, + build_managed_restorable_dropped_database_backup_short_term_retention_policies_update_request, + build_managed_server_dns_aliases_acquire_request, + build_managed_server_dns_aliases_create_or_update_request, + build_managed_server_dns_aliases_delete_request, + build_managed_server_dns_aliases_get_request, + build_managed_server_dns_aliases_list_by_managed_instance_request, + build_managed_server_security_alert_policies_create_or_update_request, + build_managed_server_security_alert_policies_get_request, + build_managed_server_security_alert_policies_list_by_instance_request, + build_network_security_perimeter_configurations_get_request, + build_network_security_perimeter_configurations_list_by_server_request, + build_network_security_perimeter_configurations_reconcile_request, + build_operations_list_request, + build_outbound_firewall_rules_create_or_update_request, + build_outbound_firewall_rules_delete_request, + build_outbound_firewall_rules_get_request, + build_outbound_firewall_rules_list_by_server_request, + build_private_endpoint_connections_create_or_update_request, + build_private_endpoint_connections_delete_request, + build_private_endpoint_connections_get_request, + build_private_endpoint_connections_list_by_server_request, + build_private_link_resources_get_request, + build_private_link_resources_list_by_server_request, + build_recommended_sensitivity_labels_update_request, + build_recoverable_databases_get_request, + build_recoverable_databases_list_by_server_request, + build_recoverable_managed_databases_get_request, + build_recoverable_managed_databases_list_by_instance_request, + build_replication_links_create_or_update_request, + build_replication_links_delete_request, + build_replication_links_failover_allow_data_loss_request, + build_replication_links_failover_request, + build_replication_links_get_request, + build_replication_links_list_by_database_request, + build_replication_links_list_by_server_request, + build_replication_links_update_request, + build_restorable_dropped_databases_get_request, + build_restorable_dropped_databases_list_by_server_request, + build_restorable_dropped_managed_databases_get_request, + build_restorable_dropped_managed_databases_list_by_instance_request, + build_restore_points_create_request, + build_restore_points_delete_request, + build_restore_points_get_request, + build_restore_points_list_by_database_request, + build_sensitivity_labels_create_or_update_request, + build_sensitivity_labels_delete_request, + build_sensitivity_labels_disable_recommendation_request, + build_sensitivity_labels_enable_recommendation_request, + build_sensitivity_labels_get_request, + build_sensitivity_labels_list_by_database_request, + build_sensitivity_labels_list_current_by_database_request, + build_sensitivity_labels_list_recommended_by_database_request, + build_sensitivity_labels_update_request, + build_server_advanced_threat_protection_settings_create_or_update_request, + build_server_advanced_threat_protection_settings_get_request, + build_server_advanced_threat_protection_settings_list_by_server_request, + build_server_advisors_get_request, + build_server_advisors_list_by_server_request, + build_server_advisors_update_request, + build_server_automatic_tuning_get_request, + build_server_automatic_tuning_update_request, + build_server_azure_ad_administrators_create_or_update_request, + build_server_azure_ad_administrators_delete_request, + build_server_azure_ad_administrators_get_request, + build_server_azure_ad_administrators_list_by_server_request, + build_server_azure_ad_only_authentications_create_or_update_request, + build_server_azure_ad_only_authentications_delete_request, + build_server_azure_ad_only_authentications_get_request, + build_server_azure_ad_only_authentications_list_by_server_request, + build_server_blob_auditing_policies_create_or_update_request, + build_server_blob_auditing_policies_get_request, + build_server_blob_auditing_policies_list_by_server_request, + build_server_configuration_options_create_or_update_request, + build_server_configuration_options_get_request, + build_server_configuration_options_list_by_managed_instance_request, + build_server_connection_policies_create_or_update_request, + build_server_connection_policies_get_request, + build_server_connection_policies_list_by_server_request, + build_server_dev_ops_audit_settings_create_or_update_request, + build_server_dev_ops_audit_settings_get_request, + build_server_dev_ops_audit_settings_list_by_server_request, + build_server_dns_aliases_acquire_request, + build_server_dns_aliases_create_or_update_request, + build_server_dns_aliases_delete_request, + build_server_dns_aliases_get_request, + build_server_dns_aliases_list_by_server_request, + build_server_keys_create_or_update_request, + build_server_keys_delete_request, + build_server_keys_get_request, + build_server_keys_list_by_server_request, + build_server_operations_list_by_server_request, + build_server_security_alert_policies_create_or_update_request, + build_server_security_alert_policies_get_request, + build_server_security_alert_policies_list_by_server_request, + build_server_trust_certificates_create_or_update_request, + build_server_trust_certificates_delete_request, + build_server_trust_certificates_get_request, + build_server_trust_certificates_list_by_instance_request, + build_server_trust_groups_create_or_update_request, + build_server_trust_groups_delete_request, + build_server_trust_groups_get_request, + build_server_trust_groups_list_by_instance_request, + build_server_trust_groups_list_by_location_request, + build_server_usages_list_by_server_request, + build_server_vulnerability_assessments_create_or_update_request, + build_server_vulnerability_assessments_delete_request, + build_server_vulnerability_assessments_get_request, + build_server_vulnerability_assessments_list_by_server_request, + build_servers_check_name_availability_request, + build_servers_create_or_update_request, + build_servers_delete_request, + build_servers_get_request, + build_servers_import_database_request, + build_servers_list_by_resource_group_request, + build_servers_list_request, + build_servers_refresh_status_request, + build_servers_update_request, + build_sql_agent_create_or_update_request, + build_sql_agent_get_request, + build_sql_vulnerability_assessment_baseline_get_request, + build_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment_request, + build_sql_vulnerability_assessment_baselines_create_or_update_request, + build_sql_vulnerability_assessment_execute_scan_execute_request, + build_sql_vulnerability_assessment_rule_baseline_create_or_update_request, + build_sql_vulnerability_assessment_rule_baseline_get_request, + build_sql_vulnerability_assessment_rule_baseline_list_by_baseline_request, + build_sql_vulnerability_assessment_rule_baselines_delete_request, + build_sql_vulnerability_assessment_scan_result_get_request, + build_sql_vulnerability_assessment_scan_result_list_by_scan_request, + build_sql_vulnerability_assessment_scans_get_request, + build_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request, + build_sql_vulnerability_assessments_delete_request, + build_sql_vulnerability_assessments_settings_create_or_update_request, + build_sql_vulnerability_assessments_settings_get_request, + build_sql_vulnerability_assessments_settings_list_by_server_request, + build_start_stop_managed_instance_schedules_create_or_update_request, + build_start_stop_managed_instance_schedules_delete_request, + build_start_stop_managed_instance_schedules_get_request, + build_start_stop_managed_instance_schedules_list_by_instance_request, + build_subscription_usages_get_request, + build_subscription_usages_list_by_location_request, + build_synapse_link_workspaces_list_by_database_request, + build_sync_agents_create_or_update_request, + build_sync_agents_delete_request, + build_sync_agents_generate_key_request, + build_sync_agents_get_request, + build_sync_agents_list_by_server_request, + build_sync_agents_list_linked_databases_request, + build_sync_groups_cancel_sync_request, + build_sync_groups_create_or_update_request, + build_sync_groups_delete_request, + build_sync_groups_get_request, + build_sync_groups_list_by_database_request, + build_sync_groups_list_hub_schemas_request, + build_sync_groups_list_logs_request, + build_sync_groups_list_sync_database_ids_request, + build_sync_groups_refresh_hub_schema_request, + build_sync_groups_trigger_sync_request, + build_sync_groups_update_request, + build_sync_members_create_or_update_request, + build_sync_members_delete_request, + build_sync_members_get_request, + build_sync_members_list_by_sync_group_request, + build_sync_members_list_member_schemas_request, + build_sync_members_refresh_member_schema_request, + build_sync_members_update_request, + build_tde_certificates_create_request, + build_time_zones_get_request, + build_time_zones_list_by_location_request, + build_transparent_data_encryptions_create_or_update_request, + build_transparent_data_encryptions_get_request, + build_transparent_data_encryptions_list_by_database_request, + build_transparent_data_encryptions_resume_request, + build_transparent_data_encryptions_suspend_request, + build_usages_list_by_instance_pool_request, + build_virtual_clusters_create_or_update_request, + build_virtual_clusters_delete_request, + build_virtual_clusters_get_request, + build_virtual_clusters_list_by_resource_group_request, + build_virtual_clusters_list_request, + build_virtual_clusters_update_dns_servers_request, + build_virtual_clusters_update_request, + build_virtual_network_rules_create_or_update_request, + build_virtual_network_rules_delete_request, + build_virtual_network_rules_get_request, + build_virtual_network_rules_list_by_server_request, + build_workload_classifiers_create_or_update_request, + build_workload_classifiers_delete_request, + build_workload_classifiers_get_request, + build_workload_classifiers_list_by_workload_group_request, + build_workload_groups_create_or_update_request, + build_workload_groups_delete_request, + build_workload_groups_get_request, + build_workload_groups_list_by_database_request, +) +from .._configuration import SqlClientConfiguration T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] List = list @@ -41,16 +598,14 @@ class Operations: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s + :class:`~azure.mgmt.sql.aio.SqlClient`'s :attr:`operations` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @@ -58,15 +613,751 @@ def __init__(self, *args, **kwargs) -> None: def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: """Lists all of the available SQL Rest API operations. - :return: An iterator like instance of either Operation or the result of cls(response) + :return: An iterator like instance of Operation :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Operation] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class BackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.BackupShortTermRetentionPolicy: + """Gets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :return: BackupShortTermRetentionPolicy. The BackupShortTermRetentionPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: _models.BackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :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, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + BackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackupShortTermRetentionPolicy]( + 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, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: _models.BackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + BackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.BackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.BackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.BackupShortTermRetentionPolicy"]: + """Gets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of BackupShortTermRetentionPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -79,12 +1370,21 @@ def list(self, **kwargs: Any) -> AsyncItemPaged["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_backup_short_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -99,16 +1399,24 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.BackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) async def get_next(next_link=None): _request = prepare_request(next_link) @@ -121,12 +1429,74912 @@ 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( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return AsyncItemPaged(get_next, extract_data) + + +class DatabaseColumnsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_columns` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> _models.DatabaseColumn: + """Get database column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: DatabaseColumn. The DatabaseColumn is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseColumn + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) + + _request = build_database_columns_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseColumn, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_table( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseColumn"]: + """List database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_columns_list_by_table_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseColumn"]: + """List database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword schema: Default value is None. + :paramtype schema: list[str] + :keyword table: Default value is None. + :paramtype table: list[str] + :keyword column: Default value is None. + :paramtype column: list[str] + :keyword order_by: Default value is None. + :paramtype order_by: list[str] + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_columns_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + schema=schema, + table=table, + column=column, + order_by=order_by, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RestorePointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`restore_points` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any + ) -> _models.RestorePoint: + """Gets a restore point. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_point_name: The name of the restore point. Required. + :type restore_point_name: str + :return: RestorePoint. The RestorePoint is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorePoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) + + _request = build_restore_points_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + restore_point_name=restore_point_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorePoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any + ) -> None: + """Deletes a restore point. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_point_name: The name of the restore point. Required. + :type restore_point_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restore_points_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + restore_point_name=restore_point_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RestorePoint"]: + """Gets a list of database restore points. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of RestorePoint + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorePoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restore_points_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorePoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _create_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.CreateDatabaseRestorePointDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_restore_points_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.CreateDatabaseRestorePointDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Required. + :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition + :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 RestorePoint. The RestorePoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns RestorePoint. The RestorePoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. 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 RestorePoint. The RestorePoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.CreateDatabaseRestorePointDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Is one of + the following types: CreateDatabaseRestorePointDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns RestorePoint. The RestorePoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RestorePoint] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RestorePoint, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RestorePoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RestorePoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SensitivityLabelsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword count: Default value is None. + :paramtype count: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_current_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: SensitivityLabelUpdateList, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword include_disabled_recommendations: Specifies whether to include disabled + recommendations or not. Default value is None. + :paramtype include_disabled_recommendations: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_recommended_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Gets the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. Known values are: + "current" and "recommended". Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: _models.SensitivityLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. 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: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: Union[_models.SensitivityLabel, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Is one of the following types: + SensitivityLabel, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or JSON or IO[bytes] + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sensitivity_labels_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Deletes the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def disable_recommendation( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_disable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def enable_recommendation( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_enable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabasesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.Database: + """Gets a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: Database. The Database is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Database + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = kwargs.pop("cls", None) + + _request = build_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Database, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.Database, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.Database, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Database + :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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :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, + parameters: Union[_models.Database, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + Database, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Database or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + 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, + parameters: Union[_models.DatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.DatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate + :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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.DatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + DatabaseUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, + resource_group_name: str, + server_name: str, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Database"]: + """Gets a list of databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :keyword orderby: How the results should be ordered. Default value is None. + :paramtype orderby: str + :return: An iterator like instance of Database + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + top=top, + skip=skip, + filter=filter, + orderby=orderby, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _export_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ExportDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_export_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ExportDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ExportDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Is one of the following types: + ExportDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ImportExportOperationResult]( + 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, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + replica_type=replica_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Failovers a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword replica_type: The type of replica to be failed over. Known values are: "Primary" and + "ReadableSecondary". Default value is None. + :paramtype replica_type: str or ~azure.mgmt.sql.models.ReplicaType + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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, + server_name=server_name, + database_name=database_name, + replica_type=replica_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _import_method_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ImportExistingDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_import_method_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ImportExistingDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ImportExistingDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Is one of the following types: + ImportExistingDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ImportExportOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ResourceMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Required. + :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ResourceMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Is one of the + following types: ResourceMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_rename_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def _pause_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_pause_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_pause( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Pauses a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._pause_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _resume_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_resume( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Resumes a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _upgrade_data_warehouse_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_upgrade_data_warehouse_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_upgrade_data_warehouse( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Upgrades a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._upgrade_data_warehouse_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_inaccessible_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Database"]: + """Gets a list of inaccessible databases in a logical server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of Database + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_inaccessible_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_elastic_pool( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Database"]: + """Gets a list of databases in an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An iterator like instance of Database + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_by_elastic_pool_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.FirewallRule: + """Gets a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + + _request = build_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: _models.FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: Union[_models.FirewallRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Is one of + the following types: FirewallRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule or JSON or IO[bytes] + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: + """Deletes a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FirewallRule"]: + """Gets a list of firewall rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of FirewallRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def replace( + self, + resource_group_name: str, + server_name: str, + parameters: _models.FirewallRuleList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def replace( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param 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: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def replace( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.FirewallRuleList, JSON, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Is one of the following types: FirewallRuleList, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or JSON or IO[bytes] + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_firewall_rules_replace_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ReplicationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`replication_links` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> _models.ReplicationLink: + """Gets a replication link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: ReplicationLink. The ReplicationLink is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ReplicationLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) + + _request = build_replication_links_get_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ReplicationLink, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLink, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_replication_links_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Is one of the following types: ReplicationLink, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 _update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_replication_links_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Is one of the following types: ReplicationLinkUpdate, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_delete_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the replication link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ReplicationLink"]: + """Gets a list of replication links on database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ReplicationLink + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ReplicationLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_replication_links_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ReplicationLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_failover_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Fails over from the current primary server to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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._failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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_allow_data_loss_initial( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_failover_allow_data_loss_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover_allow_data_loss( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ReplicationLink]: + """Fails over from the current primary server to this server allowing data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of AsyncLROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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._failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ReplicationLink"]: + """Gets a list of replication links. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ReplicationLink + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ReplicationLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_replication_links_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ReplicationLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.Server: + """Gets a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: Server. The Server is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Server + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Server] = kwargs.pop("cls", None) + + _request = build_servers_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Server, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.Server, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.Server, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Server + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.Server, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Is one of the following types: Server, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Server or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ServerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerUpdate + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Is one of the following types: + ServerUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_servers_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncLROPoller[None]: + """Deletes a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.Server"]: + """Gets a list of servers in a resource groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Server + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Server]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_servers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Server"]: + """Gets a list of all servers in the subscription. + + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Server + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Server]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_servers_list_request( + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _import_database_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ImportNewDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_import_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ImportNewDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ImportNewDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Is one of the following types: + ImportNewDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_database_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ImportExportOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _refresh_status_initial( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_servers_refresh_status_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_refresh_status( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResult]: + """Refresh external governance enablement status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An instance of AsyncLROPoller that returns + RefreshExternalGovernanceStatusOperationResult. The + RefreshExternalGovernanceStatusOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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, + server_name=server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RefreshExternalGovernanceStatusOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + async def check_name_availability( + self, parameters: _models.CheckNameAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_name_availability( + self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def check_name_availability( + self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. 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: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def check_name_availability( + self, parameters: Union[_models.CheckNameAvailabilityRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Is one of the following types: + CheckNameAvailabilityRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest or JSON or IO[bytes] + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_check_name_availability_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckNameAvailabilityResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServerBlobAuditingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ServerBlobAuditingPolicy: + """Gets a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ServerBlobAuditingPolicy. The ServerBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_server_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ServerBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy + :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 ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. 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 ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Is one of the following types: + ServerBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerBlobAuditingPolicy] = 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, + blob_auditing_policy_name=blob_auditing_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerBlobAuditingPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerBlobAuditingPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerBlobAuditingPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerBlobAuditingPolicy"]: + """Lists auditing settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerBlobAuditingPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_blob_auditing_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseBlobAuditingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Gets a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_database_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.DatabaseBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. 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: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.DatabaseBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Is one of the following types: + DatabaseBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy or JSON or IO[bytes] + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseBlobAuditingPolicy"]: + """Lists auditing settings of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseBlobAuditingPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_blob_auditing_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExtendedDatabaseBlobAuditingPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`extended_database_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Gets an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_extended_database_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedDatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ExtendedDatabaseBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. 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: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedDatabaseBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Is one of the following types: + ExtendedDatabaseBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy or JSON or + IO[bytes] + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extended_database_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedDatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExtendedDatabaseBlobAuditingPolicy"]: + """Lists extended auditing settings of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ExtendedDatabaseBlobAuditingPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExtendedDatabaseBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extended_database_blob_auditing_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExtendedDatabaseBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ExtendedServerBlobAuditingPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`extended_server_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ExtendedServerBlobAuditingPolicy: + """Gets an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ExtendedServerBlobAuditingPolicy. The ExtendedServerBlobAuditingPolicy is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_extended_server_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedServerBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extended_server_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ExtendedServerBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Is one of the following types: + ExtendedServerBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ExtendedServerBlobAuditingPolicy"]: + """Lists extended auditing settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ExtendedServerBlobAuditingPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extended_server_blob_auditing_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExtendedServerBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerAdvisorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_advisors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any + ) -> _models.Advisor: + """Gets a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + _request = build_server_advisors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: _models.Advisor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Advisor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. 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: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: Union[_models.Advisor, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Is one of the following types: + Advisor, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Advisor or JSON or IO[bytes] + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_advisors_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_by_server( + self, resource_group_name: str, server_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> List[_models.Advisor]: + """Gets a list of server advisors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: list of Advisor + :rtype: list[~azure.mgmt.sql.models.Advisor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) + + _request = build_server_advisors_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.Advisor], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ManagedDatabaseColumnsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_columns` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> _models.DatabaseColumn: + """Get managed database column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: DatabaseColumn. The DatabaseColumn is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseColumn + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) + + _request = build_managed_database_columns_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseColumn, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_table( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseColumn"]: + """List managed database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_columns_list_by_table_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseColumn"]: + """List managed database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword schema: Default value is None. + :paramtype schema: list[str] + :keyword table: Default value is None. + :paramtype table: list[str] + :keyword column: Default value is None. + :paramtype column: list[str] + :keyword order_by: Default value is None. + :paramtype order_by: list[str] + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_columns_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + schema=schema, + table=table, + column=column, + order_by=order_by, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_tables` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + **kwargs: Any + ) -> _models.DatabaseTable: + """Get database table. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :return: DatabaseTable. The DatabaseTable is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) + + _request = build_database_tables_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseTable, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_schema( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseTable"]: + """List database tables. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseTable + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseTable]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_tables_list_by_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseTable], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_tables` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + **kwargs: Any + ) -> _models.DatabaseTable: + """Get managed database table. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :return: DatabaseTable. The DatabaseTable is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) + + _request = build_managed_database_tables_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseTable, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_schema( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseTable"]: + """List managed database tables. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseTable + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseTable]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_tables_list_by_schema_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseTable], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_schemas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, schema_name: str, **kwargs: Any + ) -> _models.DatabaseSchema: + """Get database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :return: DatabaseSchema. The DatabaseSchema is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) + + _request = build_database_schemas_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSchema, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSchema"]: + """List database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseSchema + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSchema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_schemas_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSchema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_schemas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, schema_name: str, **kwargs: Any + ) -> _models.DatabaseSchema: + """Get managed database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :return: DatabaseSchema. The DatabaseSchema is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) + + _request = build_managed_database_schemas_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSchema, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSchema"]: + """List managed database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseSchema + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSchema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_schemas_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSchema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseSecurityAlertPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Gets a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_database_security_alert_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.DatabaseSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. 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: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.DatabaseSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Is one of the following types: + DatabaseSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or JSON or IO[bytes] + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSecurityAlertPolicy"]: + """Gets a list of database's security alert policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseSecurityAlertPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_security_alert_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentBaselineOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_baseline` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_baseline_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessment( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentBaselineSet + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes SQL Vulnerability Assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class SqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessments_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Gets SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessments_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.SqlVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.SqlVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + SqlVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment or JSON or IO[bytes] + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessments_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessment"]: + """Lists SQL Vulnerability Assessment policies associated with a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of SqlVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessments_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Gets a database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or + JSON or IO[bytes] + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_sql_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_baseline( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentRuleBaseline + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentRuleBaselineOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_rule_baseline` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Gets a system database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_rule_baseline_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: JSON, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: IO[bytes], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes]], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or + JSON or IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessment_rule_baseline_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_baseline( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: + """Gets a system database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentRuleBaseline + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_rule_baseline_list_by_baseline_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_scan_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_id: str, + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanResults: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :param scan_result_id: The scan result id of the specific result to retrieve. Required. + :type scan_result_id: str + :return: SqlVulnerabilityAssessmentScanResults. The SqlVulnerabilityAssessmentScanResults is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_scan_result_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + scan_result_id=scan_result_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :return: An iterator like instance of SqlVulnerabilityAssessmentScanResults + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanResults]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessment_scan_result_list_by_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanResults], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_scan_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanResults: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :param scan_result_id: The scan result id of the specific result to retrieve. Required. + :type scan_result_id: str + :keyword system_database_name: The SQL vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: SqlVulnerabilityAssessmentScanResults. The SqlVulnerabilityAssessmentScanResults is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_scan_result_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + scan_result_id=scan_result_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_scan( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :keyword system_database_name: The SQL vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanResults + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanResults]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_scan_result_list_by_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanResults], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanRecord: + """Get a system database vulnerability assessment scan record. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: Required. + :type scan_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: SqlVulnerabilityAssessmentScanRecord. The SqlVulnerabilityAssessmentScanRecord is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessments( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Gets a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or JSON or + IO[bytes] + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Gets a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or JSON or + IO[bytes] + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Gets the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.DatabaseVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.DatabaseVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + DatabaseVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or JSON or IO[bytes] + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of DatabaseVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_vulnerability_assessments_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Gets the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.DatabaseVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.DatabaseVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + DatabaseVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or JSON or IO[bytes] + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessments of a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of DatabaseVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_vulnerability_assessments_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: VulnerabilityAssessmentScanRecord. The VulnerabilityAssessmentScanRecord is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of VulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_vulnerability_assessment_scans_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def export( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentScansExport: + """Convert an existing scan result to a human readable format. If already exists nothing happens. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: DatabaseVulnerabilityAssessmentScansExport. The + DatabaseVulnerabilityAssessmentScansExport is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_export_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentScansExport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _initiate_scan_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_initiate_scan_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_initiate_scan( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: An instance of AsyncLROPoller that returns VulnerabilityAssessmentScanRecord. The + VulnerabilityAssessmentScanRecord is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = 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._initiate_scan_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DataMaskingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`data_masking_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Gets the database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + _request = build_data_masking_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: _models.DataMaskingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. 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: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: Union[_models.DataMaskingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Is one of the + following types: DataMaskingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or JSON or IO[bytes] + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_masking_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DeletedServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`deleted_servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: + """Gets a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: DeletedServer. The DeletedServer is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DeletedServer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) + + _request = build_deleted_servers_get_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DeletedServer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: + """Gets a list of deleted servers for a location. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of DeletedServer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeletedServer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deleted_servers_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DeletedServer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _recover_initial( + self, location_name: str, deleted_server_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_deleted_servers_recover_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_recover( + self, location_name: str, deleted_server_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.DeletedServer]: + """Recovers a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: An instance of AsyncLROPoller that returns DeletedServer. The DeletedServer is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeletedServer] = 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._recover_initial( + location_name=location_name, + deleted_server_name=deleted_server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeletedServer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.DeletedServer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.DeletedServer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.DeletedServer"]: + """Gets a list of all deleted servers in a subscription. + + :return: An iterator like instance of DeletedServer + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeletedServer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deleted_servers_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DeletedServer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DistributedAvailabilityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`distributed_availability_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> _models.DistributedAvailabilityGroup: + """Gets a distributed availability group info. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 + :return: DistributedAvailabilityGroup. The DistributedAvailabilityGroup is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) + + _request = build_distributed_availability_groups_get_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_create_or_update_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: _models.DistributedAvailabilityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + 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]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Is one of the following types: + DistributedAvailabilityGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_update_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: _models.DistributedAvailabilityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + 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]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Is one of the following types: + DistributedAvailabilityGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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._update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_distributed_availability_groups_delete_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DistributedAvailabilityGroup"]: + """Gets a list of a distributed availability groups in instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of DistributedAvailabilityGroup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_distributed_availability_groups_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DistributedAvailabilityGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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, JSON, 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. The name is case insensitive. + 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 one of + the following types: DistributedAvailabilityGroupsFailoverRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest or JSON + or IO[bytes] + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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, JSON, 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. The name is case insensitive. + 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 one of + the following types: DistributedAvailabilityGroupSetRole, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 + ) + + +class ManagedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> _models.ManagedDatabase: + """Gets a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: ManagedDatabase. The ManagedDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) + + _request = build_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabase + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + ManagedDatabase, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabase or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + ManagedDatabaseUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_databases_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabase"]: + """Gets a list of managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedDatabase + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _cancel_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_cancel_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Is one of the + following types: ManagedDatabaseMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._cancel_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _complete_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_complete_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Is one of the + following types: ManagedDatabaseMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._complete_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _complete_restore_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.CompleteDatabaseRestoreDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_complete_restore_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.CompleteDatabaseRestoreDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + Required. + :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.CompleteDatabaseRestoreDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. Is one + of the following types: CompleteDatabaseRestoreDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._complete_restore_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_databases_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Reevaluates the inaccessibility state of a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _start_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseStartMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_start_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseStartMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseStartMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Is one of the + following types: ManagedDatabaseStartMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_inaccessible_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabase"]: + """Gets a list of inaccessible managed databases in a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedDatabase + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_databases_list_inaccessible_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerTrustGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_trust_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> _models.ServerTrustGroup: + """Gets a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :return: ServerTrustGroup. The ServerTrustGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerTrustGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) + + _request = build_server_trust_groups_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerTrustGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: Union[_models.ServerTrustGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_trust_groups_create_or_update_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: _models.ServerTrustGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup + :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 ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group 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 ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: Union[_models.ServerTrustGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Is one of the following types: + ServerTrustGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerTrustGroup] = 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, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerTrustGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerTrustGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerTrustGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_trust_groups_delete_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerTrustGroup"]: + """Lists a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of ServerTrustGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_groups_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerTrustGroup"]: + """Gets a server trust groups by instance name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerTrustGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_groups_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstancesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instances` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.ManagedInstance: + """Gets a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: ManagedInstance. The ManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + + _request = build_managed_instances_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstance, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstance + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstance, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Is one of the following + types: ManagedInstance, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstance or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + async def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Is one of the following + types: ManagedInstanceUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstance"]: + """Gets a list of managed instances in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.ManagedInstance"]: + """Gets a list of all managed instances in the subscription. + + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_request( + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_failover_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + replica_type=replica_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, + resource_group_name: str, + managed_instance_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Failovers a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword replica_type: The type of replica to be failed over. Known values are: "Primary" and + "ReadableSecondary". Default value is None. + :paramtype replica_type: str or ~azure.mgmt.sql.models.ReplicaType + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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, + replica_type=replica_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.OutboundEnvironmentEndpoint"]: + """Gets the collection of outbound network dependencies for the given managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of OutboundEnvironmentEndpoint + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundEnvironmentEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_outbound_network_dependencies_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundEnvironmentEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Reevaluates the inaccessibility state of all managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + async def _refresh_status_initial( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_refresh_status_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + 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. The name is case insensitive. + 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 + RefreshExternalGovernanceStatusOperationResultMI. The + RefreshExternalGovernanceStatusOperationResultMI is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RefreshExternalGovernanceStatusOperationResultMI, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.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 + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_start_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_start( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Starts the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + async def _stop_initial( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_stop_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_stop( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Stops the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_by_managed_instance( + self, + resource_group_name: str, + managed_instance_name: str, + *, + number_of_queries: Optional[int] = None, + databases: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, + observation_metric: Optional[Union[str, _models.MetricType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.TopQueries"]: + """Get top resource consuming queries of a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword number_of_queries: How many 'top queries' to return. Default is 5. Default value is + None. + :paramtype number_of_queries: int + :keyword databases: Comma separated list of databases to be included into search. All DB's are + included if this parameter is not specified. Default value is None. + :paramtype databases: str + :keyword start_time: Start time for observed period. Default value is None. + :paramtype start_time: str + :keyword end_time: End time for observed period. Default value is None. + :paramtype end_time: str + :keyword interval: The time step to be used to summarize the metric values. Default value is + PT1H. Known values are: "PT1H" and "P1D". Default value is None. + :paramtype interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :keyword aggregation_function: Aggregation function to be used, default value is 'sum'. Known + values are: "avg", "min", "max", "stdev", and "sum". Default value is None. + :paramtype aggregation_function: str or ~azure.mgmt.sql.models.AggregationFunctionType + :keyword observation_metric: Metric to be used for ranking top queries. Default is 'cpu'. Known + values are: "cpu", "io", "logIo", "duration", and "dtu". Default value is None. + :paramtype observation_metric: str or ~azure.mgmt.sql.models.MetricType + :return: An iterator like instance of TopQueries + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TopQueries] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TopQueries]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + number_of_queries=number_of_queries, + databases=databases, + start_time=start_time, + end_time=end_time, + interval=interval, + aggregation_function=aggregation_function, + observation_metric=observation_metric, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TopQueries], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_validate_azure_key_vault_encryption_key_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Is one of the + following types: ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes] + Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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._validate_azure_key_vault_encryption_key_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstance"]: + """Gets a list of all managed instances in an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ElasticPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`elastic_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> _models.ElasticPool: + """Gets an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: ElasticPool. The ElasticPool is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ElasticPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) + + _request = build_elastic_pools_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ElasticPool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPool, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_elastic_pools_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: _models.ElasticPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPool + :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 ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool 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 ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPool, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Is one of the following types: ElasticPool, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPool or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ElasticPool] = 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, + elastic_pool_name=elastic_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_elastic_pools_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: _models.ElasticPoolUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate + :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 ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update 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 ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Is one of the following types: + ElasticPoolUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ElasticPool] = 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, + elastic_pool_name=elastic_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_elastic_pools_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, *, skip: Optional[int] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ElasticPool"]: + """Gets all elastic pools in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of ElasticPool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ElasticPool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_elastic_pools_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ElasticPool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_elastic_pools_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ElasticPool]: + """Failovers an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An instance of AsyncLROPoller that returns ElasticPool. The ElasticPool is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ElasticPool] = 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, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class EncryptionProtectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> _models.EncryptionProtector: + """Gets a server encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: EncryptionProtector. The EncryptionProtector is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.EncryptionProtector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) + + _request = build_encryption_protectors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EncryptionProtector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.EncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_encryption_protectors_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: _models.EncryptionProtector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: ~azure.mgmt.sql.models.EncryptionProtector + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.EncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Is one of the following + types: EncryptionProtector, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.EncryptionProtector or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.EncryptionProtector"]: + """Gets a list of server encryption protectors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of EncryptionProtector + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.EncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EncryptionProtector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_encryption_protectors_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EncryptionProtector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _revalidate_initial( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_revalidate( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncLROPoller[_models.EncryptionProtector]: + """Revalidates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of AsyncLROPoller that returns EncryptionProtector. The + EncryptionProtector is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.EncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EncryptionProtector] = 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._revalidate_initial( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.EncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.EncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class EndpointCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`endpoint_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, endpoint_type: str, **kwargs: Any + ) -> _models.EndpointCertificate: + """Gets a certificate used on the endpoint with the given id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param endpoint_type: Type of the endpoint whose certificate the customer is looking for. + Required. + :type endpoint_type: str + :return: EndpointCertificate. The EndpointCertificate is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.EndpointCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) + + _request = build_endpoint_certificates_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + endpoint_type=endpoint_type, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EndpointCertificate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.EndpointCertificate"]: + """List certificates used on endpoints on the target instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of EndpointCertificate + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.EndpointCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EndpointCertificate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_endpoint_certificates_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EndpointCertificate], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class FailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`failover_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.FailoverGroup: + """Gets a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: FailoverGroup. The FailoverGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FailoverGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) + + _request = build_failover_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FailoverGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: _models.FailoverGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroup + :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 FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: FailoverGroup, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FailoverGroup] = 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, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: _models.FailoverGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate + :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 FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: + FailoverGroupUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FailoverGroup] = 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, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.FailoverGroup"]: + """Lists the failover groups in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of FailoverGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_groups_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + 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, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_force_failover_allow_data_loss( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation might result in data + loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + 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 + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_try_planned_before_forced_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_try_planned_before_forced_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation tries planned before + forced failover but might still result in data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns FailoverGroup. The FailoverGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._try_planned_before_forced_failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class GeoBackupPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`geo_backup_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Gets a Geo backup policy for the given database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + _request = build_geo_backup_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GeoBackupPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: _models.GeoBackupPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + Required. + :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + 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: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: Union[_models.GeoBackupPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. Is + one of the following types: GeoBackupPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy or JSON or IO[bytes] + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_geo_backup_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GeoBackupPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.GeoBackupPolicy"]: + """Gets a list of Geo backup policies for the given database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of GeoBackupPolicy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GeoBackupPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_geo_backup_policies_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.GeoBackupPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class InstanceFailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`instance_failover_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.InstanceFailoverGroup: + """Gets a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: InstanceFailoverGroup. The InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: Union[_models.InstanceFailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_failover_groups_create_or_update_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: _models.InstanceFailoverGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup + :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 InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: Union[_models.InstanceFailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: + InstanceFailoverGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstanceFailoverGroup] = 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, + location_name=location_name, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_delete_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.InstanceFailoverGroup"]: + """Lists the failover groups in a location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of InstanceFailoverGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_failover_groups_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstanceFailoverGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _failover_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_failover_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_failover( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Fails over from the current primary managed instance to this managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = 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, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_force_failover_allow_data_loss( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.InstanceFailoverGroup]: + """Fails over from the current primary managed instance to this managed instance. This operation + might result in data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of AsyncLROPoller that returns InstanceFailoverGroup. The + InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InstancePoolOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`instance_pool_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.InstancePoolOperation: + """Gets a management operation on a instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param operation_id: Required. + :type operation_id: str + :return: InstancePoolOperation. The InstancePoolOperation is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstancePoolOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) + + _request = build_instance_pool_operations_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstancePoolOperation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.InstancePoolOperation"]: + """Gets a list of operations performed on the instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: An iterator like instance of InstancePoolOperation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePoolOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pool_operations_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePoolOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class InstancePoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`instance_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> _models.InstancePool: + """Gets an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: InstancePool. The InstancePool is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstancePool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) + + _request = build_instance_pools_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstancePool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePool, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_pools_create_or_update_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: _models.InstancePool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: ~azure.mgmt.sql.models.InstancePool + :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 InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. 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 InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePool, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Is one of the following types: + InstancePool, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstancePool or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstancePool] = 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, + instance_pool_name=instance_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstancePool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InstancePool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InstancePool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_pools_update_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: _models.InstancePoolUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate + :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 InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. 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 InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Is one of the following types: + InstancePoolUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns InstancePool. The InstancePool is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstancePool] = 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, + instance_pool_name=instance_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstancePool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.InstancePool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.InstancePool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_pools_delete_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> AsyncItemPaged["_models.InstancePool"]: + """Gets a list of instance pools in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InstancePool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pools_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.InstancePool"]: + """Gets a list of all instance pools in the subscription. + + :return: An iterator like instance of InstancePool + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pools_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class IPv6FirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`ipv6_firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Gets an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) + + _request = build_ipv6_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IPv6FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: _models.IPv6FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + Required. + :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + 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: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: Union[_models.IPv6FirewallRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. Is + one of the following types: IPv6FirewallRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule or JSON or IO[bytes] + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ipv6_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IPv6FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete(self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any) -> None: + """Deletes an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ipv6_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.IPv6FirewallRule"]: + """Gets a list of IPv6 firewall rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of IPv6FirewallRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.IPv6FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IPv6FirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ipv6_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IPv6FirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_executions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Creates or updates a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: An instance of AsyncLROPoller that returns JobExecution. The JobExecution is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = 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, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobExecution, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def cancel( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> None: + """Requests cancellation of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_executions_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_job( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists a job's executions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_executions_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_agent( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists all executions in a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_executions_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _create_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_executions_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.JobExecution]: + """Starts an elastic job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: An instance of AsyncLROPoller that returns JobExecution. The JobExecution is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.JobExecution, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class JobAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_agents` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> _models.JobAgent: + """Gets a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: JobAgent. The JobAgent is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobAgent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) + + _request = build_job_agents_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobAgent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_agents_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: _models.JobAgent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Required. + :type parameters: ~azure.mgmt.sql.models.JobAgent + :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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. 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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Is one of the following types: + JobAgent, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobAgent or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobAgent] = 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, + job_agent_name=job_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgentUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_agents_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: _models.JobAgentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Required. + :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate + :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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. 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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgentUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Is one of the following types: JobAgentUpdate, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobAgent] = 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, + job_agent_name=job_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_agents_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobAgent"]: + """Gets a list of job agents in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of JobAgent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobAgent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_agents_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobAgent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobCredentialsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_credentials` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any + ) -> _models.JobCredential: + """Gets a jobs credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) + + _request = build_job_credentials_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: _models.JobCredential, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Required. + :type parameters: ~azure.mgmt.sql.models.JobCredential + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. 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: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: Union[_models.JobCredential, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Is one of the following types: + JobCredential, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobCredential or JSON or IO[bytes] + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_credentials_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any + ) -> None: + """Deletes a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_credentials_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobCredential"]: + """Gets a list of jobs credentials. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobCredential + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobCredential]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_credentials_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobCredential], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobStepExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_step_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a step execution of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_step_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists the step executions of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_step_executions_list_by_job_execution_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobTargetExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_target_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + target_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a target execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :param target_id: The target id. Required. + :type target_id: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_target_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + target_id=target_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_step( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists the target executions of a job step execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_executions_list_by_step_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobExecution"]: + """Lists target executions for all steps of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_executions_list_by_job_execution_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> _models.Job: + """Gets a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Job] = kwargs.pop("cls", None) + + _request = build_jobs_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Job, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: _models.Job, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Required. + :type parameters: ~azure.mgmt.sql.models.Job + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. 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: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: Union[_models.Job, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Is one of the following types: Job, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.Job or JSON or IO[bytes] + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Job, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> None: + """Deletes a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_jobs_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.Job"]: + """Gets a list of jobs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of Job + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Job] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Job]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Job], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobPrivateEndpointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_private_endpoints` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> _models.JobPrivateEndpoint: + """Gets a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :return: JobPrivateEndpoint. The JobPrivateEndpoint is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) + + _request = build_job_private_endpoints_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobPrivateEndpoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: Union[_models.JobPrivateEndpoint, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_private_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: _models.JobPrivateEndpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Required. + :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint + :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 JobPrivateEndpoint. The JobPrivateEndpoint + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns JobPrivateEndpoint. The JobPrivateEndpoint + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. 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 JobPrivateEndpoint. The JobPrivateEndpoint + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: Union[_models.JobPrivateEndpoint, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Is one of the following types: + JobPrivateEndpoint, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns JobPrivateEndpoint. The JobPrivateEndpoint + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobPrivateEndpoint] = 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, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobPrivateEndpoint, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.JobPrivateEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.JobPrivateEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_private_endpoints_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobPrivateEndpoint"]: + """Gets a list of job agent private endpoints. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobPrivateEndpoint + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobPrivateEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_private_endpoints_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobPrivateEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobStepsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_steps` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets a job step in a job's current version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_job_steps_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: _models.JobStep, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Required. + :type parameters: ~azure.mgmt.sql.models.JobStep + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. 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: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: Union[_models.JobStep, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Is one of the following types: JobStep, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobStep or JSON or IO[bytes] + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_steps_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + **kwargs: Any + ) -> None: + """Deletes a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_steps_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_job( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobStep"]: + """Gets all job steps for a job's current version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :return: An iterator like instance of JobStep + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobStep]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_steps_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobStep], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets the specified version of a job step. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_job_steps_get_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> AsyncItemPaged["_models.JobStep"]: + """Gets all job steps in the specified job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: An iterator like instance of JobStep + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobStep] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobStep]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_steps_list_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobStep], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobTargetGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_target_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any + ) -> _models.JobTargetGroup: + """Gets a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) + + _request = build_job_target_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobTargetGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: _models.JobTargetGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Required. + :type parameters: ~azure.mgmt.sql.models.JobTargetGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. 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: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: Union[_models.JobTargetGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Is one of the following types: + JobTargetGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobTargetGroup or JSON or IO[bytes] + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_target_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobTargetGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any + ) -> None: + """Deletes a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_target_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobTargetGroup"]: + """Gets all target groups in an agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobTargetGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobTargetGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobTargetGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_groups_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobTargetGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class JobVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`job_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> _models.JobVersion: + """Gets a job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: JobVersion. The JobVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) + + _request = build_job_versions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.JobVersion"]: + """Gets all versions of a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: An iterator like instance of JobVersion + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.JobVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_versions_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LongTermRetentionBackupsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`long_term_retention_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.LongTermRetentionBackup: + """Gets a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: LongTermRetentionBackup. The LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_get_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_delete_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists all long term retention backups for a database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_database_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _change_access_tier_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_change_access_tier_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters + :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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: 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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Is one of the following types: + ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _copy_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_copy_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.CopyLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Is one of the + following types: CopyLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _lock_time_based_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_lock_time_based_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_lock_time_based_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Lock time based immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _remove_legal_hold_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_legal_hold_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_remove_legal_hold_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Remove legal hold immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _remove_time_based_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_time_based_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_remove_time_based_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Remove time based immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_legal_hold_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_set_legal_hold_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_set_legal_hold_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Set legal hold immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_update_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.UpdateLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Is one of the following types: + UpdateLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def get_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.LongTermRetentionBackup: + """Gets a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: LongTermRetentionBackup. The LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_get_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_delete_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group_database( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists all long term retention backups for a database based on a particular resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_database_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_change_access_tier_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters + :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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: 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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Is one of the following types: + ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or + JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _copy_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_copy_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.CopyLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Is one of the + following types: CopyLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_lock_time_based_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_lock_time_based_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Lock time based immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_legal_hold_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_remove_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Remove legal hold immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _remove_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_time_based_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_remove_time_based_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Remove time based immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _set_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_set_legal_hold_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_set_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackup]: + """Set legal hold immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_update_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.UpdateLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Is one of the following types: + UpdateLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_location( + self, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_server( + self, + location_name: str, + long_term_retention_server_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given server. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_server_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given location based on resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_server( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given server based on resource groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_server_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LongTermRetentionManagedInstanceBackupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`long_term_retention_managed_instance_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get_by_resource_group( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionBackup: + """Gets a long term retention backup for a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: ManagedInstanceLongTermRetentionBackup. The ManagedInstanceLongTermRetentionBackup is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_get_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_delete_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete_by_resource_group( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group_database( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_database_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionBackup: + """Gets a long term retention backup for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: ManagedInstanceLongTermRetentionBackup. The ManagedInstanceLongTermRetentionBackup is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_get_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _delete_initial( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_delete_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, + location_name: str, + managed_instance_name: str, + database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_database_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_location( + self, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_instance( + self, + location_name: str, + managed_instance_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for a given managed instance. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_instance_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_instance( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for a given managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_instance_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LongTermRetentionPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`long_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + **kwargs: Any + ) -> _models.LongTermRetentionPolicy: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :return: LongTermRetentionPolicy. The LongTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_long_term_retention_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: Union[_models.LongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: _models.LongTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :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, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: Union[_models.LongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Is one of the following types: + LongTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LongTermRetentionPolicy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LongTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedBackupShortTermRetentionPolicy: + """Gets a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :return: ManagedBackupShortTermRetentionPolicy. The ManagedBackupShortTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a managed database's short term retention policy list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedBackupShortTermRetentionPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_backup_short_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedBackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_restorable_dropped_database_backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedBackupShortTermRetentionPolicy: + """Gets a dropped database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :return: ManagedBackupShortTermRetentionPolicy. The ManagedBackupShortTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = ( + build_managed_restorable_dropped_database_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedBackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_restorable_dropped_database( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a dropped database's short term retention policy list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: An iterator like instance of ManagedBackupShortTermRetentionPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedBackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseSecurityAlertPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Gets a managed database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_managed_database_security_alert_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ManagedDatabaseSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. 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: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedDatabaseSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Is one of the following types: + ManagedDatabaseSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy or JSON or + IO[bytes] + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: + """Gets a list of managed database's security alert policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedDatabaseSecurityAlertPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_security_alert_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceAdministratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> _models.ManagedInstanceAdministrator: + """Gets a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: ManagedInstanceAdministrator. The ManagedInstanceAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) + + _request = build_managed_instance_administrators_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ManagedInstanceAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_administrators_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: _models.ManagedInstanceAdministrator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator + :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 ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator 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 ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ManagedInstanceAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Is one of the following types: + ManagedInstanceAdministrator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAdministrator] = 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, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAdministrator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_administrators_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceAdministrator"]: + """Gets a list of managed instance administrators. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAdministrator + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_administrators_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAdministrator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_azure_ad_only_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> _models.ManagedInstanceAzureADOnlyAuthentication: + """Gets a specific Azure Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: ManagedInstanceAzureADOnlyAuthentication. The ManagedInstanceAzureADOnlyAuthentication + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) + + _request = build_managed_instance_azure_ad_only_authentications_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAzureADOnlyAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_azure_ad_only_authentications_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: _models.ManagedInstanceAzureADOnlyAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication + :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 ManagedInstanceAzureADOnlyAuthentication. + The ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceAzureADOnlyAuthentication. + The ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. 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 ManagedInstanceAzureADOnlyAuthentication. + The ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Is one of the following types: + ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceAzureADOnlyAuthentication. + The ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = 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, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAzureADOnlyAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_azure_ad_only_authentications_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing server Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAzureADOnlyAuthentication + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_azure_ad_only_authentications_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAzureADOnlyAuthentication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceDtcsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_dtcs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, dtc_name: Union[str, _models.DtcName], **kwargs: Any + ) -> _models.ManagedInstanceDtc: + """Gets managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :return: ManagedInstanceDtc. The ManagedInstanceDtc is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) + + _request = build_managed_instance_dtcs_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceDtc, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: Union[_models.ManagedInstanceDtc, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_dtcs_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: _models.ManagedInstanceDtc, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc + :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 ManagedInstanceDtc. The ManagedInstanceDtc + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceDtc. The ManagedInstanceDtc + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. 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 ManagedInstanceDtc. The ManagedInstanceDtc + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: Union[_models.ManagedInstanceDtc, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Is one of the following types: + ManagedInstanceDtc, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceDtc. The ManagedInstanceDtc + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = 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, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.ManagedInstanceDtc, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceDtc].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceDtc]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceDtc"]: + """Gets a list of managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceDtc + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceDtc]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_dtcs_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceDtc], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceEncryptionProtectorsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> _models.ManagedInstanceEncryptionProtector: + """Gets a managed instance encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: ManagedInstanceEncryptionProtector. The ManagedInstanceEncryptionProtector is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) + + _request = build_managed_instance_encryption_protectors_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.ManagedInstanceEncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_encryption_protectors_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: _models.ManagedInstanceEncryptionProtector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector + :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 ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. 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 ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.ManagedInstanceEncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Is one of the following + types: ManagedInstanceEncryptionProtector, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceEncryptionProtector"]: + """Gets a list of managed instance encryption protectors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceEncryptionProtector + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_encryption_protectors_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceEncryptionProtector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _revalidate_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_revalidate( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]: + """Revalidates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of AsyncLROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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._revalidate_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceEncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ManagedInstanceKeysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_keys` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> _models.ManagedInstanceKey: + """Gets a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :return: ManagedInstanceKey. The ManagedInstanceKey is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) + + _request = build_managed_instance_keys_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceKey, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: Union[_models.ManagedInstanceKey, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_keys_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: _models.ManagedInstanceKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey + :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 ManagedInstanceKey. The ManagedInstanceKey + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceKey. The ManagedInstanceKey + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. 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 ManagedInstanceKey. The ManagedInstanceKey + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: Union[_models.ManagedInstanceKey, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Is one of the following + types: ManagedInstanceKey, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceKey. The ManagedInstanceKey + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceKey] = 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, + managed_instance_name=managed_instance_name, + key_name=key_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceKey, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_keys_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the managed instance key with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, *, filter: Optional[str] = None, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceKey"]: + """Gets a list of managed instance keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceKey + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_keys_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceKey], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceLongTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_long_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionPolicy: + """Gets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: ManagedInstanceLongTermRetentionPolicy. The ManagedInstanceLongTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_instance_long_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_long_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: _models.ManagedInstanceLongTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Is one of the following types: + ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_long_term_retention_policies_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_long_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any + ) -> _models.ManagedInstanceOperation: + """Gets a management operation on a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param operation_id: Required. + :type operation_id: str + :return: ManagedInstanceOperation. The ManagedInstanceOperation is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) + + _request = build_managed_instance_operations_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceOperation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceOperation"]: + """Gets a list of operations performed on the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceOperation + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_operations_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel( + self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param operation_id: Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_instance_operations_cancel_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedInstancePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.ManagedInstancePrivateEndpointConnection: + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: ManagedInstancePrivateEndpointConnection. The ManagedInstancePrivateEndpointConnection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstancePrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.ManagedInstancePrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_private_endpoint_connections_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: _models.ManagedInstancePrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.ManagedInstancePrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Is one of the following types: ManagedInstancePrivateEndpointConnection, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstancePrivateEndpointConnection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_private_endpoint_connections_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstancePrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Gets the managed instance's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_managed_instance_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.ManagedInstanceVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.ManagedInstanceVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + ManagedInstanceVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment or JSON or + IO[bytes] + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the managed instance's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_instance_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: + """Gets the managed instance's vulnerability assessment policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_vulnerability_assessments_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedServerDnsAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_server_dns_aliases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> _models.ManagedServerDnsAlias: + """Gets a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :return: ManagedServerDnsAlias. The ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) + + _request = build_managed_server_dns_aliases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasCreation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_dns_aliases_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: _models.ManagedServerDnsAliasCreation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation + :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 ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: 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 ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasCreation, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ManagedServerDnsAliasCreation, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerDnsAlias] = 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, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_server_dns_aliases_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the managed server DNS alias with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedServerDnsAlias"]: + """Gets a list of managed server DNS aliases for a managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedServerDnsAlias + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_server_dns_aliases_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedServerDnsAlias], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _acquire_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_dns_aliases_acquire_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: _models.ManagedServerDnsAliasAcquisition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition + :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 ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: 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 ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ManagedServerDnsAliasAcquisition, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedServerDnsAlias. The + ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerDnsAlias] = 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._acquire_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ManagedServerSecurityAlertPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_server_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ManagedServerSecurityAlertPolicy: + """Get a managed server's threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ManagedServerSecurityAlertPolicy. The ManagedServerSecurityAlertPolicy is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_managed_server_security_alert_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedServerSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ManagedServerSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy + :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 ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. 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 ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Is one of the following types: + ManagedServerSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = 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, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedServerSecurityAlertPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedServerSecurityAlertPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedServerSecurityAlertPolicy"]: + """Get the managed server's threat detection policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedServerSecurityAlertPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_server_security_alert_policies_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedServerSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`network_security_perimeter_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets a network security perimeter configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) + + _request = build_network_security_perimeter_configurations_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of NetworkSecurityPerimeterConfiguration + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_perimeter_configurations_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkSecurityPerimeterConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _reconcile_initial( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_security_perimeter_configurations_reconcile_request( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_reconcile( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile network security perimeter configuration for SQL Resource Provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: An instance of AsyncLROPoller that returns NetworkSecurityPerimeterConfiguration. The + NetworkSecurityPerimeterConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.NetworkSecurityPerimeterConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class OutboundFirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`outbound_firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> _models.OutboundFirewallRule: + """Gets an outbound firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: OutboundFirewallRule. The OutboundFirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OutboundFirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> AsyncLROPoller[_models.OutboundFirewallRule]: + """Create a outbound firewall rule with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: An instance of AsyncLROPoller that returns OutboundFirewallRule. The + OutboundFirewallRule is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OutboundFirewallRule] = 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, + outbound_rule_fqdn=outbound_rule_fqdn, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OutboundFirewallRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.OutboundFirewallRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.OutboundFirewallRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a outbound firewall rule with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.OutboundFirewallRule"]: + """Gets all outbound firewall rules on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of OutboundFirewallRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_outbound_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundFirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: 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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Is one of the following types: PrivateEndpointConnection, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of PrivateEndpointConnection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoint_connections_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, group_name: str, **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets a private link resource for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + + _request = build_private_link_resources_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.PrivateLinkResource"]: + """Gets the private link resources for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of PrivateLinkResource + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.PrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_resources_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RecoverableDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`recoverable_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.RecoverableDatabase: + """Gets a recoverable database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: RecoverableDatabase. The RecoverableDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecoverableDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) + + _request = build_recoverable_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecoverableDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RecoverableDatabase"]: + """Gets a list of recoverable databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of RecoverableDatabase + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RecoverableDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecoverableDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_recoverable_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RecoverableDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RecoverableManagedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`recoverable_managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, recoverable_database_name: str, **kwargs: Any + ) -> _models.RecoverableManagedDatabase: + """Gets a recoverable managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param recoverable_database_name: Required. + :type recoverable_database_name: str + :return: RecoverableManagedDatabase. The RecoverableManagedDatabase is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) + + _request = build_recoverable_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + recoverable_database_name=recoverable_database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecoverableManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RecoverableManagedDatabase"]: + """Gets a list of recoverable managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of RecoverableManagedDatabase + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RecoverableManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecoverableManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_recoverable_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RecoverableManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RestorableDroppedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`restorable_dropped_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + restorable_dropped_database_id: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.RestorableDroppedDatabase: + """Gets a restorable dropped database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: RestorableDroppedDatabase. The RestorableDroppedDatabase is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) + + _request = build_restorable_dropped_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorableDroppedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RestorableDroppedDatabase"]: + """Gets a list of restorable dropped databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of RestorableDroppedDatabase + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorableDroppedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorableDroppedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restorable_dropped_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorableDroppedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RestorableDroppedManagedDatabasesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`restorable_dropped_managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> _models.RestorableDroppedManagedDatabase: + """Gets a restorable dropped managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: RestorableDroppedManagedDatabase. The RestorableDroppedManagedDatabase is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) + + _request = build_restorable_dropped_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorableDroppedManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.RestorableDroppedManagedDatabase"]: + """Gets a list of restorable dropped managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of RestorableDroppedManagedDatabase + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorableDroppedManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorableDroppedManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restorable_dropped_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorableDroppedManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerAzureADAdministratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_azure_ad_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> _models.ServerAzureADAdministrator: + """Gets a Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: ServerAzureADAdministrator. The ServerAzureADAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_administrators_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAzureADAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ServerAzureADAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_azure_ad_administrators_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: _models.ServerAzureADAdministrator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator + :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 ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. 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 ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ServerAzureADAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Is one of + the following types: ServerAzureADAdministrator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAzureADAdministrator] = 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, + administrator_name=administrator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAzureADAdministrator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerAzureADAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerAzureADAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_administrators_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the Azure Active Directory administrator with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerAzureADAdministrator"]: + """Gets a list of Azure Active Directory administrators in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAzureADAdministrator + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_azure_ad_administrators_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAzureADAdministrator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_azure_ad_only_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> _models.ServerAzureADOnlyAuthentication: + """Gets a specific Azure Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: ServerAzureADOnlyAuthentication. The ServerAzureADOnlyAuthentication is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_only_authentications_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAzureADOnlyAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ServerAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_azure_ad_only_authentications_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: _models.ServerAzureADOnlyAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication + :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 ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. 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 ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ServerAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Is one of the following types: ServerAzureADOnlyAuthentication, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = 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, + authentication_name=authentication_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAzureADOnlyAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerAzureADOnlyAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_only_authentications_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing server Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAzureADOnlyAuthentication + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_azure_ad_only_authentications_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAzureADOnlyAuthentication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerConfigurationOptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_configuration_options` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + **kwargs: Any + ) -> _models.ServerConfigurationOption: + """Gets managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :return: ServerConfigurationOption. The ServerConfigurationOption is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) + + _request = build_server_configuration_options_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerConfigurationOption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: Union[_models.ServerConfigurationOption, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_configuration_options_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: _models.ServerConfigurationOption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption + :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 ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option 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 ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: Union[_models.ServerConfigurationOption, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Is one of the following types: + ServerConfigurationOption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerConfigurationOption] = 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, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.ServerConfigurationOption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerConfigurationOption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerConfigurationOption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerConfigurationOption"]: + """Gets a list of managed instance server configuration options. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerConfigurationOption + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerConfigurationOption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_configuration_options_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerConfigurationOption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerConnectionPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_connection_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + **kwargs: Any + ) -> _models.ServerConnectionPolicy: + """Gets a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :return: ServerConnectionPolicy. The ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) + + _request = build_server_connection_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerConnectionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: Union[_models.ServerConnectionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_connection_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: _models.ServerConnectionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy + :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 ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. 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 ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: Union[_models.ServerConnectionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Is one of + the following types: ServerConnectionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerConnectionPolicy] = 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, + connection_policy_name=connection_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerConnectionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerConnectionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerConnectionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerConnectionPolicy"]: + """Lists connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerConnectionPolicy + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_connection_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerConnectionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerDevOpsAuditSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_dev_ops_audit_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + **kwargs: Any + ) -> _models.ServerDevOpsAuditingSettings: + """Gets a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :return: ServerDevOpsAuditingSettings. The ServerDevOpsAuditingSettings is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) + + _request = build_server_dev_ops_audit_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerDevOpsAuditingSettings, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: Union[_models.ServerDevOpsAuditingSettings, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_dev_ops_audit_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: _models.ServerDevOpsAuditingSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Required. + :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings + :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 ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. 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 ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: Union[_models.ServerDevOpsAuditingSettings, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Is one of the following types: + ServerDevOpsAuditingSettings, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = 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, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerDevOpsAuditingSettings, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerDevOpsAuditingSettings].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerDevOpsAuditingSettings]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerDevOpsAuditingSettings"]: + """Lists DevOps audit settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerDevOpsAuditingSettings + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_dev_ops_audit_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerDevOpsAuditingSettings], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerDnsAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_dns_aliases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> _models.ServerDnsAlias: + """Gets a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: ServerDnsAlias. The ServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerDnsAlias + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_create_or_update( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDnsAlias]: + """Creates a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: An instance of AsyncLROPoller that returns ServerDnsAlias. The ServerDnsAlias is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDnsAlias] = 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, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the server DNS alias with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerDnsAlias"]: + """Gets a list of server DNS aliases for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerDnsAlias + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerDnsAlias]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_dns_aliases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerDnsAlias], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _acquire_initial( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: Union[_models.ServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_dns_aliases_acquire_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: _models.ServerDnsAliasAcquisition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition + :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 ServerDnsAlias. The ServerDnsAlias is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerDnsAlias. The ServerDnsAlias is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: 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 ServerDnsAlias. The ServerDnsAlias is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: Union[_models.ServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ServerDnsAliasAcquisition, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerDnsAlias. The ServerDnsAlias is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerDnsAlias] = 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._acquire_initial( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ServerKeysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_keys` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: + """Gets a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :return: ServerKey. The ServerKey is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) + + _request = build_server_keys_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerKey, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: Union[_models.ServerKey, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_keys_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: _models.ServerKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerKey + :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 ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. 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 ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: Union[_models.ServerKey, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Is one of the following types: + ServerKey, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerKey or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerKey] = 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, + key_name=key_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerKey, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_keys_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the server key with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerKey"]: + """Gets a list of server keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerKey + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerKey]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_keys_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerKey], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerSecurityAlertPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ServerSecurityAlertPolicy: + """Get a server's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ServerSecurityAlertPolicy. The ServerSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_server_security_alert_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ServerSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy + :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 ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. 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 ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Is one of the following types: + ServerSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerSecurityAlertPolicy] = 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, + security_alert_policy_name=security_alert_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerSecurityAlertPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerSecurityAlertPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerSecurityAlertPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerSecurityAlertPolicy"]: + """Get the server's threat detection policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerSecurityAlertPolicy + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_security_alert_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerTrustCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_trust_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> _models.ServerTrustCertificate: + """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :return: ServerTrustCertificate. The ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) + + _request = build_server_trust_certificates_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerTrustCertificate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: Union[_models.ServerTrustCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_trust_certificates_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: _models.ServerTrustCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate + :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 ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. 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 ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: Union[_models.ServerTrustCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Is one of the following types: + ServerTrustCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerTrustCertificate] = 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, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerTrustCertificate, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerTrustCertificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerTrustCertificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_trust_certificates_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerTrustCertificate"]: + """Gets a list of the server trust certificates used to secure communication between SQL Server + and the specified SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerTrustCertificate + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_certificates_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustCertificate], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerVulnerabilityAssessmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Gets the server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_server_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.ServerVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.ServerVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + ServerVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment or JSON or IO[bytes] + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_server_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_vulnerability_assessments_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class StartStopManagedInstanceSchedulesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`start_stop_managed_instance_schedules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Gets the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) + + _request = build_start_stop_managed_instance_schedules_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StartStopManagedInstanceSchedule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: _models.StartStopManagedInstanceSchedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Required. + :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. 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: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: Union[_models.StartStopManagedInstanceSchedule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Is one of the following + types: StartStopManagedInstanceSchedule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule or JSON or IO[bytes] + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_start_stop_managed_instance_schedules_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StartStopManagedInstanceSchedule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + **kwargs: Any + ) -> None: + """Deletes the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_stop_managed_instance_schedules_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.StartStopManagedInstanceSchedule"]: + """Lists the managed instance's Start/Stop schedules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of StartStopManagedInstanceSchedule + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.StartStopManagedInstanceSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.StartStopManagedInstanceSchedule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_start_stop_managed_instance_schedules_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.StartStopManagedInstanceSchedule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SubscriptionUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`subscription_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: + """Gets a subscription usage metric. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param usage_name: Name of usage metric to return. Required. + :type usage_name: str + :return: SubscriptionUsage. The SubscriptionUsage is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SubscriptionUsage + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) + + _request = build_subscription_usages_get_request( + location_name=location_name, + usage_name=usage_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SubscriptionUsage, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.SubscriptionUsage"]: + """Gets all subscription usage metrics in a given location. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of SubscriptionUsage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SubscriptionUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SubscriptionUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subscription_usages_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SubscriptionUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SyncAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sync_agents` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> _models.SyncAgent: + """Gets a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: SyncAgent. The SyncAgent is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncAgent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) + + _request = build_sync_agents_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncAgent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: Union[_models.SyncAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_agents_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: _models.SyncAgent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncAgent + :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 SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. 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 SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: Union[_models.SyncAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Is one of the following types: + SyncAgent, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncAgent or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncAgent] = 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, + sync_agent_name=sync_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_agents_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncAgent"]: + """Lists sync agents in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of SyncAgent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncAgent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_agents_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncAgent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def generate_key( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> _models.SyncAgentKeyProperties: + """Generates a sync agent key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: SyncAgentKeyProperties. The SyncAgentKeyProperties is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) + + _request = build_sync_agents_generate_key_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncAgentKeyProperties, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_linked_databases( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncAgentLinkedDatabase"]: + """Lists databases linked to a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: An iterator like instance of SyncAgentLinkedDatabase + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgentLinkedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncAgentLinkedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_agents_list_linked_databases_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncAgentLinkedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SyncGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sync_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> _models.SyncGroup: + """Gets a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: SyncGroup. The SyncGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) + + _request = build_sync_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: _models.SyncGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup + :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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. 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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :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, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Is one of the following types: + SyncGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncGroup] = 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, + sync_group_name=sync_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncGroup]( + 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, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_groups_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: _models.SyncGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup + :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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. 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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Is one of the following types: + SyncGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncGroup] = 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, + sync_group_name=sync_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncGroup"]: + """Lists sync groups under a hub database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SyncGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel_sync( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Cancels a sync group synchronization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sync_groups_cancel_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_hub_schemas( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a collection of hub database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of SyncFullSchemaProperties + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncFullSchemaProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_hub_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncFullSchemaProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_logs( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + *, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SyncGroupLogProperties"]: + """Gets a collection of sync group logs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :keyword start_time: Get logs generated after this time. Required. + :paramtype start_time: str + :keyword end_time: Get logs generated before this time. Required. + :paramtype end_time: str + :keyword type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and + "Success". Required. + :paramtype type: str or ~azure.mgmt.sql.models.SyncGroupsType + :keyword continuation_token_parameter: The continuation token for this operation. Default value + is None. + :paramtype continuation_token_parameter: str + :return: An iterator like instance of SyncGroupLogProperties + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncGroupLogProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_logs_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + type=type, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncGroupLogProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _refresh_hub_schema_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_groups_refresh_hub_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_refresh_hub_schema( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.SyncGroup]: + """Refreshes a hub database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An instance of AsyncLROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncGroup] = 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_hub_schema_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace_async + async def trigger_sync( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Triggers a sync group synchronization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sync_groups_trigger_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_sync_database_ids( + self, location_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncDatabaseIdProperties"]: + """Gets a collection of sync database ids. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of SyncDatabaseIdProperties + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncDatabaseIdProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncDatabaseIdProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_sync_database_ids_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncDatabaseIdProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SyncMembersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sync_members` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> _models.SyncMember: + """Gets a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: SyncMember. The SyncMember is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) + + _request = build_sync_members_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncMember, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_members_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: _models.SyncMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember + :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 SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. 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 SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :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, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Is one of the following types: + SyncMember, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncMember] = 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, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncMember]( + 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, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_members_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: _models.SyncMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember + :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 SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. 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 SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Is one of the following types: + SyncMember, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncMember] = 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, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncMember]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_members_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_sync_group( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SyncMember"]: + """Lists sync members in the given sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of SyncMember + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncMember]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_members_list_by_sync_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncMember], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _refresh_member_schema_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_members_refresh_member_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_refresh_member_schema( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.SyncMember]: + """Refreshes a sync member database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An instance of AsyncLROPoller that returns SyncMember. The SyncMember is compatible + with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncMember] = 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_member_schema_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SyncMember]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_member_schemas( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a sync member database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An iterator like instance of SyncFullSchemaProperties + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncFullSchemaProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_members_list_member_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncFullSchemaProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TimeZonesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`time_zones` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: + """Gets a managed instance time zone. + + :param location_name: The location of the database. Required. + :type location_name: str + :param time_zone_id: The time zone ID. Required. + :type time_zone_id: str + :return: TimeZone. The TimeZone is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.TimeZone + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) + + _request = build_time_zones_get_request( + location_name=location_name, + time_zone_id=time_zone_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TimeZone, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.TimeZone"]: + """Gets a list of managed instance time zones by location. + + :param location_name: The location of the database. Required. + :type location_name: str + :return: An iterator like instance of TimeZone + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TimeZone] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TimeZone]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_time_zones_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TimeZone], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class VirtualClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`virtual_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: + """Gets a virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: VirtualCluster. The VirtualCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.VirtualCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_get_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VirtualCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_clusters_create_or_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster + :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 VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is one of the following types: + VirtualCluster, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_clusters_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate + :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 VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is one of the following types: + VirtualClusterUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns VirtualCluster. The VirtualCluster is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_delete_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.VirtualCluster"]: + """Gets a list of virtual clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of VirtualCluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> AsyncItemPaged["_models.VirtualCluster"]: + """Gets a list of all virtualClusters in the subscription. + + :return: An iterator like instance of VirtualCluster + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_clusters_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _update_dns_servers_initial( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_update_dns_servers_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_update_dns_servers( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.UpdateVirtualClusterDnsServersOperation]: + """Synchronizes the DNS server settings used by the managed instances inside the given virtual + cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: An instance of AsyncLROPoller that returns UpdateVirtualClusterDnsServersOperation. + The UpdateVirtualClusterDnsServersOperation is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateVirtualClusterDnsServersOperation, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.UpdateVirtualClusterDnsServersOperation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.UpdateVirtualClusterDnsServersOperation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualNetworkRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`virtual_network_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> _models.VirtualNetworkRule: + """Gets a virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :return: VirtualNetworkRule. The VirtualNetworkRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) + + _request = build_virtual_network_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VirtualNetworkRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: Union[_models.VirtualNetworkRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_network_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: _models.VirtualNetworkRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule + :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 VirtualNetworkRule. The VirtualNetworkRule + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns VirtualNetworkRule. The VirtualNetworkRule + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. 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 VirtualNetworkRule. The VirtualNetworkRule + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: Union[_models.VirtualNetworkRule, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Is one of the following + types: VirtualNetworkRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns VirtualNetworkRule. The VirtualNetworkRule + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkRule] = 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, + virtual_network_rule_name=virtual_network_rule_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualNetworkRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VirtualNetworkRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VirtualNetworkRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_network_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes the virtual network rule with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.VirtualNetworkRule"]: + """Gets a list of virtual network rules in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of VirtualNetworkRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualNetworkRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class WorkloadClassifiersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`workload_classifiers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> _models.WorkloadClassifier: + """Gets a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :return: WorkloadClassifier. The WorkloadClassifier is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.WorkloadClassifier + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) + + _request = build_workload_classifiers_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.WorkloadClassifier, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: Union[_models.WorkloadClassifier, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_workload_classifiers_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: _models.WorkloadClassifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier + :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 WorkloadClassifier. The WorkloadClassifier + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns WorkloadClassifier. The WorkloadClassifier + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. 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 WorkloadClassifier. The WorkloadClassifier + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :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, + workload_group_name: str, + workload_classifier_name: str, + parameters: Union[_models.WorkloadClassifier, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Is one of the following types: + WorkloadClassifier, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns WorkloadClassifier. The WorkloadClassifier + is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadClassifier] = 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, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.WorkloadClassifier, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.WorkloadClassifier].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.WorkloadClassifier]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_workload_classifiers_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_workload_group( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.WorkloadClassifier"]: + """Gets the list of workload classifiers for a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: An iterator like instance of WorkloadClassifier + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.WorkloadClassifier]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_workload_classifiers_list_by_workload_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.WorkloadClassifier], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class WorkloadGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`workload_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> _models.WorkloadGroup: + """Gets a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: WorkloadGroup. The WorkloadGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.WorkloadGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) + + _request = build_workload_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.WorkloadGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: Union[_models.WorkloadGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_workload_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: _models.WorkloadGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadGroup + :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 WorkloadGroup. The WorkloadGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns WorkloadGroup. The WorkloadGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. 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 WorkloadGroup. The WorkloadGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :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, + workload_group_name: str, + parameters: Union[_models.WorkloadGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Is one of the following types: + WorkloadGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadGroup or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns WorkloadGroup. The WorkloadGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadGroup] = 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, + workload_group_name=workload_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.WorkloadGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.WorkloadGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.WorkloadGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_workload_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = 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, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, 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._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.WorkloadGroup"]: + """Gets the list of workload groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of WorkloadGroup + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.WorkloadGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_workload_groups_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.WorkloadGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseSensitivityLabelsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Gets the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. Known values are: + "current" and "recommended". Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: _models.SensitivityLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. 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: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: Union[_models.SensitivityLabel, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Is one of the following types: + SensitivityLabel, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or JSON or IO[bytes] + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_sensitivity_labels_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Deletes the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def disable_recommendation( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_disable_recommendation_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace_async + async def enable_recommendation( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_enable_recommendation_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword count: Default value is None. + :paramtype count: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_current_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: SensitivityLabelUpdateList, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword include_disabled_recommendations: Specifies whether to include disabled + recommendations or not. Default value is None. + :paramtype include_disabled_recommendations: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_recommended_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseEncryptionProtectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _revalidate_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_revalidate( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Revalidates an existing encryption protector for a particular database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._revalidate_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _revert_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_encryption_protectors_revert_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_revert( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> AsyncLROPoller[_models.Database]: + """Reverts an existing encryption protector for a particular database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of AsyncLROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._revert_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DatabaseOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseOperation"]: + """Gets a list of operations performed on the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseOperation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_operations_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel( + self, resource_group_name: str, server_name: str, database_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_operations_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseUsage"]: + """Gets database usages. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseUsage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_usages_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class RecommendedSensitivityLabelsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`recommended_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.RecommendedSensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.RecommendedSensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: RecommendedSensitivityLabelUpdateList, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or JSON or + IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_recommended_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class SynapseLinkWorkspacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`synapse_link_workspaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SynapseLinkWorkspace"]: + """Gets all synapselink workspaces for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SynapseLinkWorkspace + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SynapseLinkWorkspace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SynapseLinkWorkspace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_synapse_link_workspaces_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SynapseLinkWorkspace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerOperation"]: + """Gets a list of operations performed on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerOperation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_operations_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerUsage"]: + """Gets server usages. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerUsage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_usages_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class TdeCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`tde_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_tde_certificates_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: _models.TdeCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Is one of the + following types: TdeCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Gets a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_database_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.DatabaseAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. 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: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.DatabaseAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Is one of the following + types: DatabaseAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection or JSON or IO[bytes] + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseAdvancedThreatProtection"]: + """Gets a list of database's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseAdvancedThreatProtection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_advanced_threat_protection_settings_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseAdvisorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_advisors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any + ) -> _models.Advisor: + """Gets a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + _request = build_database_advisors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: _models.Advisor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Advisor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. 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: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: Union[_models.Advisor, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Is one of the following types: + Advisor, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Advisor or JSON or IO[bytes] + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_advisors_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> List[_models.Advisor]: + """Gets a list of database advisors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: list of Advisor + :rtype: list[~azure.mgmt.sql.models.Advisor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) + + _request = build_database_advisors_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.Advisor], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseAutomaticTuningOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_automatic_tuning` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Gets a database's automatic tuning. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) + + _request = build_database_automatic_tuning_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.DatabaseAutomaticTuning, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. 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: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.DatabaseAutomaticTuning, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Is one of the following + types: DatabaseAutomaticTuning, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning or JSON or IO[bytes] + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_automatic_tuning_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_extensions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any + ) -> None: + """Gets a database extension. This will return resource not found as it is not supported. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_extensions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: Union[_models.DatabaseExtensions, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_extensions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: _models.DatabaseExtensions, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :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, + extension_name: str, + parameters: Union[_models.DatabaseExtensions, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Is one of the following types: + DatabaseExtensions, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ImportExportExtensionsOperationResult"]: + """List database extension. This will return an empty list as it is not supported. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ImportExportExtensionsOperationResult + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_extensions_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ImportExportExtensionsOperationResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseRecommendedActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_recommended_actions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + **kwargs: Any + ) -> _models.RecommendedAction: + """Gets a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + + _request = build_database_recommended_actions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + recommended_action_name=recommended_action_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecommendedAction, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: _models.RecommendedAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedAction + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. 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: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: Union[_models.RecommendedAction, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Is one of the following + types: RecommendedAction, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedAction or JSON or IO[bytes] + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_recommended_actions_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + recommended_action_name=recommended_action_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecommendedAction, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def list_by_database_advisor( + self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any + ) -> List[_models.RecommendedAction]: + """Gets list of Database Recommended Actions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :return: list of RecommendedAction + :rtype: list[~azure.mgmt.sql.models.RecommendedAction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) + + _request = build_database_recommended_actions_list_by_database_advisor_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.RecommendedAction], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes] Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or JSON or + IO[bytes] + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_sql_vulnerability_assessment_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessment( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentBaselineSet + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: JSON, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: IO[bytes], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes]], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes] Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or JSON or + IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessment_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessments_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Gets SQL Vulnerability Assessment policy for database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessments_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessment"]: + """Lists SQL Vulnerability Assessment policies associated with a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SqlVulnerabilityAssessment + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessments_settings_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_execute_scan` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _execute_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_execute_scan_execute_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_execute( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlVulnerabilityAssessment]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An instance of AsyncLROPoller that returns SqlVulnerabilityAssessment. The + SqlVulnerabilityAssessment is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = 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._execute_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SqlVulnerabilityAssessment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlVulnerabilityAssessment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_execute_scan` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _execute_initial( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_execute_scan_execute_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_execute( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> AsyncLROPoller[_models.SqlVulnerabilityAssessment]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An instance of AsyncLROPoller that returns SqlVulnerabilityAssessment. The + SqlVulnerabilityAssessment is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = 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._execute_initial( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + system_database_name=system_database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.SqlVulnerabilityAssessment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.SqlVulnerabilityAssessment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def delete( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanRecord: + """Get a database vulnerability assessment scan result. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: SqlVulnerabilityAssessmentScanRecord. The SqlVulnerabilityAssessmentScanRecord is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessments( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class DatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`database_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: VulnerabilityAssessmentScanRecord. The VulnerabilityAssessmentScanRecord is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> AsyncItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of VulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_vulnerability_assessment_scans_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentScansExport: + """Convert an existing scan result to a human readable format. If already exists nothing happens. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: DatabaseVulnerabilityAssessmentScansExport. The + DatabaseVulnerabilityAssessmentScansExport is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_export_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentScansExport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _initiate_scan_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_initiate_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_initiate_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: An instance of AsyncLROPoller that returns VulnerabilityAssessmentScanRecord. The + VulnerabilityAssessmentScanRecord is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = 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._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.VulnerabilityAssessmentScanRecord]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DataMaskingRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`data_masking_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + *, + skip: Optional[int] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.DataMaskingRule"]: + """Gets a list of database data masking rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of DataMaskingRule + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataMaskingRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataMaskingRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_data_masking_rules_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DataMaskingRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: _models.DataMaskingRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + 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: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: Union[_models.DataMaskingRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. Is one + of the following types: DataMaskingRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingRule or JSON or IO[bytes] + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_masking_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + data_masking_rule_name=data_masking_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DataWarehouseUserActivitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`data_warehouse_user_activities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + **kwargs: Any + ) -> _models.DataWarehouseUserActivities: + """Gets the user activities of a data warehouse which includes running and suspended queries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_warehouse_user_activity_name: The activity name of the data warehouse. "current" + Required. + :type data_warehouse_user_activity_name: str or + ~azure.mgmt.sql.models.DataWarehouseUserActivityName + :return: DataWarehouseUserActivities. The DataWarehouseUserActivities is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) + + _request = build_data_warehouse_user_activities_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_warehouse_user_activity_name=data_warehouse_user_activity_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataWarehouseUserActivities, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.DataWarehouseUserActivities"]: + """List the user activities of a data warehouse which includes running and suspended queries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DataWarehouseUserActivities + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DataWarehouseUserActivities] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataWarehouseUserActivities]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_data_warehouse_user_activities_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DataWarehouseUserActivities], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseSecurityEventsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_security_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.SecurityEvent"]: + """Gets a list of security events. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of SecurityEvent + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SecurityEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecurityEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_security_events_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip=skip, + top=top, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SecurityEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseRecommendedSensitivityLabelsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_recommended_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.RecommendedSensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.RecommendedSensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: RecommendedSensitivityLabelUpdateList, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or JSON or + IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_recommended_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedInstanceTdeCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_tde_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + async def _create_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_tde_certificates_create_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.TdeCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Is one of the + following types: TdeCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstance].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 + ) + + +class ElasticPoolOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`elastic_pool_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_elastic_pool( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ElasticPoolOperation"]: + """Gets a list of operations performed on the elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An iterator like instance of ElasticPoolOperation + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ElasticPoolOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ElasticPoolOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_elastic_pool_operations_list_by_elastic_pool_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ElasticPoolOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def cancel( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_elastic_pool_operations_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class UsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_instance_pool( + self, + resource_group_name: str, + instance_pool_name: str, + *, + expand_children: Optional[bool] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.Usage"]: + """Gets all instance pool usage metrics. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :keyword expand_children: Optional request parameter to include managed instance usages within + the instance pool. Default value is None. + :paramtype expand_children: bool + :return: An iterator like instance of Usage + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Usage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Usage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_usages_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + expand_children=expand_children, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Usage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class LedgerDigestUploadsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`ledger_digest_uploads` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> _models.LedgerDigestUploads: + """Gets the current ledger digest upload configuration for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :return: LedgerDigestUploads. The LedgerDigestUploads is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) + + _request = build_ledger_digest_uploads_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LedgerDigestUploads, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: Union[_models.LedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ledger_digest_uploads_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: _models.LedgerDigestUploads, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :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, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: Union[_models.LedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Is one of the following types: LedgerDigestUploads, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LedgerDigestUploads + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ledger_digest_uploads_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LedgerDigestUploads], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _disable_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ledger_digest_uploads_disable_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_disable( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> AsyncLROPoller[_models.LedgerDigestUploads]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :return: An instance of AsyncLROPoller that returns LedgerDigestUploads. The + LedgerDigestUploads is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LedgerDigestUploads, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LedgerDigestUploads].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LedgerDigestUploads]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class MaintenanceWindowOptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`maintenance_window_options` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + maintenance_window_options_name: str, + **kwargs: Any + ) -> _models.MaintenanceWindowOptions: + """Gets a list of available maintenance windows. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword maintenance_window_options_name: Maintenance window options name. Required. + :paramtype maintenance_window_options_name: str + :return: MaintenanceWindowOptions. The MaintenanceWindowOptions is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) + + _request = build_maintenance_window_options_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_options_name=maintenance_window_options_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceWindowOptions, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MaintenanceWindowsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`maintenance_windows` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + maintenance_window_name: str, + **kwargs: Any + ) -> _models.MaintenanceWindows: + """Gets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :return: MaintenanceWindows. The MaintenanceWindows is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.MaintenanceWindows + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) + + _request = build_maintenance_windows_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_name=maintenance_window_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceWindows, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.MaintenanceWindows, + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.MaintenanceWindows, JSON, IO[bytes]], + *, + maintenance_window_name: str, + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: MaintenanceWindows, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows or JSON or IO[bytes] + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_windows_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_name=maintenance_window_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedDatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Gets a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_managed_database_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ManagedDatabaseAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. 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: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedDatabaseAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Is one of the + following types: ManagedDatabaseAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection or JSON or + IO[bytes] + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabaseAdvancedThreatProtection"]: + """Gets a list of managed database's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedDatabaseAdvancedThreatProtection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_advanced_threat_protection_settings_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseMoveOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_move_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, location_name: str, operation_id: str, **kwargs: Any + ) -> _models.ManagedDatabaseMoveOperationResult: + """Gets a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param operation_id: The ID of the managed database move operation. Required. + :type operation_id: str + :return: ManagedDatabaseMoveOperationResult. The ManagedDatabaseMoveOperationResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) + + _request = build_managed_database_move_operations_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseMoveOperationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedDatabaseMoveOperationResult"]: + """Lists managed database move operations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest operation for each + database. Has higher priority than $filter. Default value is None. + :paramtype only_latest_per_database: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedDatabaseMoveOperationResult + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseMoveOperationResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_move_operations_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseMoveOperationResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseQueriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_queries` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, **kwargs: Any + ) -> _models.ManagedInstanceQuery: + """Get query by query id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param query_id: Required. + :type query_id: str + :return: ManagedInstanceQuery. The ManagedInstanceQuery is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) + + _request = build_managed_database_queries_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + query_id=query_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceQuery, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_query( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + query_id: str, + *, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + **kwargs: Any + ) -> AsyncItemPaged["_models.QueryStatistics"]: + """Get query execution statistics by query id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param query_id: Required. + :type query_id: str + :keyword start_time: Start time for observed period. Default value is None. + :paramtype start_time: str + :keyword end_time: End time for observed period. Default value is None. + :paramtype end_time: str + :keyword interval: The time step to be used to summarize the metric values. Known values are: + "PT1H" and "P1D". Default value is None. + :paramtype interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :return: An iterator like instance of QueryStatistics + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.QueryStatistics] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QueryStatistics]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_queries_list_by_query_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + query_id=query_id, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + interval=interval, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QueryStatistics], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedDatabaseRestoreDetailsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_restore_details` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + restore_details_name: Union[str, _models.RestoreDetailsName], + **kwargs: Any + ) -> _models.ManagedDatabaseRestoreDetailsResult: + """Gets managed database restore details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_details_name: The name of the restore details to retrieve. "Default" Required. + :type restore_details_name: str or ~azure.mgmt.sql.models.RestoreDetailsName + :return: ManagedDatabaseRestoreDetailsResult. The ManagedDatabaseRestoreDetailsResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) + + _request = build_managed_database_restore_details_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + restore_details_name=restore_details_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseRestoreDetailsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ManagedDatabaseTransparentDataEncryptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_database_transparent_data_encryption` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Gets a managed database's transparent data encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_managed_database_transparent_data_encryption_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: _models.ManagedTransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. 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: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.ManagedTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Is one of the following types: + ManagedTransparentDataEncryption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or JSON or IO[bytes] + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_transparent_data_encryption_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedTransparentDataEncryption"]: + """Gets a list of managed database's transparent data encryptions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedTransparentDataEncryption + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedTransparentDataEncryption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_transparent_data_encryption_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedTransparentDataEncryption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstanceAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ManagedInstanceAdvancedThreatProtection: + """Get a managed instance's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ManagedInstanceAdvancedThreatProtection. The ManagedInstanceAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_managed_instance_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ManagedInstanceAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection + :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 ManagedInstanceAdvancedThreatProtection. + The ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ManagedInstanceAdvancedThreatProtection. + The ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. 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 ManagedInstanceAdvancedThreatProtection. + The ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Is one of the + following types: ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns ManagedInstanceAdvancedThreatProtection. + The ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = 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, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAdvancedThreatProtection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedInstanceAdvancedThreatProtection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstanceAdvancedThreatProtection"]: + """Get the managed instance's Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAdvancedThreatProtection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_advanced_threat_protection_settings_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedInstancePrivateLinkResourcesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_instance_private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, group_name: str, **kwargs: Any + ) -> _models.ManagedInstancePrivateLink: + """Gets a private link resource for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: ManagedInstancePrivateLink. The ManagedInstancePrivateLink is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_link_resources_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstancePrivateLink, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedInstancePrivateLink"]: + """Gets the private link resources for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstancePrivateLink + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstancePrivateLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_private_link_resources_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstancePrivateLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ManagedLedgerDigestUploadsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`managed_ledger_digest_uploads` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> _models.ManagedLedgerDigestUploads: + """Gets the current ledger digest upload configuration for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :return: ManagedLedgerDigestUploads. The ManagedLedgerDigestUploads is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) + + _request = build_managed_ledger_digest_uploads_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedLedgerDigestUploads, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: Union[_models.ManagedLedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_ledger_digest_uploads_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: _models.ManagedLedgerDigestUploads, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads + :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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. 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 None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: Union[_models.ManagedLedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Is one of the following types: + ManagedLedgerDigestUploads, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns None + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ManagedLedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedLedgerDigestUploads + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_ledger_digest_uploads_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedLedgerDigestUploads], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _disable_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_ledger_digest_uploads_disable_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_disable( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> AsyncLROPoller[_models.ManagedLedgerDigestUploads]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :return: An instance of AsyncLROPoller that returns ManagedLedgerDigestUploads. The + ManagedLedgerDigestUploads is compatible with MutableMapping + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedLedgerDigestUploads] = 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._disable_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedLedgerDigestUploads, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ManagedLedgerDigestUploads].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ManagedLedgerDigestUploads]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ServerAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ServerAdvancedThreatProtection: + """Get a server's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ServerAdvancedThreatProtection. The ServerAdvancedThreatProtection is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_server_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ServerAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ServerAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection + :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 ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. 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 ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ServerAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Is one of the following types: + ServerAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection or JSON or IO[bytes] + :return: An instance of AsyncLROPoller that returns ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAdvancedThreatProtection] = 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, + advanced_threat_protection_name=advanced_threat_protection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAdvancedThreatProtection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.ServerAdvancedThreatProtection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.ServerAdvancedThreatProtection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.ServerAdvancedThreatProtection"]: + """Get a list of the server's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAdvancedThreatProtection + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_advanced_threat_protection_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + +class ServerAutomaticTuningOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`server_automatic_tuning` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerAutomaticTuning: + """Retrieves server automatic tuning options. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) + + _request = build_server_automatic_tuning_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ServerAutomaticTuning, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. 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: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerAutomaticTuning, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Is one of the following + types: ServerAutomaticTuning, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning or JSON or IO[bytes] + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_automatic_tuning_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SqlAgentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`sql_agent` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Gets current instance sql agent configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) + + _request = build_sql_agent_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlAgentConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.SqlAgentConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: 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: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace_async + async def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.SqlAgentConfiguration, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Is one of the following types: SqlAgentConfiguration, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration or JSON or IO[bytes] + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_agent_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlAgentConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class TransparentDataEncryptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`transparent_data_encryptions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> _models.LogicalDatabaseTransparentDataEncryption: + """Gets a logical database's transparent data encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: LogicalDatabaseTransparentDataEncryption. The LogicalDatabaseTransparentDataEncryption + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_transparent_data_encryptions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: _models.LogicalDatabaseTransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption + :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 LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of AsyncLROPoller that returns LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. 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 LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :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, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Is one of the following types: + LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or JSON or + IO[bytes] + :return: An instance of AsyncLROPoller that returns LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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, + tde_name=tde_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> AsyncItemPaged["_models.LogicalDatabaseTransparentDataEncryption"]: + """Gets a list of the logical database's transparent data encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LogicalDatabaseTransparentDataEncryption + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_transparent_data_encryptions_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + async def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LogicalDatabaseTransparentDataEncryption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + async def _resume_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_resume( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Resume ongoing logical database's Transparent Data Encryption scan configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of AsyncLROPoller that returns LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + async def _suspend_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_suspend_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_suspend( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Suspend ongoing logical database's Transparent Data Encryption scan configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of AsyncLROPoller that returns LogicalDatabaseTransparentDataEncryption. + The LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: AsyncPollingMethod = cast( + AsyncPollingMethod, AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class CapabilitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.aio.SqlClient`'s + :attr:`capabilities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace_async + async def list_by_location( + self, location_name: str, *, include: Optional[Union[str, _models.CapabilityGroup]] = None, **kwargs: Any + ) -> _models.LocationCapabilities: + """Gets the subscription capabilities available for the specified location. + + :param location_name: The location name whose capabilities are retrieved. Required. + :type location_name: str + :keyword include: If specified, restricts the response to only include the selected item. Known + values are: "supportedEditions", "supportedElasticPoolEditions", + "supportedManagedInstanceVersions", "supportedInstancePoolEditions", + "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. + :paramtype include: str or ~azure.mgmt.sql.models.CapabilityGroup + :return: LocationCapabilities. The LocationCapabilities is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LocationCapabilities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) + + _request = build_capabilities_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + include=include, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LocationCapabilities, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 deleted file mode 100644 index 937430ec97b8..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_outbound_firewall_rules_operations.py +++ /dev/null @@ -1,456 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._outbound_firewall_rules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class OutboundFirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`outbound_firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.OutboundFirewallRule"]: - """Gets all outbound firewall rules on a server. - - :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 - :return: An iterator like instance of either OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> _models.OutboundFirewallRule: - """Gets an outbound firewall rule. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :return: OutboundFirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("OutboundFirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> AsyncLROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :return: An instance of AsyncLROPoller that returns either OutboundFirewallRule or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRule] = 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, - outbound_rule_fqdn=outbound_rule_fqdn, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRule", pipeline_response.http_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.OutboundFirewallRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.OutboundFirewallRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_patch.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): 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 deleted file mode 100644 index a08b31993b9d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,547 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._private_endpoint_connections_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.PrivateEndpointConnection] - :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", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets a private endpoint connection. - - :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection - :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 PrivateEndpointConnection or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: 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 PrivateEndpointConnection or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection or IO[bytes] - :return: An instance of AsyncLROPoller that returns either PrivateEndpointConnection or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = 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, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_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.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py deleted file mode 100644 index 9bb6ff91f8d9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,207 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._private_link_resources_operations import build_get_request, build_list_by_server_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.PrivateLinkResource"]: - """Gets the private link resources for SQL server. - - :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 - :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.PrivateLinkResource] - :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", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, group_name: str, **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets a private link resource for SQL server. - - :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 group_name: The name of the private link resource. Required. - :type group_name: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("PrivateLinkResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7421a9b2ead3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recommended_sensitivity_labels_operations.py +++ /dev/null @@ -1,194 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._recommended_sensitivity_labels_operations import build_update_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RecommendedSensitivityLabelsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`recommended_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.RecommendedSensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.RecommendedSensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 parameters: Is either a RecommendedSensitivityLabelUpdateList type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "RecommendedSensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index b6c70c37c611..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_databases_operations.py +++ /dev/null @@ -1,220 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._recoverable_databases_operations import build_get_request, build_list_by_server_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RecoverableDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`recoverable_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RecoverableDatabase"]: - """Gets a list of recoverable databases. - - :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 - :return: An iterator like instance of either RecoverableDatabase or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RecoverableDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RecoverableDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.RecoverableDatabase: - """Gets a recoverable database. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: RecoverableDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecoverableDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecoverableDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b8a88ebd5f87..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_recoverable_managed_databases_operations.py +++ /dev/null @@ -1,209 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._recoverable_managed_databases_operations import build_get_request, build_list_by_instance_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RecoverableManagedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`recoverable_managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RecoverableManagedDatabase"]: - """Gets a list of recoverable managed databases. - - :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 iterator like instance of either RecoverableManagedDatabase or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RecoverableManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RecoverableManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, recoverable_database_name: str, **kwargs: Any - ) -> _models.RecoverableManagedDatabase: - """Gets a recoverable managed database. - - :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 recoverable_database_name: Required. - :type recoverable_database_name: str - :return: RecoverableManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - recoverable_database_name=recoverable_database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecoverableManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7dd6eb83f19b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_replication_links_operations.py +++ /dev/null @@ -1,1134 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -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, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ReplicationLinksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`replication_links` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ReplicationLink"]: - """Gets a list of replication links on database. - - :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 - :return: An iterator like instance of either ReplicationLink or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ReplicationLink] - :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", self._config.api_version)) - cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ReplicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> _models.ReplicationLink: - """Gets a replication link. - - :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: The name of the replication link. Required. - :type link_id: str - :return: ReplicationLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ReplicationLink - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ReplicationLink", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - link_id: str, - parameters: Union[_models.ReplicationLink, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the replication link. - - :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 - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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 - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ReplicationLink]: - """Fails over from the current primary server to this server. - - :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: The name of the replication link. Required. - :type link_id: 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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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_allow_data_loss_initial( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_allow_data_loss_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_failover_allow_data_loss( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ReplicationLink]: - """Fails over from the current primary server to this server allowing data loss. - - :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: The name of the replication link. Required. - :type link_id: 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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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 - ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ReplicationLink"]: - """Gets a list of replication links. - - :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 - :return: An iterator like instance of either ReplicationLink or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ReplicationLink] - :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", self._config.api_version)) - cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ReplicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 70d11d0b640a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py +++ /dev/null @@ -1,222 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._restorable_dropped_databases_operations import build_get_request, build_list_by_server_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RestorableDroppedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`restorable_dropped_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RestorableDroppedDatabase"]: - """Gets a list of restorable dropped databases. - - :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 - :return: An iterator like instance of either RestorableDroppedDatabase or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorableDroppedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RestorableDroppedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - restorable_dropped_database_id: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.RestorableDroppedDatabase: - """Gets a restorable dropped database. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: RestorableDroppedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorableDroppedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7f02590e306b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py +++ /dev/null @@ -1,212 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._restorable_dropped_managed_databases_operations import ( - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RestorableDroppedManagedDatabasesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`restorable_dropped_managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RestorableDroppedManagedDatabase"]: - """Gets a list of restorable dropped managed databases. - - :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 iterator like instance of either RestorableDroppedManagedDatabase or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorableDroppedManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RestorableDroppedManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> _models.RestorableDroppedManagedDatabase: - """Gets a restorable dropped managed database. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: RestorableDroppedManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorableDroppedManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 509944c98807..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restore_points_operations.py +++ /dev/null @@ -1,498 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._restore_points_operations import ( - build_create_request, - build_delete_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class RestorePointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`restore_points` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.RestorePoint"]: - """Gets a list of database restore points. - - :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 - :return: An iterator like instance of either RestorePoint or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.RestorePoint] - :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", self._config.api_version)) - cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("RestorePointListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _create_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CreateDatabaseRestorePointDefinition") - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.CreateDatabaseRestorePointDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. Required. - :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition - :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 RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. 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 RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. Is either a - CreateDatabaseRestorePointDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RestorePoint] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RestorePoint] = 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_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RestorePoint", pipeline_response.http_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.RestorePoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RestorePoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any - ) -> _models.RestorePoint: - """Gets a restore point. - - :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 restore_point_name: The name of the restore point. Required. - :type restore_point_name: str - :return: RestorePoint or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorePoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - restore_point_name=restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorePoint", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any - ) -> None: - """Deletes a restore point. - - :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 restore_point_name: The name of the restore point. Required. - :type restore_point_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - restore_point_name=restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 0264c68eea27..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sensitivity_labels_operations.py +++ /dev/null @@ -1,1017 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sensitivity_labels_operations import ( - build_create_or_update_request, - build_delete_request, - build_disable_recommendation_request, - build_enable_recommendation_request, - build_get_request, - build_list_by_database_request, - build_list_current_by_database_request, - build_list_recommended_by_database_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SensitivityLabelsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_recommended_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_recommended_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Gets the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param sensitivity_label_source: The source of the sensitivity label. Known values are: - "current" and "recommended". Required. - :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - sensitivity_label_source=sensitivity_label_source, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: _models.SensitivityLabel, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. 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: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: Union[_models.SensitivityLabel, IO[bytes]], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Is either a SensitivityLabel type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or IO[bytes] - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SensitivityLabel] = 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, "SensitivityLabel") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Deletes the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def disable_recommendation( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace_async - async def enable_recommendation( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index f9747ea0cdb9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,445 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_advanced_threat_protection_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerAdvancedThreatProtection"]: - """Get a list of the server's Advanced Threat Protection states. - - :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 - :return: An iterator like instance of either ServerAdvancedThreatProtection or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ServerAdvancedThreatProtection: - """Get a server's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ServerAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ServerAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection - :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 ServerAdvancedThreatProtection or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. 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 ServerAdvancedThreatProtection or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. Is either a - ServerAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerAdvancedThreatProtection or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAdvancedThreatProtection] = 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, - advanced_threat_protection_name=advanced_threat_protection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_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.ServerAdvancedThreatProtection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerAdvancedThreatProtection]( - 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/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py deleted file mode 100644 index cd88a42beb63..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_advisors_operations.py +++ /dev/null @@ -1,330 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_advisors_operations import ( - build_get_request, - build_list_by_server_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerAdvisorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_advisors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def list_by_server( - self, resource_group_name: str, server_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> List[_models.Advisor]: - """Gets a list of server advisors. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: list of Advisor or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.Advisor] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[Advisor]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any - ) -> _models.Advisor: - """Gets a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: _models.Advisor, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. 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: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: Union[_models.Advisor, IO[bytes]], - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Is either a Advisor type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor or IO[bytes] - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Advisor] = 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, "Advisor") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7a94f94fca20..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_automatic_tuning_operations.py +++ /dev/null @@ -1,247 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_automatic_tuning_operations import build_get_request, build_update_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerAutomaticTuningOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_automatic_tuning` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerAutomaticTuning: - """Retrieves server automatic tuning options. - - :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 - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerAutomaticTuning, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. 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: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerAutomaticTuning, IO[bytes]], - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. Is either a - ServerAutomaticTuning type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning or IO[bytes] - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAutomaticTuning] = 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, "ServerAutomaticTuning") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 4541e5366a4b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_administrators_operations.py +++ /dev/null @@ -1,565 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_azure_ad_administrators_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerAzureADAdministratorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_azure_ad_administrators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerAzureADAdministrator"]: - """Gets a list of Azure Active Directory administrators in a server. - - :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 - :return: An iterator like instance of either ServerAzureADAdministrator or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", self._config.api_version)) - cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> _models.ServerAzureADAdministrator: - """Gets a Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :return: ServerAzureADAdministrator or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAzureADAdministrator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: _models.ServerAzureADAdministrator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator - :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 ServerAzureADAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. 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 ServerAzureADAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. Is either - a ServerAzureADAdministrator type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerAzureADAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAzureADAdministrator] = 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, - administrator_name=administrator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_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.ServerAzureADAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerAzureADAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the Azure Active Directory administrator with the given name. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index f23b5d26cc73..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_azure_ad_only_authentications_operations.py +++ /dev/null @@ -1,574 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_azure_ad_only_authentications_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_azure_ad_only_authentications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 - :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", self._config.api_version)) - cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> _models.ServerAzureADOnlyAuthentication: - """Gets a specific Azure Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :return: ServerAzureADOnlyAuthentication or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAzureADOnlyAuthentication") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: _models.ServerAzureADOnlyAuthentication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication - :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 ServerAzureADOnlyAuthentication or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. 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 ServerAzureADOnlyAuthentication or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Is either a ServerAzureADOnlyAuthentication type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerAzureADOnlyAuthentication or - the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAzureADOnlyAuthentication] = 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, - authentication_name=authentication_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_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.ServerAzureADOnlyAuthentication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerAzureADOnlyAuthentication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing server Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py deleted file mode 100644 index b2d808691870..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_blob_auditing_policies_operations.py +++ /dev/null @@ -1,419 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Literal, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_blob_auditing_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerBlobAuditingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerBlobAuditingPolicy"]: - """Lists auditing settings of a server. - - :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 - :return: An iterator like instance of either ServerBlobAuditingPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: - """Gets a server's blob auditing policy. - - :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 - :return: ServerBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy - :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 ServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. 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 ServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. Is either a ServerBlobAuditingPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerBlobAuditingPolicy] = 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, - parameters=parameters, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_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.ServerBlobAuditingPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerBlobAuditingPolicy]( - 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/_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py deleted file mode 100644 index 919741680d5a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_configuration_options_operations.py +++ /dev/null @@ -1,438 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_configuration_options_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_managed_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerConfigurationOptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_configuration_options` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerConfigurationOption"]: - """Gets a list of managed instance server configuration options. - - :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 iterator like instance of either ServerConfigurationOption or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConfigurationOption] - :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", self._config.api_version)) - cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConfigurationOptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - **kwargs: Any - ) -> _models.ServerConfigurationOption: - """Gets managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :return: ServerConfigurationOption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerConfigurationOption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: Union[_models.ServerConfigurationOption, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerConfigurationOption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: _models.ServerConfigurationOption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption - :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 ServerConfigurationOption or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option 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 ServerConfigurationOption or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: Union[_models.ServerConfigurationOption, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option parameters. Is either a - ServerConfigurationOption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerConfigurationOption or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerConfigurationOption] = 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, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerConfigurationOption", pipeline_response.http_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.ServerConfigurationOption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerConfigurationOption]( - 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/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py deleted file mode 100644 index 2f0da0edf488..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py +++ /dev/null @@ -1,433 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_connection_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerConnectionPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_connection_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerConnectionPolicy"]: - """Lists connection policy. - - :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 - :return: An iterator like instance of either ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - **kwargs: Any - ) -> _models.ServerConnectionPolicy: - """Gets a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :return: ServerConnectionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - connection_policy_name=connection_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerConnectionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerConnectionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - connection_policy_name=connection_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: _models.ServerConnectionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy - :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 ServerConnectionPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. 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 ServerConnectionPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. Is either a - ServerConnectionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerConnectionPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerConnectionPolicy] = 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, - connection_policy_name=connection_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicy", pipeline_response.http_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.ServerConnectionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerConnectionPolicy]( - 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/_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 deleted file mode 100644 index 24e69b564160..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dev_ops_audit_settings_operations.py +++ /dev/null @@ -1,437 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_dev_ops_audit_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerDevOpsAuditSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_dev_ops_audit_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerDevOpsAuditingSettings"]: - """Lists DevOps audit settings of a server. - - :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 - :return: An iterator like instance of either ServerDevOpsAuditingSettings or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDevOpsAuditSettingsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - **kwargs: Any - ) -> _models.ServerDevOpsAuditingSettings: - """Gets a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :return: ServerDevOpsAuditingSettings or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerDevOpsAuditingSettings") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: _models.ServerDevOpsAuditingSettings, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings - :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 ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. 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 ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. Is either a - ServerDevOpsAuditingSettings type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerDevOpsAuditingSettings] = 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, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_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": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ServerDevOpsAuditingSettings].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerDevOpsAuditingSettings]( - 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/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py deleted file mode 100644 index c233202e3855..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_dns_aliases_operations.py +++ /dev/null @@ -1,668 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_dns_aliases_operations import ( - build_acquire_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerDnsAliasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_dns_aliases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerDnsAlias"]: - """Gets a list of server DNS aliases for a server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> _models.ServerDnsAlias: - """Gets a server DNS alias. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :return: ServerDnsAlias or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerDnsAlias - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerDnsAlias", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDnsAlias]: - """Creates a server DNS alias. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :return: An instance of AsyncLROPoller that returns either ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDnsAlias] = 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, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_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.ServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the server DNS alias with the given name. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _acquire_initial( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerDnsAliasAcquisition") - - _request = build_acquire_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: _models.ServerDnsAliasAcquisition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition - :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 ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: 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 ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :param parameters: Is either a ServerDnsAliasAcquisition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerDnsAlias] = 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._acquire_initial( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_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.ServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerDnsAlias]( - 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/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py deleted file mode 100644 index 7418d592a876..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_keys_operations.py +++ /dev/null @@ -1,553 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_keys_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerKeysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_keys` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerKey"]: - """Gets a list of server keys. - - :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 - :return: An iterator like instance of either ServerKey or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerKey] - :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", self._config.api_version)) - cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerKeyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: - """Gets a server key. - - :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 key_name: The name of the server key to be retrieved. Required. - :type key_name: str - :return: ServerKey or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerKey - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerKey", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: Union[_models.ServerKey, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerKey") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: _models.ServerKey, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerKey - :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 ServerKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. 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 ServerKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: Union[_models.ServerKey, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. Is either a ServerKey type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerKey or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerKey or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerKey] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerKey] = 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, - key_name=key_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerKey", pipeline_response.http_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.ServerKey].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerKey]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the server key with the given name. - - :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 key_name: The name of the server key to be deleted. Required. - :type key_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py deleted file mode 100644 index dc9744f5950f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_operations_operations.py +++ /dev/null @@ -1,142 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_operations_operations import build_list_by_server_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerOperation"]: - """Gets a list of operations performed on the server. - - :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 - :return: An iterator like instance of either ServerOperation or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 3a5e72df000a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py +++ /dev/null @@ -1,438 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_security_alert_policies_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerSecurityAlertPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerSecurityAlertPolicy"]: - """Get the server's threat detection policies. - - :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 - :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - **kwargs: Any - ) -> _models.ServerSecurityAlertPolicy: - """Get a server's security alert policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :return: ServerSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: _models.ServerSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy - :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 ServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. 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 ServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerSecurityAlertPolicy] = 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, - security_alert_policy_name=security_alert_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_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.ServerSecurityAlertPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerSecurityAlertPolicy]( - 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/_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py deleted file mode 100644 index f45b0cf7664f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_certificates_operations.py +++ /dev/null @@ -1,548 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_trust_certificates_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerTrustCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_trust_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerTrustCertificate"]: - """Gets a list of the server trust certificates used to secure communication between SQL Server - and the specified SQL Managed Instance. - - :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 iterator like instance of either ServerTrustCertificate or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustCertificate] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustCertificatesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> _models.ServerTrustCertificate: - """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to get. Required. - :type certificate_name: str - :return: ServerTrustCertificate or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerTrustCertificate", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: Union[_models.ServerTrustCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerTrustCertificate") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: _models.ServerTrustCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate - :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 ServerTrustCertificate or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. 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 ServerTrustCertificate or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: Union[_models.ServerTrustCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. Is either a ServerTrustCertificate type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerTrustCertificate or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerTrustCertificate] = 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, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerTrustCertificate", pipeline_response.http_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.ServerTrustCertificate].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerTrustCertificate]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to delete. Required. - :type certificate_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py deleted file mode 100644 index 2cf01606f91c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_trust_groups_operations.py +++ /dev/null @@ -1,634 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_trust_groups_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, - build_list_by_location_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerTrustGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_trust_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerTrustGroup"]: - """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> _models.ServerTrustGroup: - """Gets a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :return: ServerTrustGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerTrustGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerTrustGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: Union[_models.ServerTrustGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerTrustGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: _models.ServerTrustGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup - :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 ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group 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 ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: Union[_models.ServerTrustGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group parameters. Is either a ServerTrustGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerTrustGroup] = 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, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerTrustGroup", pipeline_response.http_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.ServerTrustGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ServerTrustGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerTrustGroup"]: - """Gets a server trust groups by instance name. - - :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 iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 720193881cc5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_usages_operations.py +++ /dev/null @@ -1,142 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_usages_operations import build_list_by_server_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerUsage"]: - """Gets server usages. - - :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 - :return: An iterator like instance of either ServerUsage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerUsage] - :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", self._config.api_version)) - cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 6b2e726db273..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_vulnerability_assessments_operations.py +++ /dev/null @@ -1,443 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._server_vulnerability_assessments_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServerVulnerabilityAssessmentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`server_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.ServerVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a server. - - :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 - :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Gets the server's vulnerability assessment. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.ServerVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.ServerVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a ServerVulnerabilityAssessment type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment or IO[bytes] - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerVulnerabilityAssessment] = 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, "ServerVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the server's vulnerability assessment. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index d8c48c4e5f7d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_servers_operations.py +++ /dev/null @@ -1,1229 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._servers_operations import ( - build_check_name_availability_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_import_database_request, - build_list_by_resource_group_request, - build_list_request, - build_refresh_status_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class ServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def check_name_availability( - self, parameters: _models.CheckNameAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def check_name_availability( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability 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: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def check_name_availability( - self, parameters: Union[_models.CheckNameAvailabilityRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability request parameters. Is either a - CheckNameAvailabilityRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest or IO[bytes] - :return: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResponse] = 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, "CheckNameAvailabilityRequest") - - _request = build_check_name_availability_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("CheckNameAvailabilityResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, expand: Optional[str] = None, **kwargs: Any) -> AsyncItemPaged["_models.Server"]: - """Gets a list of all servers in the subscription. - - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either Server or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Server"]: - """Gets a list of servers in a resource groups. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either Server or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.Server: - """Gets a server. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: Server or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Server - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Server] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Server", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Server") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.Server, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Server - :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 Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. 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 Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. Is either a Server type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.Server or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Server] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Server", pipeline_response.http_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.Server].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Server]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> AsyncLROPoller[None]: - """Deletes a server. - - :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 - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - parameters: Union[_models.ServerUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerUpdate - :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 Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. 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 Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. Is either a ServerUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either Server or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Server] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Server", pipeline_response.http_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.Server].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.Server]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _import_database_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ImportNewDatabaseDefinition") - - _request = build_import_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ImportNewDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition - :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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import 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 ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Is either a - ImportNewDatabaseDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ImportExportOperationResult or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._import_database_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ImportExportOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _refresh_status_initial( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_status_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh_status( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResult]: - """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 server_name: The name of the server. Required. - :type server_name: str - :return: An instance of AsyncLROPoller that returns either - RefreshExternalGovernanceStatusOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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, - server_name=server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "RefreshExternalGovernanceStatusOperationResult", pipeline_response.http_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.RefreshExternalGovernanceStatusOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.RefreshExternalGovernanceStatusOperationResult]( - 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/_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py deleted file mode 100644 index f82c52885509..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_agent_operations.py +++ /dev/null @@ -1,248 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_agent_operations import build_create_or_update_request, build_get_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlAgentOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_agent` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Gets current instance sql agent configuration. - - :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: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) - - _request = build_get_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.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]: - 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 = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.SqlAgentConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 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: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.SqlAgentConfiguration, IO[bytes]], - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 parameters: Is either a SqlAgentConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration or IO[bytes] - :return: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlAgentConfiguration] = 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, "SqlAgentConfiguration") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index bd375ae6375a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baseline_operations.py +++ /dev/null @@ -1,241 +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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_baseline_operations import ( - build_get_request, - build_list_by_sql_vulnerability_assessment_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentBaselineOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_baseline` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessment( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentBaselineSet or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessment_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 2b66d42ff890..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_baselines_operations.py +++ /dev/null @@ -1,219 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_baselines_operations import build_create_or_update_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 8be3bf13e420..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ /dev/null @@ -1,191 +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 collections.abc import MutableMapping -from typing import Any, AsyncIterator, Callable, Literal, Optional, TypeVar, Union, cast - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_execute_scan_operations import build_execute_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_execute_scan` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _execute_initial( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_execute_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_execute( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :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 {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._execute_initial( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - system_database_name=system_database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_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 deleted file mode 100644 index 237773960c33..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ /dev/null @@ -1,425 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_rule_baseline_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_baseline_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentRuleBaselineOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_rule_baseline` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_baseline( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> AsyncItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: - """Gets a system database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentRuleBaseline or - the result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_baseline_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Gets a system database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineInput type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or - IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 85a0033bfc3c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,130 +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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_rule_baselines_operations import build_delete_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 244d37864704..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ /dev/null @@ -1,249 +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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_scan_result_operations import ( - build_get_request, - build_list_by_scan_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_scan_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_scan( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanResults or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanResults: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :param scan_result_id: The scan result id of the specific result to retrieve. Required. - :type scan_result_id: str - :return: SqlVulnerabilityAssessmentScanResults or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - scan_result_id=scan_result_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0c47ac926430..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,237 +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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessment_scans_operations import ( - build_get_request, - build_list_by_sql_vulnerability_assessments_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessments( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanRecord or the result - of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessments_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanRecord: - """Get a system database vulnerability assessment scan record. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: Required. - :type scan_id: str - :return: SqlVulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index ae72c57967c7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_operations.py +++ /dev/null @@ -1,118 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessments_operations import build_delete_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes SQL Vulnerability Assessment. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 29221ecf790d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sql_vulnerability_assessments_settings_operations.py +++ /dev/null @@ -1,367 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sql_vulnerability_assessments_settings_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sql_vulnerability_assessments_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SqlVulnerabilityAssessment"]: - """Lists SQL Vulnerability Assessment policies associated with a server. - - :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 - :return: An iterator like instance of either SqlVulnerabilityAssessment or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Gets SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.SqlVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.SqlVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a SqlVulnerabilityAssessment type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment or IO[bytes] - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = 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, "SqlVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7e967fd254ae..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_start_stop_managed_instance_schedules_operations.py +++ /dev/null @@ -1,432 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._start_stop_managed_instance_schedules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_instance_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class StartStopManagedInstanceSchedulesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`start_stop_managed_instance_schedules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.StartStopManagedInstanceSchedule"]: - """Lists the managed instance's Start/Stop schedules. - - :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 iterator like instance of either StartStopManagedInstanceSchedule or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.StartStopManagedInstanceSchedule] - :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", self._config.api_version)) - cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("StartStopManagedInstanceScheduleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Gets the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: _models.StartStopManagedInstanceSchedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. Required. - :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. 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: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: Union[_models.StartStopManagedInstanceSchedule, IO[bytes]], - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. Is either a - StartStopManagedInstanceSchedule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule or IO[bytes] - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StartStopManagedInstanceSchedule] = 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, "StartStopManagedInstanceSchedule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def delete( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - **kwargs: Any - ) -> None: - """Deletes the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index a555b8171da2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_subscription_usages_operations.py +++ /dev/null @@ -1,195 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._subscription_usages_operations import build_get_request, build_list_by_location_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SubscriptionUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`subscription_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.SubscriptionUsage"]: - """Gets all subscription usage metrics in a given location. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either SubscriptionUsage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SubscriptionUsage] - :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", self._config.api_version)) - cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SubscriptionUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: - """Gets a subscription usage metric. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param usage_name: Name of usage metric to return. Required. - :type usage_name: str - :return: SubscriptionUsage or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SubscriptionUsage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - usage_name=usage_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SubscriptionUsage", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index ea9021bd1de1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_synapse_link_workspaces_operations.py +++ /dev/null @@ -1,146 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._synapse_link_workspaces_operations import build_list_by_database_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SynapseLinkWorkspacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`synapse_link_workspaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SynapseLinkWorkspace"]: - """Gets all synapselink workspaces for a database. - - :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 - :return: An iterator like instance of either SynapseLinkWorkspace or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SynapseLinkWorkspace] - :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", self._config.api_version)) - cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SynapseLinkWorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 92a35b6971a6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_agents_operations.py +++ /dev/null @@ -1,703 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sync_agents_operations import ( - build_create_or_update_request, - build_delete_request, - build_generate_key_request, - build_get_request, - build_list_by_server_request, - build_list_linked_databases_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SyncAgentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sync_agents` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncAgent"]: - """Lists sync agents in a server. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :return: An iterator like instance of either SyncAgent or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgent] - :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", self._config.api_version)) - cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> _models.SyncAgent: - """Gets a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: SyncAgent or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncAgent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncAgent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: Union[_models.SyncAgent, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncAgent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: _models.SyncAgent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncAgent - :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 SyncAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. 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 SyncAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: Union[_models.SyncAgent, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. Is either a SyncAgent type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncAgent or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SyncAgent or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncAgent] = 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, - sync_agent_name=sync_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncAgent", pipeline_response.http_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.SyncAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SyncAgent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def generate_key( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> _models.SyncAgentKeyProperties: - """Generates a sync agent key. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: SyncAgentKeyProperties or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) - - _request = build_generate_key_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncAgentKeyProperties", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_linked_databases( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncAgentLinkedDatabase"]: - """Lists databases linked to a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: An iterator like instance of either SyncAgentLinkedDatabase or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncAgentLinkedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_linked_databases_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentLinkedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index d190eec21c19..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py +++ /dev/null @@ -1,1344 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sync_groups_operations import ( - build_cancel_sync_request, - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_database_request, - build_list_hub_schemas_request, - build_list_logs_request, - build_list_sync_database_ids_request, - build_refresh_hub_schema_request, - build_trigger_sync_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SyncGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sync_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_sync_database_ids( - self, location_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncDatabaseIdProperties"]: - """Gets a collection of sync database ids. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either SyncDatabaseIdProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncDatabaseIdProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sync_database_ids_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncDatabaseIdListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncGroup"]: - """Lists sync groups under a hub database. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :return: An iterator like instance of either SyncGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> _models.SyncGroup: - """Gets a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: _models.SyncGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup - :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 SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. 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 SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :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, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Is either a SyncGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncGroup] = 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, - sync_group_name=sync_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncGroup", pipeline_response.http_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.SyncGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SyncGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncGroup") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: _models.SyncGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup - :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 SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. 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 SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Is either a SyncGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SyncGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncGroup] = 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, - sync_group_name=sync_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncGroup", pipeline_response.http_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.SyncGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SyncGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def cancel_sync( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Cancels a sync group synchronization. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_hub_schemas( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a collection of hub database schemas. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_hub_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_logs( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, - **kwargs: Any - ) -> AsyncItemPaged["_models.SyncGroupLogProperties"]: - """Gets a collection of sync group logs. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param start_time: Get logs generated after this time. Required. - :type start_time: str - :param end_time: Get logs generated before this time. Required. - :type end_time: str - :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and - "Success". Required. - :type type: str or ~azure.mgmt.sql.models.SyncGroupsType - :param continuation_token_parameter: The continuation token for this operation. Default value - is None. - :type continuation_token_parameter: str - :return: An iterator like instance of either SyncGroupLogProperties or the result of - cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_logs_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - type=type, - continuation_token_parameter=continuation_token_parameter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _refresh_hub_schema_initial( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_hub_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh_hub_schema( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes a hub database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", self._config.api_version)) - 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._refresh_hub_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def trigger_sync( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Triggers a sync group synchronization. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_trigger_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 6de7f2f52303..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_members_operations.py +++ /dev/null @@ -1,1099 +0,0 @@ -# pylint: disable=too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._sync_members_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_sync_group_request, - build_list_member_schemas_request, - build_refresh_member_schema_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class SyncMembersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`sync_members` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sync_group( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.SyncMember"]: - """Lists sync members in the given sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncMember or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sync_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncMemberListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> _models.SyncMember: - """Gets a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: SyncMember or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncMember - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncMember", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncMember") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: _models.SyncMember, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember - :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 SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. 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 SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :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, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Is either a SyncMember type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncMember] = 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, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncMember", pipeline_response.http_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.SyncMember].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SyncMember]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - 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, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncMember") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: _models.SyncMember, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember - :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 SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. 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 SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Is either a SyncMember type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SyncMember or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncMember] = 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, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncMember", pipeline_response.http_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.SyncMember].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.SyncMember]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _refresh_member_schema_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_member_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_refresh_member_schema( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :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", self._config.api_version)) - 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._refresh_member_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_member_schemas( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> AsyncItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_member_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 1eb0745635d9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_tde_certificates_operations.py +++ /dev/null @@ -1,251 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload - -from azure.core import AsyncPipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._tde_certificates_operations import build_create_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class TdeCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`tde_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - async def _create_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TdeCertificate") - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: _models.TdeCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Is either a - TdeCertificate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._create_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py deleted file mode 100644 index de604ced2993..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_time_zones_operations.py +++ /dev/null @@ -1,195 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._time_zones_operations import build_get_request, build_list_by_location_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class TimeZonesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`time_zones` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> AsyncItemPaged["_models.TimeZone"]: - """Gets a list of managed instance time zones by location. - - :param location_name: Required. - :type location_name: str - :return: An iterator like instance of either TimeZone or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TimeZone] - :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", self._config.api_version)) - cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("TimeZoneListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: - """Gets a managed instance time zone. - - :param location_name: Required. - :type location_name: str - :param time_zone_id: Required. - :type time_zone_id: str - :return: TimeZone or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TimeZone - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - time_zone_id=time_zone_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("TimeZone", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0eedb328ec41..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py +++ /dev/null @@ -1,748 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._transparent_data_encryptions_operations import ( - build_create_or_update_request, - build_get_request, - build_list_by_database_request, - build_resume_request, - build_suspend_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class TransparentDataEncryptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`transparent_data_encryptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.LogicalDatabaseTransparentDataEncryption"]: - """Gets a list of the logical database's transparent data encryption. - - :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 logical database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryption or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> _models.LogicalDatabaseTransparentDataEncryption: - """Gets a logical database's transparent data encryption. - - :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 logical database for which the transparent data - encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LogicalDatabaseTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LogicalDatabaseTransparentDataEncryption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: _models.LogicalDatabaseTransparentDataEncryption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Required. - :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption - :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 - LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. 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 - LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Is either a - LogicalDatabaseTransparentDataEncryption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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, - tde_name=tde_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _resume_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_resume( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Resume ongoing logical database's Transparent Data Encryption scan configuration. - - :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 logical database for which the Transparent Data - Encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: An instance of AsyncLROPoller that returns either - LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _suspend_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_suspend_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_suspend( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Suspend ongoing logical database's Transparent Data Encryption scan configuration. - - :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 logical database for which the Transparent Data - Encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: An instance of AsyncLROPoller that returns either - LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - 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/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py deleted file mode 100644 index 029b220cc2a8..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_usages_operations.py +++ /dev/null @@ -1,146 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._usages_operations import build_list_by_instance_pool_request -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class UsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, expand_children: Optional[bool] = None, **kwargs: Any - ) -> AsyncItemPaged["_models.Usage"]: - """Gets all instance pool usage metrics. - - :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 instance_pool_name: The name of the instance pool to be retrieved. Required. - :type instance_pool_name: str - :param expand_children: Optional request parameter to include managed instance usages within - the instance pool. Default value is None. - :type expand_children: bool - :return: An iterator like instance of either Usage or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.Usage] - :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", self._config.api_version)) - cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - expand_children=expand_children, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("UsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 02c27ea09ea1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_clusters_operations.py +++ /dev/null @@ -1,923 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._virtual_clusters_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_resource_group_request, - build_list_request, - build_update_dns_servers_request, - build_update_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class VirtualClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`virtual_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncItemPaged["_models.VirtualCluster"]: - """Gets a list of all virtualClusters in the subscription. - - :return: An iterator like instance of either VirtualCluster or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.VirtualCluster"]: - """Gets a list of virtual clusters in a resource 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 - :return: An iterator like instance of either VirtualCluster or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: - """Gets a virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :return: VirtualCluster or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VirtualCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VirtualCluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualCluster, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: _models.VirtualCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualCluster - :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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualCluster, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Is either a VirtualCluster - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualCluster or IO[bytes] - :return: An instance of AsyncLROPoller that returns either VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualCluster] = 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, - virtual_cluster_name=virtual_cluster_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.VirtualCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _update_initial( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualClusterUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: _models.VirtualClusterUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate - :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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Is either a - VirtualClusterUpdate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualCluster] = 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, - virtual_cluster_name=virtual_cluster_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.VirtualCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_dns_servers_initial( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_update_dns_servers_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_update_dns_servers( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.UpdateVirtualClusterDnsServersOperation]: - """Synchronizes the DNS server settings used by the managed instances inside the given virtual - cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :return: An instance of AsyncLROPoller that returns either - UpdateVirtualClusterDnsServersOperation or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation] - :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", self._config.api_version)) - cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("UpdateVirtualClusterDnsServersOperation", pipeline_response.http_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.UpdateVirtualClusterDnsServersOperation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.UpdateVirtualClusterDnsServersOperation]( - 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/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py deleted file mode 100644 index 33014a11d7ce..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_virtual_network_rules_operations.py +++ /dev/null @@ -1,546 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._virtual_network_rules_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_server_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class VirtualNetworkRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`virtual_network_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.VirtualNetworkRule"]: - """Gets a list of virtual network rules in a server. - - :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 - :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> _models.VirtualNetworkRule: - """Gets a virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :return: VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VirtualNetworkRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: Union[_models.VirtualNetworkRule, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualNetworkRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: _models.VirtualNetworkRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule - :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 VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. 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 VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: Union[_models.VirtualNetworkRule, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Is either a - VirtualNetworkRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule or IO[bytes] - :return: An instance of AsyncLROPoller that returns either VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkRule] = 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, - virtual_network_rule_name=virtual_network_rule_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRule", pipeline_response.http_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.VirtualNetworkRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.VirtualNetworkRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes the virtual network rule with the given name. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py deleted file mode 100644 index d325230fa315..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_classifiers_operations.py +++ /dev/null @@ -1,617 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._workload_classifiers_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_workload_group_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class WorkloadClassifiersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`workload_classifiers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_workload_group( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.WorkloadClassifier"]: - """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the - classifiers from. Required. - :type workload_group_name: str - :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] - :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", self._config.api_version)) - cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_workload_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> _models.WorkloadClassifier: - """Gets a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier. Required. - :type workload_classifier_name: str - :return: WorkloadClassifier or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.WorkloadClassifier - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("WorkloadClassifier", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: Union[_models.WorkloadClassifier, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "WorkloadClassifier") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: _models.WorkloadClassifier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier - :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 WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. 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 WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :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, - workload_group_name: str, - workload_classifier_name: str, - parameters: Union[_models.WorkloadClassifier, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. Is either a WorkloadClassifier - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier or IO[bytes] - :return: An instance of AsyncLROPoller that returns either WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadClassifier] = 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, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadClassifier", pipeline_response.http_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.WorkloadClassifier].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.WorkloadClassifier]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to delete. Required. - :type workload_classifier_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](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/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py deleted file mode 100644 index 000f5f09074c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_workload_groups_operations.py +++ /dev/null @@ -1,568 +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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, AsyncIterator, Callable, IO, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import AsyncPipelineClient -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ..._utils.serialization import Deserializer, Serializer -from ...operations._workload_groups_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_list_by_database_request, -) -from .._configuration import SqlManagementClientConfiguration - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, dict[str, Any]], Any]] -List = list - - -class WorkloadGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.aio.SqlManagementClient`'s - :attr:`workload_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: AsyncPipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> AsyncItemPaged["_models.WorkloadGroup"]: - """Gets the list of workload groups. - - :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 - :return: An iterator like instance of either WorkloadGroup or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.WorkloadGroup] - :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", self._config.api_version)) - cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> _models.WorkloadGroup: - """Gets a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :return: WorkloadGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.WorkloadGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("WorkloadGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: Union[_models.WorkloadGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "WorkloadGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: _models.WorkloadGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadGroup - :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 WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. 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 WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :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, - workload_group_name: str, - parameters: Union[_models.WorkloadGroup, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. Is either a WorkloadGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadGroup or IO[bytes] - :return: An instance of AsyncLROPoller that returns either WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadGroup] = 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, - workload_group_name=workload_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadGroup", pipeline_response.http_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.WorkloadGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.WorkloadGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes a workload 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 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 workload_group_name: The name of the workload group to delete. Required. - :type workload_group_name: str - :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", self._config.api_version)) - 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._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 a70ba9ec1923..169240af1c2f 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 @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -14,15 +14,19 @@ from ._patch import * # pylint: disable=unused-wildcard-import -from ._models_py3 import ( # type: ignore - AdministratorListResult, +from ._models import ( # type: ignore + AdministratorProperties, + AdvancedThreatProtectionProperties, Advisor, + AdvisorProperties, + ArmSystemData, AutoPauseDelayTimeRange, AutomaticTuningOptions, AutomaticTuningServerOptions, - AzureADOnlyAuthListResult, + AutomaticTuningServerProperties, + AzureADOnlyAuthProperties, BackupShortTermRetentionPolicy, - BackupShortTermRetentionPolicyListResult, + BackupShortTermRetentionPolicyProperties, Baseline, BaselineAdjustedResult, BenchmarkReference, @@ -32,69 +36,78 @@ CheckNameAvailabilityResponse, CompleteDatabaseRestoreDefinition, CopyLongTermRetentionBackupParameters, + CopyLongTermRetentionBackupParametersProperties, CreateDatabaseRestorePointDefinition, DataMaskingPolicy, + DataMaskingPolicyProperties, DataMaskingRule, - DataMaskingRuleListResult, + DataMaskingRuleProperties, + DataSyncParticipantIdentity, + DataSyncParticipantUserAssignedIdentity, DataWarehouseUserActivities, - DataWarehouseUserActivitiesListResult, + DataWarehouseUserActivitiesProperties, Database, DatabaseAdvancedThreatProtection, - DatabaseAdvancedThreatProtectionListResult, DatabaseAutomaticTuning, + DatabaseAutomaticTuningProperties, DatabaseBlobAuditingPolicy, - DatabaseBlobAuditingPolicyListResult, + DatabaseBlobAuditingPolicyProperties, DatabaseColumn, - DatabaseColumnListResult, + DatabaseColumnProperties, DatabaseExtensions, + DatabaseExtensionsProperties, DatabaseIdentity, DatabaseKey, - DatabaseListResult, DatabaseOperation, - DatabaseOperationListResult, + DatabaseOperationProperties, + DatabaseProperties, DatabaseSchema, - DatabaseSchemaListResult, - DatabaseSecurityAlertListResult, DatabaseSecurityAlertPolicy, DatabaseSqlVulnerabilityAssessmentBaselineSet, - DatabaseSqlVulnerabilityAssessmentBaselineSetListResult, + DatabaseSqlVulnerabilityAssessmentBaselineSetProperties, DatabaseSqlVulnerabilityAssessmentRuleBaseline, DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties, DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, - DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult, + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties, + DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties, DatabaseTable, - DatabaseTableListResult, + DatabaseTableProperties, DatabaseUpdate, + DatabaseUpdateProperties, DatabaseUsage, - DatabaseUsageListResult, + DatabaseUsageProperties, DatabaseUserIdentity, DatabaseVulnerabilityAssessment, - DatabaseVulnerabilityAssessmentListResult, + DatabaseVulnerabilityAssessmentProperties, DatabaseVulnerabilityAssessmentRuleBaseline, DatabaseVulnerabilityAssessmentRuleBaselineItem, + DatabaseVulnerabilityAssessmentRuleBaselineProperties, + DatabaseVulnerabilityAssessmentScanExportProperties, DatabaseVulnerabilityAssessmentScansExport, DeletedServer, - DeletedServerListResult, + DeletedServerProperties, DistributedAvailabilityGroup, DistributedAvailabilityGroupDatabase, + DistributedAvailabilityGroupProperties, DistributedAvailabilityGroupSetRole, DistributedAvailabilityGroupsFailoverRequest, - DistributedAvailabilityGroupsListResult, EditionCapability, ElasticPool, ElasticPoolEditionCapability, - ElasticPoolListResult, ElasticPoolOperation, - ElasticPoolOperationListResult, + ElasticPoolOperationProperties, ElasticPoolPerDatabaseMaxPerformanceLevelCapability, ElasticPoolPerDatabaseMinPerformanceLevelCapability, ElasticPoolPerDatabaseSettings, ElasticPoolPerformanceLevelCapability, + ElasticPoolProperties, ElasticPoolUpdate, + ElasticPoolUpdateProperties, EncryptionProtector, - EncryptionProtectorListResult, + EncryptionProtectorProperties, EndpointCertificate, - EndpointCertificateListResult, + EndpointCertificateProperties, EndpointDependency, EndpointDetail, ErrorAdditionalInfo, @@ -102,158 +115,152 @@ ErrorResponse, ExportDatabaseDefinition, ExtendedDatabaseBlobAuditingPolicy, - ExtendedDatabaseBlobAuditingPolicyListResult, + ExtendedDatabaseBlobAuditingPolicyProperties, ExtendedServerBlobAuditingPolicy, - ExtendedServerBlobAuditingPolicyListResult, + ExtendedServerBlobAuditingPolicyProperties, FailoverGroup, - FailoverGroupListResult, + FailoverGroupProperties, FailoverGroupReadOnlyEndpoint, FailoverGroupReadWriteEndpoint, FailoverGroupUpdate, + FailoverGroupUpdateProperties, FirewallRule, FirewallRuleList, - FirewallRuleListResult, FreeLimitExhaustionBehaviorCapability, GeoBackupPolicy, - GeoBackupPolicyListResult, + GeoBackupPolicyProperties, IPv6FirewallRule, - IPv6FirewallRuleListResult, + IPv6ServerFirewallRuleProperties, ImportExistingDatabaseDefinition, - ImportExportExtensionsOperationListResult, ImportExportExtensionsOperationResult, + ImportExportExtensionsOperationResultProperties, ImportExportOperationResult, + ImportExportOperationResultProperties, ImportNewDatabaseDefinition, InstanceFailoverGroup, - InstanceFailoverGroupListResult, + InstanceFailoverGroupProperties, InstanceFailoverGroupReadOnlyEndpoint, InstanceFailoverGroupReadWriteEndpoint, InstancePool, InstancePoolEditionCapability, InstancePoolFamilyCapability, - InstancePoolListResult, InstancePoolOperation, - InstancePoolOperationListResult, + InstancePoolOperationProperties, + InstancePoolProperties, InstancePoolUpdate, InstancePoolVcoresCapability, Job, JobAgent, JobAgentEditionCapability, JobAgentIdentity, - JobAgentListResult, + JobAgentProperties, JobAgentServiceLevelObjectiveCapability, JobAgentUpdate, JobAgentUserAssignedIdentity, JobAgentVersionCapability, JobCredential, - JobCredentialListResult, + JobCredentialProperties, JobExecution, - JobExecutionListResult, + JobExecutionProperties, JobExecutionTarget, - JobListResult, JobPrivateEndpoint, - JobPrivateEndpointListResult, + JobPrivateEndpointProperties, + JobProperties, JobSchedule, JobStep, JobStepAction, JobStepExecutionOptions, - JobStepListResult, JobStepOutput, + JobStepProperties, JobTarget, JobTargetGroup, - JobTargetGroupListResult, + JobTargetGroupProperties, JobVersion, - JobVersionListResult, LedgerDigestUploads, - LedgerDigestUploadsListResult, + LedgerDigestUploadsProperties, LicenseTypeCapability, LocationCapabilities, LogSizeCapability, LogicalDatabaseTransparentDataEncryption, - LogicalDatabaseTransparentDataEncryptionListResult, - LogicalServerAdvancedThreatProtectionListResult, - LogicalServerSecurityAlertPolicyListResult, LongTermRetentionBackup, - LongTermRetentionBackupListResult, LongTermRetentionBackupOperationResult, + LongTermRetentionBackupProperties, + LongTermRetentionOperationResultProperties, LongTermRetentionPolicy, - LongTermRetentionPolicyListResult, + LongTermRetentionPolicyProperties, MaintenanceConfigurationCapability, MaintenanceWindowOptions, + MaintenanceWindowOptionsProperties, MaintenanceWindowTimeRange, MaintenanceWindows, + MaintenanceWindowsProperties, ManagedBackupShortTermRetentionPolicy, - ManagedBackupShortTermRetentionPolicyListResult, + ManagedBackupShortTermRetentionPolicyProperties, ManagedDatabase, ManagedDatabaseAdvancedThreatProtection, - ManagedDatabaseAdvancedThreatProtectionListResult, ManagedDatabaseExtendedAccessibilityInfo, - ManagedDatabaseListResult, ManagedDatabaseMoveDefinition, - ManagedDatabaseMoveOperationListResult, ManagedDatabaseMoveOperationResult, + ManagedDatabaseMoveOperationResultProperties, + ManagedDatabaseProperties, ManagedDatabaseRestoreDetailsBackupSetProperties, + ManagedDatabaseRestoreDetailsProperties, ManagedDatabaseRestoreDetailsResult, ManagedDatabaseRestoreDetailsUnrestorableFileProperties, ManagedDatabaseSecurityAlertPolicy, - ManagedDatabaseSecurityAlertPolicyListResult, ManagedDatabaseStartMoveDefinition, ManagedDatabaseUpdate, ManagedInstance, ManagedInstanceAdministrator, - ManagedInstanceAdministratorListResult, + ManagedInstanceAdministratorProperties, ManagedInstanceAdvancedThreatProtection, - ManagedInstanceAdvancedThreatProtectionListResult, - ManagedInstanceAzureADOnlyAuthListResult, + ManagedInstanceAzureADOnlyAuthProperties, ManagedInstanceAzureADOnlyAuthentication, ManagedInstanceDtc, - ManagedInstanceDtcListResult, + ManagedInstanceDtcProperties, ManagedInstanceDtcSecuritySettings, ManagedInstanceDtcTransactionManagerCommunicationSettings, ManagedInstanceEditionCapability, ManagedInstanceEncryptionProtector, - ManagedInstanceEncryptionProtectorListResult, + ManagedInstanceEncryptionProtectorProperties, ManagedInstanceExternalAdministrator, ManagedInstanceFamilyCapability, ManagedInstanceKey, - ManagedInstanceKeyListResult, - ManagedInstanceListResult, + ManagedInstanceKeyProperties, ManagedInstanceLongTermRetentionBackup, - ManagedInstanceLongTermRetentionBackupListResult, + ManagedInstanceLongTermRetentionBackupProperties, ManagedInstanceLongTermRetentionPolicy, - ManagedInstanceLongTermRetentionPolicyListResult, + ManagedInstanceLongTermRetentionPolicyProperties, ManagedInstanceMaintenanceConfigurationCapability, ManagedInstanceOperation, - ManagedInstanceOperationListResult, ManagedInstanceOperationParametersPair, + ManagedInstanceOperationProperties, ManagedInstanceOperationSteps, ManagedInstancePairInfo, ManagedInstancePecProperty, ManagedInstancePrivateEndpointConnection, - ManagedInstancePrivateEndpointConnectionListResult, ManagedInstancePrivateEndpointConnectionProperties, ManagedInstancePrivateEndpointProperty, ManagedInstancePrivateLink, - ManagedInstancePrivateLinkListResult, ManagedInstancePrivateLinkProperties, ManagedInstancePrivateLinkServiceConnectionStateProperty, + ManagedInstanceProperties, ManagedInstanceQuery, - ManagedInstanceQueryStatistics, ManagedInstanceUpdate, ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, ManagedInstanceVcoresCapability, ManagedInstanceVersionCapability, ManagedInstanceVulnerabilityAssessment, - ManagedInstanceVulnerabilityAssessmentListResult, + ManagedInstanceVulnerabilityAssessmentProperties, ManagedLedgerDigestUploads, - ManagedLedgerDigestUploadsListResult, + ManagedLedgerDigestUploadsProperties, ManagedServerDnsAlias, ManagedServerDnsAliasAcquisition, ManagedServerDnsAliasCreation, - ManagedServerDnsAliasListResult, + ManagedServerDnsAliasProperties, ManagedServerSecurityAlertPolicy, - ManagedServerSecurityAlertPolicyListResult, ManagedTransparentDataEncryption, - ManagedTransparentDataEncryptionListResult, + ManagedTransparentDataEncryptionProperties, MaxLimitRangeCapability, MaxSizeCapability, MaxSizeRangeCapability, @@ -268,182 +275,187 @@ NSPProvisioningIssueProperties, Name, NetworkIsolationSettings, - NetworkIsolationSettingsAutoGenerated, NetworkSecurityPerimeterConfiguration, - NetworkSecurityPerimeterConfigurationListResult, + NetworkSecurityPerimeterConfigurationProperties, Operation, OperationDisplay, - OperationListResult, OutboundEnvironmentEndpoint, - OutboundEnvironmentEndpointCollection, OutboundFirewallRule, - OutboundFirewallRuleListResult, + OutboundFirewallRuleProperties, PartnerInfo, PartnerRegionInfo, PerDatabaseAutoPauseDelayTimeRange, PerformanceLevelCapability, PhaseDetails, PrivateEndpointConnection, - PrivateEndpointConnectionListResult, PrivateEndpointConnectionProperties, PrivateEndpointConnectionRequestStatus, PrivateEndpointProperty, PrivateLinkResource, - PrivateLinkResourceListResult, PrivateLinkResourceProperties, PrivateLinkServiceConnectionStateProperty, ProxyResource, + ProxyResourceAutoGenerated, ProxyResourceWithWritableName, QueryCheck, QueryMetricInterval, QueryMetricProperties, + QueryProperties, QueryStatistics, QueryStatisticsProperties, ReadScaleCapability, RecommendedAction, - RecommendedActionAutoGenerated, RecommendedActionErrorInfo, RecommendedActionImpactRecord, RecommendedActionImplementationInfo, RecommendedActionMetricInfo, + RecommendedActionProperties, RecommendedActionStateInfo, RecommendedSensitivityLabelUpdate, RecommendedSensitivityLabelUpdateList, + RecommendedSensitivityLabelUpdateProperties, RecoverableDatabase, - RecoverableDatabaseListResult, + RecoverableDatabaseProperties, RecoverableManagedDatabase, - RecoverableManagedDatabaseListResult, + RecoverableManagedDatabaseProperties, RefreshExternalGovernanceStatusOperationResult, RefreshExternalGovernanceStatusOperationResultMI, + RefreshExternalGovernanceStatusOperationResultProperties, + RefreshExternalGovernanceStatusOperationResultPropertiesMI, Remediation, ReplicationLink, - ReplicationLinkListResult, + ReplicationLinkProperties, ReplicationLinkUpdate, + ReplicationLinkUpdateProperties, Resource, + ResourceAutoGenerated, ResourceIdentity, ResourceMoveDefinition, ResourceWithWritableName, RestorableDroppedDatabase, - RestorableDroppedDatabaseListResult, + RestorableDroppedDatabaseProperties, RestorableDroppedManagedDatabase, - RestorableDroppedManagedDatabaseListResult, + RestorableDroppedManagedDatabaseProperties, RestorePoint, - RestorePointListResult, - SQLVulnerabilityAssessmentScanListResult, + RestorePointProperties, ScheduleItem, + SecurityAlertPolicyProperties, + SecurityAlertsPolicyProperties, SecurityEvent, - SecurityEventCollection, + SecurityEventProperties, SecurityEventSqlInjectionAdditionalProperties, - SecurityEventsFilterParameters, SensitivityLabel, - SensitivityLabelListResult, + SensitivityLabelProperties, SensitivityLabelUpdate, SensitivityLabelUpdateList, + SensitivityLabelUpdateProperties, Server, ServerAdvancedThreatProtection, ServerAutomaticTuning, ServerAzureADAdministrator, ServerAzureADOnlyAuthentication, ServerBlobAuditingPolicy, - ServerBlobAuditingPolicyListResult, + ServerBlobAuditingPolicyProperties, ServerConfigurationOption, - ServerConfigurationOptionListResult, + ServerConfigurationOptionProperties, ServerConnectionPolicy, - ServerConnectionPolicyListResult, - ServerDevOpsAuditSettingsListResult, + ServerConnectionPolicyProperties, + ServerDevOpsAuditSettingsProperties, ServerDevOpsAuditingSettings, ServerDnsAlias, ServerDnsAliasAcquisition, - ServerDnsAliasListResult, + ServerDnsAliasProperties, ServerExternalAdministrator, + ServerFirewallRuleProperties, ServerInfo, ServerKey, - ServerKeyListResult, - ServerListResult, + ServerKeyProperties, ServerOperation, - ServerOperationListResult, + ServerOperationProperties, ServerPrivateEndpointConnection, + ServerProperties, ServerSecurityAlertPolicy, ServerTrustCertificate, - ServerTrustCertificatesListResult, + ServerTrustCertificateProperties, ServerTrustGroup, - ServerTrustGroupListResult, + ServerTrustGroupProperties, ServerUpdate, ServerUsage, - ServerUsageListResult, + ServerUsageProperties, ServerVersionCapability, ServerVulnerabilityAssessment, - ServerVulnerabilityAssessmentListResult, + ServerVulnerabilityAssessmentProperties, ServiceObjectiveCapability, ServicePrincipal, Sku, SqlAgentConfiguration, + SqlAgentConfigurationProperties, SqlVulnerabilityAssessment, - SqlVulnerabilityAssessmentListResult, + SqlVulnerabilityAssessmentPolicyProperties, SqlVulnerabilityAssessmentScanError, SqlVulnerabilityAssessmentScanRecord, - SqlVulnerabilityAssessmentScanRecordListResult, + SqlVulnerabilityAssessmentScanRecordProperties, + SqlVulnerabilityAssessmentScanResultProperties, SqlVulnerabilityAssessmentScanResults, StartStopManagedInstanceSchedule, - StartStopManagedInstanceScheduleListResult, + StartStopManagedInstanceScheduleProperties, StorageCapability, SubscriptionUsage, - SubscriptionUsageListResult, + SubscriptionUsageProperties, SynapseLinkWorkspace, SynapseLinkWorkspaceInfoProperties, - SynapseLinkWorkspaceListResult, + SynapseLinkWorkspaceProperties, SyncAgent, SyncAgentKeyProperties, SyncAgentLinkedDatabase, - SyncAgentLinkedDatabaseListResult, - SyncAgentListResult, - SyncDatabaseIdListResult, + SyncAgentLinkedDatabaseProperties, + SyncAgentProperties, SyncDatabaseIdProperties, SyncFullSchemaProperties, - SyncFullSchemaPropertiesListResult, SyncFullSchemaTable, SyncFullSchemaTableColumn, SyncGroup, - SyncGroupListResult, - SyncGroupLogListResult, SyncGroupLogProperties, + SyncGroupProperties, SyncGroupSchema, SyncGroupSchemaTable, SyncGroupSchemaTableColumn, SyncMember, - SyncMemberListResult, + SyncMemberProperties, SystemData, TdeCertificate, + TdeCertificateProperties, TimeZone, - TimeZoneListResult, + TimeZoneProperties, TopQueries, - TopQueriesListResult, TrackedResource, + TransparentDataEncryptionProperties, UpdateLongTermRetentionBackupParameters, + UpdateLongTermRetentionBackupParametersProperties, UpdateVirtualClusterDnsServersOperation, UpsertManagedServerOperationParameters, UpsertManagedServerOperationStepWithEstimatesAndDuration, Usage, - UsageListResult, UserIdentity, VaRule, VirtualCluster, - VirtualClusterListResult, + VirtualClusterDnsServersProperties, + VirtualClusterProperties, VirtualClusterUpdate, VirtualNetworkRule, - VirtualNetworkRuleListResult, + VirtualNetworkRuleProperties, VulnerabilityAssessmentRecurringScansProperties, VulnerabilityAssessmentScanError, VulnerabilityAssessmentScanRecord, - VulnerabilityAssessmentScanRecordListResult, + VulnerabilityAssessmentScanRecordProperties, WorkloadClassifier, - WorkloadClassifierListResult, + WorkloadClassifierProperties, WorkloadGroup, - WorkloadGroupListResult, + WorkloadGroupProperties, ZonePinningCapability, ) -from ._sql_management_client_enums import ( # type: ignore +from ._enums import ( # type: ignore AdministratorName, AdministratorType, AdvancedThreatProtectionName, @@ -465,21 +477,26 @@ BackupStorageAccessTier, BackupStorageRedundancy, BaselineName, + BlobAuditingPolicyName, BlobAuditingPolicyState, CapabilityGroup, CapabilityStatus, CatalogCollationType, CheckNameAvailabilityReason, + CheckNameAvailabilityResourceType, ClientClassificationSource, ColumnDataType, ConnectionPolicyName, CreateMode, CreatedByType, + CreatedByType, + CurrentSensitivityLabelSource, DNSRefreshOperationStatus, DataMaskingFunction, DataMaskingPolicyName, DataMaskingRuleState, DataMaskingState, + DataSyncParticipantIdentityType, DataWarehouseUserActivityName, DatabaseIdentityType, DatabaseKeyType, @@ -559,6 +576,7 @@ ReadWriteEndpointFailoverPolicy, RecommendedActionCurrentState, RecommendedActionInitiatedBy, + RecommendedSensitivityLabelSource, RecommendedSensitivityLabelUpdateKind, ReplicaConnectedState, ReplicaSynchronizationHealth, @@ -577,7 +595,6 @@ SecondaryInstanceType, SecondaryType, SecurityAlertPolicyName, - SecurityAlertPolicyNameAutoGenerated, SecurityAlertPolicyState, SecurityAlertsPolicyState, SecurityEventType, @@ -622,20 +639,25 @@ VulnerabilityAssessmentPolicyBaselineName, VulnerabilityAssessmentScanState, VulnerabilityAssessmentScanTriggerType, + VulnerabilityAssessmentSystemDatabaseName, ) from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ - "AdministratorListResult", + "AdministratorProperties", + "AdvancedThreatProtectionProperties", "Advisor", + "AdvisorProperties", + "ArmSystemData", "AutoPauseDelayTimeRange", "AutomaticTuningOptions", "AutomaticTuningServerOptions", - "AzureADOnlyAuthListResult", + "AutomaticTuningServerProperties", + "AzureADOnlyAuthProperties", "BackupShortTermRetentionPolicy", - "BackupShortTermRetentionPolicyListResult", + "BackupShortTermRetentionPolicyProperties", "Baseline", "BaselineAdjustedResult", "BenchmarkReference", @@ -645,69 +667,78 @@ "CheckNameAvailabilityResponse", "CompleteDatabaseRestoreDefinition", "CopyLongTermRetentionBackupParameters", + "CopyLongTermRetentionBackupParametersProperties", "CreateDatabaseRestorePointDefinition", "DataMaskingPolicy", + "DataMaskingPolicyProperties", "DataMaskingRule", - "DataMaskingRuleListResult", + "DataMaskingRuleProperties", + "DataSyncParticipantIdentity", + "DataSyncParticipantUserAssignedIdentity", "DataWarehouseUserActivities", - "DataWarehouseUserActivitiesListResult", + "DataWarehouseUserActivitiesProperties", "Database", "DatabaseAdvancedThreatProtection", - "DatabaseAdvancedThreatProtectionListResult", "DatabaseAutomaticTuning", + "DatabaseAutomaticTuningProperties", "DatabaseBlobAuditingPolicy", - "DatabaseBlobAuditingPolicyListResult", + "DatabaseBlobAuditingPolicyProperties", "DatabaseColumn", - "DatabaseColumnListResult", + "DatabaseColumnProperties", "DatabaseExtensions", + "DatabaseExtensionsProperties", "DatabaseIdentity", "DatabaseKey", - "DatabaseListResult", "DatabaseOperation", - "DatabaseOperationListResult", + "DatabaseOperationProperties", + "DatabaseProperties", "DatabaseSchema", - "DatabaseSchemaListResult", - "DatabaseSecurityAlertListResult", "DatabaseSecurityAlertPolicy", "DatabaseSqlVulnerabilityAssessmentBaselineSet", - "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult", + "DatabaseSqlVulnerabilityAssessmentBaselineSetProperties", "DatabaseSqlVulnerabilityAssessmentRuleBaseline", "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties", "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", - "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult", + "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties", + "DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties", "DatabaseTable", - "DatabaseTableListResult", + "DatabaseTableProperties", "DatabaseUpdate", + "DatabaseUpdateProperties", "DatabaseUsage", - "DatabaseUsageListResult", + "DatabaseUsageProperties", "DatabaseUserIdentity", "DatabaseVulnerabilityAssessment", - "DatabaseVulnerabilityAssessmentListResult", + "DatabaseVulnerabilityAssessmentProperties", "DatabaseVulnerabilityAssessmentRuleBaseline", "DatabaseVulnerabilityAssessmentRuleBaselineItem", + "DatabaseVulnerabilityAssessmentRuleBaselineProperties", + "DatabaseVulnerabilityAssessmentScanExportProperties", "DatabaseVulnerabilityAssessmentScansExport", "DeletedServer", - "DeletedServerListResult", + "DeletedServerProperties", "DistributedAvailabilityGroup", "DistributedAvailabilityGroupDatabase", + "DistributedAvailabilityGroupProperties", "DistributedAvailabilityGroupSetRole", "DistributedAvailabilityGroupsFailoverRequest", - "DistributedAvailabilityGroupsListResult", "EditionCapability", "ElasticPool", "ElasticPoolEditionCapability", - "ElasticPoolListResult", "ElasticPoolOperation", - "ElasticPoolOperationListResult", + "ElasticPoolOperationProperties", "ElasticPoolPerDatabaseMaxPerformanceLevelCapability", "ElasticPoolPerDatabaseMinPerformanceLevelCapability", "ElasticPoolPerDatabaseSettings", "ElasticPoolPerformanceLevelCapability", + "ElasticPoolProperties", "ElasticPoolUpdate", + "ElasticPoolUpdateProperties", "EncryptionProtector", - "EncryptionProtectorListResult", + "EncryptionProtectorProperties", "EndpointCertificate", - "EndpointCertificateListResult", + "EndpointCertificateProperties", "EndpointDependency", "EndpointDetail", "ErrorAdditionalInfo", @@ -715,158 +746,152 @@ "ErrorResponse", "ExportDatabaseDefinition", "ExtendedDatabaseBlobAuditingPolicy", - "ExtendedDatabaseBlobAuditingPolicyListResult", + "ExtendedDatabaseBlobAuditingPolicyProperties", "ExtendedServerBlobAuditingPolicy", - "ExtendedServerBlobAuditingPolicyListResult", + "ExtendedServerBlobAuditingPolicyProperties", "FailoverGroup", - "FailoverGroupListResult", + "FailoverGroupProperties", "FailoverGroupReadOnlyEndpoint", "FailoverGroupReadWriteEndpoint", "FailoverGroupUpdate", + "FailoverGroupUpdateProperties", "FirewallRule", "FirewallRuleList", - "FirewallRuleListResult", "FreeLimitExhaustionBehaviorCapability", "GeoBackupPolicy", - "GeoBackupPolicyListResult", + "GeoBackupPolicyProperties", "IPv6FirewallRule", - "IPv6FirewallRuleListResult", + "IPv6ServerFirewallRuleProperties", "ImportExistingDatabaseDefinition", - "ImportExportExtensionsOperationListResult", "ImportExportExtensionsOperationResult", + "ImportExportExtensionsOperationResultProperties", "ImportExportOperationResult", + "ImportExportOperationResultProperties", "ImportNewDatabaseDefinition", "InstanceFailoverGroup", - "InstanceFailoverGroupListResult", + "InstanceFailoverGroupProperties", "InstanceFailoverGroupReadOnlyEndpoint", "InstanceFailoverGroupReadWriteEndpoint", "InstancePool", "InstancePoolEditionCapability", "InstancePoolFamilyCapability", - "InstancePoolListResult", "InstancePoolOperation", - "InstancePoolOperationListResult", + "InstancePoolOperationProperties", + "InstancePoolProperties", "InstancePoolUpdate", "InstancePoolVcoresCapability", "Job", "JobAgent", "JobAgentEditionCapability", "JobAgentIdentity", - "JobAgentListResult", + "JobAgentProperties", "JobAgentServiceLevelObjectiveCapability", "JobAgentUpdate", "JobAgentUserAssignedIdentity", "JobAgentVersionCapability", "JobCredential", - "JobCredentialListResult", + "JobCredentialProperties", "JobExecution", - "JobExecutionListResult", + "JobExecutionProperties", "JobExecutionTarget", - "JobListResult", "JobPrivateEndpoint", - "JobPrivateEndpointListResult", + "JobPrivateEndpointProperties", + "JobProperties", "JobSchedule", "JobStep", "JobStepAction", "JobStepExecutionOptions", - "JobStepListResult", "JobStepOutput", + "JobStepProperties", "JobTarget", "JobTargetGroup", - "JobTargetGroupListResult", + "JobTargetGroupProperties", "JobVersion", - "JobVersionListResult", "LedgerDigestUploads", - "LedgerDigestUploadsListResult", + "LedgerDigestUploadsProperties", "LicenseTypeCapability", "LocationCapabilities", "LogSizeCapability", "LogicalDatabaseTransparentDataEncryption", - "LogicalDatabaseTransparentDataEncryptionListResult", - "LogicalServerAdvancedThreatProtectionListResult", - "LogicalServerSecurityAlertPolicyListResult", "LongTermRetentionBackup", - "LongTermRetentionBackupListResult", "LongTermRetentionBackupOperationResult", + "LongTermRetentionBackupProperties", + "LongTermRetentionOperationResultProperties", "LongTermRetentionPolicy", - "LongTermRetentionPolicyListResult", + "LongTermRetentionPolicyProperties", "MaintenanceConfigurationCapability", "MaintenanceWindowOptions", + "MaintenanceWindowOptionsProperties", "MaintenanceWindowTimeRange", "MaintenanceWindows", + "MaintenanceWindowsProperties", "ManagedBackupShortTermRetentionPolicy", - "ManagedBackupShortTermRetentionPolicyListResult", + "ManagedBackupShortTermRetentionPolicyProperties", "ManagedDatabase", "ManagedDatabaseAdvancedThreatProtection", - "ManagedDatabaseAdvancedThreatProtectionListResult", "ManagedDatabaseExtendedAccessibilityInfo", - "ManagedDatabaseListResult", "ManagedDatabaseMoveDefinition", - "ManagedDatabaseMoveOperationListResult", "ManagedDatabaseMoveOperationResult", + "ManagedDatabaseMoveOperationResultProperties", + "ManagedDatabaseProperties", "ManagedDatabaseRestoreDetailsBackupSetProperties", + "ManagedDatabaseRestoreDetailsProperties", "ManagedDatabaseRestoreDetailsResult", "ManagedDatabaseRestoreDetailsUnrestorableFileProperties", "ManagedDatabaseSecurityAlertPolicy", - "ManagedDatabaseSecurityAlertPolicyListResult", "ManagedDatabaseStartMoveDefinition", "ManagedDatabaseUpdate", "ManagedInstance", "ManagedInstanceAdministrator", - "ManagedInstanceAdministratorListResult", + "ManagedInstanceAdministratorProperties", "ManagedInstanceAdvancedThreatProtection", - "ManagedInstanceAdvancedThreatProtectionListResult", - "ManagedInstanceAzureADOnlyAuthListResult", + "ManagedInstanceAzureADOnlyAuthProperties", "ManagedInstanceAzureADOnlyAuthentication", "ManagedInstanceDtc", - "ManagedInstanceDtcListResult", + "ManagedInstanceDtcProperties", "ManagedInstanceDtcSecuritySettings", "ManagedInstanceDtcTransactionManagerCommunicationSettings", "ManagedInstanceEditionCapability", "ManagedInstanceEncryptionProtector", - "ManagedInstanceEncryptionProtectorListResult", + "ManagedInstanceEncryptionProtectorProperties", "ManagedInstanceExternalAdministrator", "ManagedInstanceFamilyCapability", "ManagedInstanceKey", - "ManagedInstanceKeyListResult", - "ManagedInstanceListResult", + "ManagedInstanceKeyProperties", "ManagedInstanceLongTermRetentionBackup", - "ManagedInstanceLongTermRetentionBackupListResult", + "ManagedInstanceLongTermRetentionBackupProperties", "ManagedInstanceLongTermRetentionPolicy", - "ManagedInstanceLongTermRetentionPolicyListResult", + "ManagedInstanceLongTermRetentionPolicyProperties", "ManagedInstanceMaintenanceConfigurationCapability", "ManagedInstanceOperation", - "ManagedInstanceOperationListResult", "ManagedInstanceOperationParametersPair", + "ManagedInstanceOperationProperties", "ManagedInstanceOperationSteps", "ManagedInstancePairInfo", "ManagedInstancePecProperty", "ManagedInstancePrivateEndpointConnection", - "ManagedInstancePrivateEndpointConnectionListResult", "ManagedInstancePrivateEndpointConnectionProperties", "ManagedInstancePrivateEndpointProperty", "ManagedInstancePrivateLink", - "ManagedInstancePrivateLinkListResult", "ManagedInstancePrivateLinkProperties", "ManagedInstancePrivateLinkServiceConnectionStateProperty", + "ManagedInstanceProperties", "ManagedInstanceQuery", - "ManagedInstanceQueryStatistics", "ManagedInstanceUpdate", "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", "ManagedInstanceVcoresCapability", "ManagedInstanceVersionCapability", "ManagedInstanceVulnerabilityAssessment", - "ManagedInstanceVulnerabilityAssessmentListResult", + "ManagedInstanceVulnerabilityAssessmentProperties", "ManagedLedgerDigestUploads", - "ManagedLedgerDigestUploadsListResult", + "ManagedLedgerDigestUploadsProperties", "ManagedServerDnsAlias", "ManagedServerDnsAliasAcquisition", "ManagedServerDnsAliasCreation", - "ManagedServerDnsAliasListResult", + "ManagedServerDnsAliasProperties", "ManagedServerSecurityAlertPolicy", - "ManagedServerSecurityAlertPolicyListResult", "ManagedTransparentDataEncryption", - "ManagedTransparentDataEncryptionListResult", + "ManagedTransparentDataEncryptionProperties", "MaxLimitRangeCapability", "MaxSizeCapability", "MaxSizeRangeCapability", @@ -881,178 +906,183 @@ "NSPProvisioningIssueProperties", "Name", "NetworkIsolationSettings", - "NetworkIsolationSettingsAutoGenerated", "NetworkSecurityPerimeterConfiguration", - "NetworkSecurityPerimeterConfigurationListResult", + "NetworkSecurityPerimeterConfigurationProperties", "Operation", "OperationDisplay", - "OperationListResult", "OutboundEnvironmentEndpoint", - "OutboundEnvironmentEndpointCollection", "OutboundFirewallRule", - "OutboundFirewallRuleListResult", + "OutboundFirewallRuleProperties", "PartnerInfo", "PartnerRegionInfo", "PerDatabaseAutoPauseDelayTimeRange", "PerformanceLevelCapability", "PhaseDetails", "PrivateEndpointConnection", - "PrivateEndpointConnectionListResult", "PrivateEndpointConnectionProperties", "PrivateEndpointConnectionRequestStatus", "PrivateEndpointProperty", "PrivateLinkResource", - "PrivateLinkResourceListResult", "PrivateLinkResourceProperties", "PrivateLinkServiceConnectionStateProperty", "ProxyResource", + "ProxyResourceAutoGenerated", "ProxyResourceWithWritableName", "QueryCheck", "QueryMetricInterval", "QueryMetricProperties", + "QueryProperties", "QueryStatistics", "QueryStatisticsProperties", "ReadScaleCapability", "RecommendedAction", - "RecommendedActionAutoGenerated", "RecommendedActionErrorInfo", "RecommendedActionImpactRecord", "RecommendedActionImplementationInfo", "RecommendedActionMetricInfo", + "RecommendedActionProperties", "RecommendedActionStateInfo", "RecommendedSensitivityLabelUpdate", "RecommendedSensitivityLabelUpdateList", + "RecommendedSensitivityLabelUpdateProperties", "RecoverableDatabase", - "RecoverableDatabaseListResult", + "RecoverableDatabaseProperties", "RecoverableManagedDatabase", - "RecoverableManagedDatabaseListResult", + "RecoverableManagedDatabaseProperties", "RefreshExternalGovernanceStatusOperationResult", "RefreshExternalGovernanceStatusOperationResultMI", + "RefreshExternalGovernanceStatusOperationResultProperties", + "RefreshExternalGovernanceStatusOperationResultPropertiesMI", "Remediation", "ReplicationLink", - "ReplicationLinkListResult", + "ReplicationLinkProperties", "ReplicationLinkUpdate", + "ReplicationLinkUpdateProperties", "Resource", + "ResourceAutoGenerated", "ResourceIdentity", "ResourceMoveDefinition", "ResourceWithWritableName", "RestorableDroppedDatabase", - "RestorableDroppedDatabaseListResult", + "RestorableDroppedDatabaseProperties", "RestorableDroppedManagedDatabase", - "RestorableDroppedManagedDatabaseListResult", + "RestorableDroppedManagedDatabaseProperties", "RestorePoint", - "RestorePointListResult", - "SQLVulnerabilityAssessmentScanListResult", + "RestorePointProperties", "ScheduleItem", + "SecurityAlertPolicyProperties", + "SecurityAlertsPolicyProperties", "SecurityEvent", - "SecurityEventCollection", + "SecurityEventProperties", "SecurityEventSqlInjectionAdditionalProperties", - "SecurityEventsFilterParameters", "SensitivityLabel", - "SensitivityLabelListResult", + "SensitivityLabelProperties", "SensitivityLabelUpdate", "SensitivityLabelUpdateList", + "SensitivityLabelUpdateProperties", "Server", "ServerAdvancedThreatProtection", "ServerAutomaticTuning", "ServerAzureADAdministrator", "ServerAzureADOnlyAuthentication", "ServerBlobAuditingPolicy", - "ServerBlobAuditingPolicyListResult", + "ServerBlobAuditingPolicyProperties", "ServerConfigurationOption", - "ServerConfigurationOptionListResult", + "ServerConfigurationOptionProperties", "ServerConnectionPolicy", - "ServerConnectionPolicyListResult", - "ServerDevOpsAuditSettingsListResult", + "ServerConnectionPolicyProperties", + "ServerDevOpsAuditSettingsProperties", "ServerDevOpsAuditingSettings", "ServerDnsAlias", "ServerDnsAliasAcquisition", - "ServerDnsAliasListResult", + "ServerDnsAliasProperties", "ServerExternalAdministrator", + "ServerFirewallRuleProperties", "ServerInfo", "ServerKey", - "ServerKeyListResult", - "ServerListResult", + "ServerKeyProperties", "ServerOperation", - "ServerOperationListResult", + "ServerOperationProperties", "ServerPrivateEndpointConnection", + "ServerProperties", "ServerSecurityAlertPolicy", "ServerTrustCertificate", - "ServerTrustCertificatesListResult", + "ServerTrustCertificateProperties", "ServerTrustGroup", - "ServerTrustGroupListResult", + "ServerTrustGroupProperties", "ServerUpdate", "ServerUsage", - "ServerUsageListResult", + "ServerUsageProperties", "ServerVersionCapability", "ServerVulnerabilityAssessment", - "ServerVulnerabilityAssessmentListResult", + "ServerVulnerabilityAssessmentProperties", "ServiceObjectiveCapability", "ServicePrincipal", "Sku", "SqlAgentConfiguration", + "SqlAgentConfigurationProperties", "SqlVulnerabilityAssessment", - "SqlVulnerabilityAssessmentListResult", + "SqlVulnerabilityAssessmentPolicyProperties", "SqlVulnerabilityAssessmentScanError", "SqlVulnerabilityAssessmentScanRecord", - "SqlVulnerabilityAssessmentScanRecordListResult", + "SqlVulnerabilityAssessmentScanRecordProperties", + "SqlVulnerabilityAssessmentScanResultProperties", "SqlVulnerabilityAssessmentScanResults", "StartStopManagedInstanceSchedule", - "StartStopManagedInstanceScheduleListResult", + "StartStopManagedInstanceScheduleProperties", "StorageCapability", "SubscriptionUsage", - "SubscriptionUsageListResult", + "SubscriptionUsageProperties", "SynapseLinkWorkspace", "SynapseLinkWorkspaceInfoProperties", - "SynapseLinkWorkspaceListResult", + "SynapseLinkWorkspaceProperties", "SyncAgent", "SyncAgentKeyProperties", "SyncAgentLinkedDatabase", - "SyncAgentLinkedDatabaseListResult", - "SyncAgentListResult", - "SyncDatabaseIdListResult", + "SyncAgentLinkedDatabaseProperties", + "SyncAgentProperties", "SyncDatabaseIdProperties", "SyncFullSchemaProperties", - "SyncFullSchemaPropertiesListResult", "SyncFullSchemaTable", "SyncFullSchemaTableColumn", "SyncGroup", - "SyncGroupListResult", - "SyncGroupLogListResult", "SyncGroupLogProperties", + "SyncGroupProperties", "SyncGroupSchema", "SyncGroupSchemaTable", "SyncGroupSchemaTableColumn", "SyncMember", - "SyncMemberListResult", + "SyncMemberProperties", "SystemData", "TdeCertificate", + "TdeCertificateProperties", "TimeZone", - "TimeZoneListResult", + "TimeZoneProperties", "TopQueries", - "TopQueriesListResult", "TrackedResource", + "TransparentDataEncryptionProperties", "UpdateLongTermRetentionBackupParameters", + "UpdateLongTermRetentionBackupParametersProperties", "UpdateVirtualClusterDnsServersOperation", "UpsertManagedServerOperationParameters", "UpsertManagedServerOperationStepWithEstimatesAndDuration", "Usage", - "UsageListResult", "UserIdentity", "VaRule", "VirtualCluster", - "VirtualClusterListResult", + "VirtualClusterDnsServersProperties", + "VirtualClusterProperties", "VirtualClusterUpdate", "VirtualNetworkRule", - "VirtualNetworkRuleListResult", + "VirtualNetworkRuleProperties", "VulnerabilityAssessmentRecurringScansProperties", "VulnerabilityAssessmentScanError", "VulnerabilityAssessmentScanRecord", - "VulnerabilityAssessmentScanRecordListResult", + "VulnerabilityAssessmentScanRecordProperties", "WorkloadClassifier", - "WorkloadClassifierListResult", + "WorkloadClassifierProperties", "WorkloadGroup", - "WorkloadGroupListResult", + "WorkloadGroupProperties", "ZonePinningCapability", "AdministratorName", "AdministratorType", @@ -1075,21 +1105,26 @@ "BackupStorageAccessTier", "BackupStorageRedundancy", "BaselineName", + "BlobAuditingPolicyName", "BlobAuditingPolicyState", "CapabilityGroup", "CapabilityStatus", "CatalogCollationType", "CheckNameAvailabilityReason", + "CheckNameAvailabilityResourceType", "ClientClassificationSource", "ColumnDataType", "ConnectionPolicyName", "CreateMode", "CreatedByType", + "CreatedByType", + "CurrentSensitivityLabelSource", "DNSRefreshOperationStatus", "DataMaskingFunction", "DataMaskingPolicyName", "DataMaskingRuleState", "DataMaskingState", + "DataSyncParticipantIdentityType", "DataWarehouseUserActivityName", "DatabaseIdentityType", "DatabaseKeyType", @@ -1169,6 +1204,7 @@ "ReadWriteEndpointFailoverPolicy", "RecommendedActionCurrentState", "RecommendedActionInitiatedBy", + "RecommendedSensitivityLabelSource", "RecommendedSensitivityLabelUpdateKind", "ReplicaConnectedState", "ReplicaSynchronizationHealth", @@ -1187,7 +1223,6 @@ "SecondaryInstanceType", "SecondaryType", "SecurityAlertPolicyName", - "SecurityAlertPolicyNameAutoGenerated", "SecurityAlertPolicyState", "SecurityAlertsPolicyState", "SecurityEventType", @@ -1232,6 +1267,7 @@ "VulnerabilityAssessmentPolicyBaselineName", "VulnerabilityAssessmentScanState", "VulnerabilityAssessmentScanTriggerType", + "VulnerabilityAssessmentSystemDatabaseName", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _patch_sdk() 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/_enums.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_enums.py index e9cfd2ff9fb8..53717f060fed 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/_enums.py @@ -3,7 +3,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- @@ -12,21 +12,24 @@ class AdministratorName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AdministratorName.""" + """Type of AdministratorName.""" ACTIVE_DIRECTORY = "ActiveDirectory" + """ActiveDirectory.""" class AdministratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the sever administrator.""" ACTIVE_DIRECTORY = "ActiveDirectory" + """ActiveDirectory.""" class AdvancedThreatProtectionName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AdvancedThreatProtectionName.""" + """Type of AdvancedThreatProtectionName.""" DEFAULT = "Default" + """Default.""" class AdvancedThreatProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -35,8 +38,11 @@ class AdvancedThreatProtectionState(str, Enum, metaclass=CaseInsensitiveEnumMeta """ NEW = "New" + """New.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class AdvisorStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -45,40 +51,55 @@ class AdvisorStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ GA = "GA" + """GA.""" PUBLIC_PREVIEW = "PublicPreview" + """PublicPreview.""" LIMITED_PUBLIC_PREVIEW = "LimitedPublicPreview" + """LimitedPublicPreview.""" PRIVATE_PREVIEW = "PrivatePreview" + """PrivatePreview.""" class AggregationFunctionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AggregationFunctionType.""" + """Type of AggregationFunctionType.""" AVG = "avg" + """avg.""" MIN = "min" + """min.""" MAX = "max" + """max.""" STDEV = "stdev" + """stdev.""" SUM = "sum" + """sum.""" class AlwaysEncryptedEnclaveType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of enclave requested on the database i.e. Default or VBS enclaves.""" DEFAULT = "Default" + """Default.""" VBS = "VBS" + """VBS.""" class AuthenticationName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """AuthenticationName.""" + """Type of AuthenticationName.""" DEFAULT = "Default" + """Default.""" class AuthMetadataLookupModes(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The managed instance's authentication metadata lookup mode.""" AZURE_AD = "AzureAD" + """AzureAD.""" PAIRED = "Paired" + """Paired.""" WINDOWS = "Windows" + """Windows.""" class AutoExecuteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -87,8 +108,11 @@ class AutoExecuteStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" DEFAULT = "Default" + """Default.""" class AutoExecuteStatusInheritedFrom(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -99,93 +123,138 @@ class AutoExecuteStatusInheritedFrom(str, Enum, metaclass=CaseInsensitiveEnumMet """ DEFAULT = "Default" + """Default.""" SUBSCRIPTION = "Subscription" + """Subscription.""" SERVER = "Server" + """Server.""" ELASTIC_POOL = "ElasticPool" + """ElasticPool.""" DATABASE = "Database" + """Database.""" class AutomaticTuningDisabledReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Reason description if desired and actual state are different.""" DEFAULT = "Default" + """Default.""" DISABLED = "Disabled" + """Disabled.""" AUTO_CONFIGURED = "AutoConfigured" + """AutoConfigured.""" INHERITED_FROM_SERVER = "InheritedFromServer" + """InheritedFromServer.""" QUERY_STORE_OFF = "QueryStoreOff" + """QueryStoreOff.""" QUERY_STORE_READ_ONLY = "QueryStoreReadOnly" + """QueryStoreReadOnly.""" NOT_SUPPORTED = "NotSupported" + """NotSupported.""" class AutomaticTuningMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Automatic tuning desired state.""" INHERIT = "Inherit" + """Inherit.""" CUSTOM = "Custom" + """Custom.""" AUTO = "Auto" + """Auto.""" UNSPECIFIED = "Unspecified" + """Unspecified.""" class AutomaticTuningOptionModeActual(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Automatic tuning option actual state.""" OFF = "Off" + """Off.""" ON = "On" + """On.""" class AutomaticTuningOptionModeDesired(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Automatic tuning option desired state.""" OFF = "Off" + """Off.""" ON = "On" + """On.""" DEFAULT = "Default" + """Default.""" class AutomaticTuningServerMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Automatic tuning desired state.""" CUSTOM = "Custom" + """Custom.""" AUTO = "Auto" + """Auto.""" UNSPECIFIED = "Unspecified" + """Unspecified.""" class AutomaticTuningServerReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Reason description if desired and actual state are different.""" DEFAULT = "Default" + """Default.""" DISABLED = "Disabled" + """Disabled.""" AUTO_CONFIGURED = "AutoConfigured" + """AutoConfigured.""" class AvailabilityZoneType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the availability zone the database is pinned to.""" NO_PREFERENCE = "NoPreference" - ONE = "1" - TWO = "2" - THREE = "3" + """NoPreference.""" + ENUM_1 = "1" + """1.""" + ENUM_2 = "2" + """2.""" + ENUM_3 = "3" + """3.""" class BackupStorageAccessTier(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The BackupStorageAccessTier for the LTR backup.""" HOT = "Hot" + """Hot.""" ARCHIVE = "Archive" + """Archive.""" class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The storage account type used to store backups for this database.""" GEO = "Geo" + """Geo.""" LOCAL = "Local" + """Local.""" ZONE = "Zone" + """Zone.""" GEO_ZONE = "GeoZone" + """GeoZone.""" class BaselineName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """BaselineName.""" + """Type of BaselineName.""" DEFAULT = "default" + """default.""" + + +class BlobAuditingPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of BlobAuditingPolicyName.""" + + DEFAULT = "default" + """default.""" class BlobAuditingPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -194,34 +263,48 @@ class BlobAuditingPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class CapabilityGroup(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """CapabilityGroup.""" + """Type of CapabilityGroup.""" SUPPORTED_EDITIONS = "supportedEditions" + """supportedEditions.""" SUPPORTED_ELASTIC_POOL_EDITIONS = "supportedElasticPoolEditions" + """supportedElasticPoolEditions.""" SUPPORTED_MANAGED_INSTANCE_VERSIONS = "supportedManagedInstanceVersions" + """supportedManagedInstanceVersions.""" SUPPORTED_INSTANCE_POOL_EDITIONS = "supportedInstancePoolEditions" + """supportedInstancePoolEditions.""" SUPPORTED_MANAGED_INSTANCE_EDITIONS = "supportedManagedInstanceEditions" + """supportedManagedInstanceEditions.""" SUPPORTED_JOB_AGENT_VERSIONS = "supportedJobAgentVersions" + """supportedJobAgentVersions.""" class CapabilityStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the capability.""" VISIBLE = "Visible" + """Visible.""" AVAILABLE = "Available" + """Available.""" DEFAULT = "Default" + """Default.""" DISABLED = "Disabled" + """Disabled.""" class CatalogCollationType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Collation of the metadata catalog.""" DATABASE_DEFAULT = "DATABASE_DEFAULT" + """DATABASE_DEFAULT.""" SQL_LATIN1_GENERAL_CP1_CI_AS = "SQL_Latin1_General_CP1_CI_AS" + """SQL_Latin1_General_CP1_CI_AS.""" class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -230,70 +313,135 @@ class CheckNameAvailabilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ INVALID = "Invalid" + """Invalid.""" ALREADY_EXISTS = "AlreadyExists" + """AlreadyExists.""" + + +class CheckNameAvailabilityResourceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CheckNameAvailabilityResourceType.""" + + MICROSOFT_SQL_SERVERS = "Microsoft.Sql/servers" + """Microsoft.Sql/servers.""" class ClientClassificationSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ClientClassificationSource.""" + """Type of ClientClassificationSource.""" NONE = "None" + """None.""" NATIVE = "Native" + """Native.""" RECOMMENDED = "Recommended" + """Recommended.""" MIP = "MIP" + """MIP.""" class ColumnDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The column data type.""" IMAGE = "image" + """image.""" TEXT = "text" + """text.""" UNIQUEIDENTIFIER = "uniqueidentifier" + """uniqueidentifier.""" DATE = "date" + """date.""" TIME = "time" + """time.""" DATETIME2 = "datetime2" + """datetime2.""" DATETIMEOFFSET = "datetimeoffset" + """datetimeoffset.""" TINYINT = "tinyint" + """tinyint.""" SMALLINT = "smallint" + """smallint.""" INT = "int" + """int.""" SMALLDATETIME = "smalldatetime" + """smalldatetime.""" REAL = "real" + """real.""" MONEY = "money" + """money.""" DATETIME = "datetime" + """datetime.""" FLOAT = "float" + """float.""" SQL_VARIANT = "sql_variant" + """sql_variant.""" NTEXT = "ntext" + """ntext.""" BIT = "bit" + """bit.""" DECIMAL = "decimal" + """decimal.""" NUMERIC = "numeric" + """numeric.""" SMALLMONEY = "smallmoney" + """smallmoney.""" BIGINT = "bigint" + """bigint.""" HIERARCHYID = "hierarchyid" + """hierarchyid.""" GEOMETRY = "geometry" + """geometry.""" GEOGRAPHY = "geography" + """geography.""" VARBINARY = "varbinary" + """varbinary.""" VARCHAR = "varchar" + """varchar.""" BINARY = "binary" + """binary.""" CHAR = "char" + """char.""" TIMESTAMP = "timestamp" + """timestamp.""" NVARCHAR = "nvarchar" + """nvarchar.""" NCHAR = "nchar" + """nchar.""" XML = "xml" + """xml.""" SYSNAME = "sysname" + """sysname.""" class ConnectionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ConnectionPolicyName.""" + """Type of ConnectionPolicyName.""" DEFAULT = "default" + """default.""" + + +class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The kind of entity that created the resource.""" + + USER = "User" + """The entity was created by a user.""" + APPLICATION = "Application" + """The entity was created by an application.""" + MANAGED_IDENTITY = "ManagedIdentity" + """The entity was created by a managed identity.""" + KEY = "Key" + """The entity was created by a key.""" class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity that created the resource.""" USER = "User" + """User.""" APPLICATION = "Application" + """Application.""" MANAGED_IDENTITY = "ManagedIdentity" + """ManagedIdentity.""" KEY = "Key" + """Key.""" class CreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -329,28 +477,48 @@ class CreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ DEFAULT = "Default" + """Default.""" COPY = "Copy" + """Copy.""" SECONDARY = "Secondary" + """Secondary.""" POINT_IN_TIME_RESTORE = "PointInTimeRestore" + """PointInTimeRestore.""" RESTORE = "Restore" + """Restore.""" RECOVERY = "Recovery" + """Recovery.""" RESTORE_EXTERNAL_BACKUP = "RestoreExternalBackup" + """RestoreExternalBackup.""" RESTORE_EXTERNAL_BACKUP_SECONDARY = "RestoreExternalBackupSecondary" + """RestoreExternalBackupSecondary.""" RESTORE_LONG_TERM_RETENTION_BACKUP = "RestoreLongTermRetentionBackup" + """RestoreLongTermRetentionBackup.""" ONLINE_SECONDARY = "OnlineSecondary" + """OnlineSecondary.""" + + +class CurrentSensitivityLabelSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of CurrentSensitivityLabelSource.""" + + CURRENT = "current" + """current.""" class DatabaseIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The identity type.""" NONE = "None" + """None.""" USER_ASSIGNED = "UserAssigned" + """UserAssigned.""" class DatabaseKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The database key type. Only supported value is 'AzureKeyVault'.""" AZURE_KEY_VAULT = "AzureKeyVault" + """AzureKeyVault.""" class DatabaseLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -359,7 +527,9 @@ class DatabaseLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ LICENSE_INCLUDED = "LicenseIncluded" + """LicenseIncluded.""" BASE_PRICE = "BasePrice" + """BasePrice.""" class DatabaseReadScale(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -369,61 +539,97 @@ class DatabaseReadScale(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class DatabaseState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DatabaseState.""" + """Type of DatabaseState.""" ALL = "All" + """All.""" LIVE = "Live" + """Live.""" DELETED = "Deleted" + """Deleted.""" class DatabaseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the database.""" ONLINE = "Online" + """Online.""" RESTORING = "Restoring" + """Restoring.""" RECOVERY_PENDING = "RecoveryPending" + """RecoveryPending.""" RECOVERING = "Recovering" + """Recovering.""" SUSPECT = "Suspect" + """Suspect.""" OFFLINE = "Offline" + """Offline.""" STANDBY = "Standby" + """Standby.""" SHUTDOWN = "Shutdown" + """Shutdown.""" EMERGENCY_MODE = "EmergencyMode" + """EmergencyMode.""" AUTO_CLOSED = "AutoClosed" + """AutoClosed.""" COPYING = "Copying" + """Copying.""" CREATING = "Creating" + """Creating.""" INACCESSIBLE = "Inaccessible" + """Inaccessible.""" OFFLINE_SECONDARY = "OfflineSecondary" + """OfflineSecondary.""" PAUSING = "Pausing" + """Pausing.""" PAUSED = "Paused" + """Paused.""" RESUMING = "Resuming" + """Resuming.""" SCALING = "Scaling" + """Scaling.""" OFFLINE_CHANGING_DW_PERFORMANCE_TIERS = "OfflineChangingDwPerformanceTiers" + """OfflineChangingDwPerformanceTiers.""" ONLINE_CHANGING_DW_PERFORMANCE_TIERS = "OnlineChangingDwPerformanceTiers" + """OnlineChangingDwPerformanceTiers.""" DISABLED = "Disabled" + """Disabled.""" STOPPING = "Stopping" + """Stopping.""" STOPPED = "Stopped" + """Stopped.""" STARTING = "Starting" + """Starting.""" class DataMaskingFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The masking function that is used for the data masking rule.""" DEFAULT = "Default" + """Default.""" CCN = "CCN" + """CCN.""" EMAIL = "Email" + """Email.""" NUMBER = "Number" + """Number.""" SSN = "SSN" + """SSN.""" TEXT = "Text" + """Text.""" class DataMaskingPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataMaskingPolicyName.""" + """Type of DataMaskingPolicyName.""" DEFAULT = "Default" + """Default.""" class DataMaskingRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -434,38 +640,64 @@ class DataMaskingRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class DataMaskingState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the data masking policy.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" + + +class DataSyncParticipantIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of DataSyncParticipantIdentityType.""" + + NONE = "None" + """None.""" + SYSTEM_ASSIGNED = "SystemAssigned" + """SystemAssigned.""" + USER_ASSIGNED = "UserAssigned" + """UserAssigned.""" + SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssignedUserAssigned" + """SystemAssignedUserAssigned.""" class DataWarehouseUserActivityName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataWarehouseUserActivityName.""" + """Type of DataWarehouseUserActivityName.""" CURRENT = "current" + """current.""" class DayOfWeek(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Day of maintenance window.""" SUNDAY = "Sunday" + """Sunday.""" MONDAY = "Monday" + """Monday.""" TUESDAY = "Tuesday" + """Tuesday.""" WEDNESDAY = "Wednesday" + """Wednesday.""" THURSDAY = "Thursday" + """Thursday.""" FRIDAY = "Friday" + """Friday.""" SATURDAY = "Saturday" + """Saturday.""" class DevOpsAuditingSettingsName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DevOpsAuditingSettingsName.""" + """Type of DevOpsAuditingSettingsName.""" DEFAULT = "Default" + """Default.""" class DiffBackupIntervalInHours(int, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -474,71 +706,91 @@ class DiffBackupIntervalInHours(int, Enum, metaclass=CaseInsensitiveEnumMeta): dropped databases. """ - TWELVE = 12 - TWENTY_FOUR = 24 + ENUM_12 = 12 + """12.""" + ENUM_24 = 24 + """24.""" class DNSRefreshOperationStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The status of the DNS refresh operation.""" SUCCEEDED = "Succeeded" + """Succeeded.""" FAILED = "Failed" + """Failed.""" IN_PROGRESS = "InProgress" + """InProgress.""" class DtcName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DtcName.""" + """Type of DtcName.""" CURRENT = "current" + """current.""" class ElasticPoolLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The license type to apply for this elastic pool.""" LICENSE_INCLUDED = "LicenseIncluded" + """LicenseIncluded.""" BASE_PRICE = "BasePrice" + """BasePrice.""" class ElasticPoolState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the elastic pool.""" CREATING = "Creating" + """Creating.""" READY = "Ready" + """Ready.""" DISABLED = "Disabled" + """Disabled.""" class EncryptionProtectorName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """EncryptionProtectorName.""" + """Type of EncryptionProtectorName.""" CURRENT = "current" + """current.""" class ErrorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Error type (e.g. None, User).""" NONE = "None" + """None.""" USER = "User" + """User.""" class ExternalGovernanceStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of external governance.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class FailoverGroupDatabasesSecondaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Databases secondary type on partner server.""" GEO = "Geo" + """Geo.""" STANDBY = "Standby" + """Standby.""" class FailoverGroupReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Local replication role of the failover group instance.""" PRIMARY = "Primary" + """Primary.""" SECONDARY = "Secondary" + """Secondary.""" class FailoverModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -547,14 +799,18 @@ class FailoverModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ NONE = "None" + """None.""" MANUAL = "Manual" + """Manual.""" class FailoverType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The failover type, can be ForcedAllowDataLoss or Planned.""" FORCED_ALLOW_DATA_LOSS = "ForcedAllowDataLoss" + """ForcedAllowDataLoss.""" PLANNED = "Planned" + """Planned.""" class FreeLimitExhaustionBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -568,20 +824,25 @@ class FreeLimitExhaustionBehavior(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ AUTO_PAUSE = "AutoPause" + """AutoPause.""" BILL_OVER_USAGE = "BillOverUsage" + """BillOverUsage.""" class GeoBackupPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """GeoBackupPolicyName.""" + """Type of GeoBackupPolicyName.""" DEFAULT = "Default" + """Default.""" class GeoBackupPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the geo backup policy.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class HybridSecondaryUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -590,7 +851,9 @@ class HybridSecondaryUsage(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ACTIVE = "Active" + """Active.""" PASSIVE = "Passive" + """Passive.""" class HybridSecondaryUsageDetected(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -600,7 +863,9 @@ class HybridSecondaryUsageDetected(str, Enum, metaclass=CaseInsensitiveEnumMeta) """ ACTIVE = "Active" + """Active.""" PASSIVE = "Passive" + """Passive.""" class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -609,9 +874,13 @@ class IdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ NONE = "None" + """None.""" SYSTEM_ASSIGNED = "SystemAssigned" + """SystemAssigned.""" USER_ASSIGNED = "UserAssigned" + """UserAssigned.""" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned,UserAssigned" + """SystemAssigned,UserAssigned.""" class ImplementationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -620,7 +889,9 @@ class ImplementationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ T_SQL = "TSql" + """TSql.""" AZURE_POWER_SHELL = "AzurePowerShell" + """AzurePowerShell.""" class InaccessibilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -629,15 +900,20 @@ class InaccessibilityReason(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ UNKNOWN = "Unknown" + """Unknown.""" TRANSPARENT_DATA_ENCRYPTION = "TransparentDataEncryption" + """TransparentDataEncryption.""" DATABASE_REPLICATION = "DatabaseReplication" + """DatabaseReplication.""" class InstanceFailoverGroupReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Local replication role of the failover group instance.""" PRIMARY = "Primary" + """Primary.""" SECONDARY = "Secondary" + """Secondary.""" class InstancePoolLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -646,14 +922,18 @@ class InstancePoolLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ LICENSE_INCLUDED = "LicenseIncluded" + """LicenseIncluded.""" BASE_PRICE = "BasePrice" + """BasePrice.""" class InstanceRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """New role of managed instance in a distributed availability group, can be Primary or Secondary.""" PRIMARY = "Primary" + """Primary.""" SECONDARY = "Secondary" + """Secondary.""" class IsRetryable(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -662,119 +942,163 @@ class IsRetryable(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ YES = "Yes" + """Yes.""" NO = "No" + """No.""" class JobAgentIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The job agent identity type.""" NONE = "None" + """None.""" SYSTEM_ASSIGNED = "SystemAssigned" + """SystemAssigned.""" USER_ASSIGNED = "UserAssigned" + """UserAssigned.""" SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssignedUserAssigned" + """SystemAssignedUserAssigned.""" class JobAgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the job agent.""" CREATING = "Creating" + """Creating.""" READY = "Ready" + """Ready.""" UPDATING = "Updating" + """Updating.""" DELETING = "Deleting" + """Deleting.""" DISABLED = "Disabled" + """Disabled.""" class JobExecutionLifecycle(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The detailed state of the job execution.""" CREATED = "Created" + """Created.""" IN_PROGRESS = "InProgress" + """InProgress.""" WAITING_FOR_CHILD_JOB_EXECUTIONS = "WaitingForChildJobExecutions" + """WaitingForChildJobExecutions.""" WAITING_FOR_RETRY = "WaitingForRetry" + """WaitingForRetry.""" SUCCEEDED = "Succeeded" + """Succeeded.""" SUCCEEDED_WITH_SKIPPED = "SucceededWithSkipped" + """SucceededWithSkipped.""" FAILED = "Failed" + """Failed.""" TIMED_OUT = "TimedOut" + """TimedOut.""" CANCELED = "Canceled" + """Canceled.""" SKIPPED = "Skipped" + """Skipped.""" class JobScheduleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Schedule interval type.""" ONCE = "Once" + """Once.""" RECURRING = "Recurring" + """Recurring.""" class JobStepActionSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The source of the action to execute.""" INLINE = "Inline" + """Inline.""" class JobStepActionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of action being executed by the job step.""" T_SQL = "TSql" + """TSql.""" class JobStepOutputType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The output destination type.""" SQL_DATABASE = "SqlDatabase" + """SqlDatabase.""" class JobTargetGroupMembershipType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Whether the target is included or excluded from the group.""" INCLUDE = "Include" + """Include.""" EXCLUDE = "Exclude" + """Exclude.""" class JobTargetType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the target.""" TARGET_GROUP = "TargetGroup" + """TargetGroup.""" SQL_DATABASE = "SqlDatabase" + """SqlDatabase.""" SQL_ELASTIC_POOL = "SqlElasticPool" + """SqlElasticPool.""" SQL_SHARD_MAP = "SqlShardMap" + """SqlShardMap.""" SQL_SERVER = "SqlServer" + """SqlServer.""" class LedgerDigestUploadsName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LedgerDigestUploadsName.""" + """Type of LedgerDigestUploadsName.""" CURRENT = "current" + """current.""" class LedgerDigestUploadsState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the state of ledger digest upload.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class LinkRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SQL server side link role.""" PRIMARY = "Primary" + """Primary.""" SECONDARY = "Secondary" + """Secondary.""" class LogSizeUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The units that the limit is expressed in.""" MEGABYTES = "Megabytes" + """Megabytes.""" GIGABYTES = "Gigabytes" + """Gigabytes.""" TERABYTES = "Terabytes" + """Terabytes.""" PETABYTES = "Petabytes" + """Petabytes.""" PERCENT = "Percent" + """Percent.""" class LongTermRetentionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """LongTermRetentionPolicyName.""" + """Type of LongTermRetentionPolicyName.""" DEFAULT = "default" + """default.""" class ManagedDatabaseCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -789,41 +1113,62 @@ class ManagedDatabaseCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ DEFAULT = "Default" + """Default.""" RESTORE_EXTERNAL_BACKUP = "RestoreExternalBackup" + """RestoreExternalBackup.""" POINT_IN_TIME_RESTORE = "PointInTimeRestore" + """PointInTimeRestore.""" RECOVERY = "Recovery" + """Recovery.""" RESTORE_LONG_TERM_RETENTION_BACKUP = "RestoreLongTermRetentionBackup" + """RestoreLongTermRetentionBackup.""" class ManagedDatabaseStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Status of the database.""" ONLINE = "Online" + """Online.""" OFFLINE = "Offline" + """Offline.""" SHUTDOWN = "Shutdown" + """Shutdown.""" CREATING = "Creating" + """Creating.""" INACCESSIBLE = "Inaccessible" + """Inaccessible.""" RESTORING = "Restoring" + """Restoring.""" UPDATING = "Updating" + """Updating.""" STOPPING = "Stopping" + """Stopping.""" STOPPED = "Stopped" + """Stopped.""" STARTING = "Starting" + """Starting.""" DB_MOVING = "DbMoving" + """DbMoving.""" DB_COPYING = "DbCopying" + """DbCopying.""" class ManagedInstanceAdministratorType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the managed instance administrator.""" ACTIVE_DIRECTORY = "ActiveDirectory" + """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" + """AlwaysUpToDate.""" SQL_SERVER2022 = "SQLServer2022" + """SQLServer2022.""" SQL_SERVER2025 = "SQLServer2025" + """SQLServer2025.""" class ManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -832,36 +1177,45 @@ class ManagedInstanceLicenseType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ LICENSE_INCLUDED = "LicenseIncluded" + """LicenseIncluded.""" BASE_PRICE = "BasePrice" + """BasePrice.""" class ManagedInstanceLongTermRetentionPolicyName( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): - """ManagedInstanceLongTermRetentionPolicyName.""" + """Type of ManagedInstanceLongTermRetentionPolicyName.""" DEFAULT = "default" + """default.""" class ManagedInstanceProxyOverride(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Connection type used for connecting to the instance.""" PROXY = "Proxy" + """Proxy.""" REDIRECT = "Redirect" + """Redirect.""" DEFAULT = "Default" + """Default.""" class ManagedLedgerDigestUploadsName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ManagedLedgerDigestUploadsName.""" + """Type of ManagedLedgerDigestUploadsName.""" CURRENT = "current" + """current.""" class ManagedLedgerDigestUploadsState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the state of ledger digest upload.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class ManagedServerCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -874,124 +1228,173 @@ class ManagedServerCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ DEFAULT = "Default" + """Default.""" POINT_IN_TIME_RESTORE = "PointInTimeRestore" + """PointInTimeRestore.""" class ManagedShortTermRetentionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ManagedShortTermRetentionPolicyName.""" + """Type of ManagedShortTermRetentionPolicyName.""" DEFAULT = "default" + """default.""" class ManagementOperationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation state.""" PENDING = "Pending" + """Pending.""" IN_PROGRESS = "InProgress" + """InProgress.""" SUCCEEDED = "Succeeded" + """Succeeded.""" FAILED = "Failed" + """Failed.""" CANCEL_IN_PROGRESS = "CancelInProgress" + """CancelInProgress.""" CANCELLED = "Cancelled" + """Cancelled.""" class MaxSizeUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The units that the limit is expressed in.""" MEGABYTES = "Megabytes" + """Megabytes.""" GIGABYTES = "Gigabytes" + """Gigabytes.""" TERABYTES = "Terabytes" + """Terabytes.""" PETABYTES = "Petabytes" + """Petabytes.""" class MetricType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """MetricType.""" + """Type of MetricType.""" CPU = "cpu" + """cpu.""" IO = "io" + """io.""" LOG_IO = "logIo" + """logIo.""" DURATION = "duration" + """duration.""" DTU = "dtu" + """dtu.""" class MinimalTlsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'.""" NONE = "None" - ONE0 = "1.0" - ONE1 = "1.1" - ONE2 = "1.2" - ONE3 = "1.3" + """None.""" + TLS1_0 = "1.0" + """1.0.""" + TLS1_1 = "1.1" + """1.1.""" + TLS1_2 = "1.2" + """1.2.""" + TLS1_3 = "1.3" + """1.3.""" class MoveOperationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Operation mode.""" MOVE = "Move" + """Move.""" COPY = "Copy" + """Copy.""" class OperationMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Operation mode of the operation: Import, Export, or PolybaseImport.""" POLYBASE_IMPORT = "PolybaseImport" + """PolybaseImport.""" IMPORT = "Import" + """Import.""" EXPORT = "Export" + """Export.""" class OperationOrigin(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The intended executor of the operation.""" USER = "user" + """user.""" SYSTEM = "system" + """system.""" class PauseDelayTimeUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Unit of time that delay is expressed in.""" MINUTES = "Minutes" + """Minutes.""" class PerformanceLevelUnit(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Unit type used to measure performance level.""" DTU = "DTU" + """DTU.""" V_CORES = "VCores" + """VCores.""" class Phase(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The operation phase.""" LOG_TRANSITION_IN_PROGRESS = "LogTransitionInProgress" + """LogTransitionInProgress.""" COPYING = "Copying" + """Copying.""" BUILDING_HYPERSCALE_COMPONENTS = "BuildingHyperscaleComponents" + """BuildingHyperscaleComponents.""" CATCHUP = "Catchup" + """Catchup.""" WAITING_FOR_CUTOVER = "WaitingForCutover" + """WaitingForCutover.""" CUTOVER_IN_PROGRESS = "CutoverInProgress" + """CutoverInProgress.""" class PricingModel(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Pricing model of Managed Instance.""" REGULAR = "Regular" + """Regular.""" FREEMIUM = "Freemium" + """Freemium.""" class PrincipalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Principal Type of the sever administrator.""" USER = "User" + """User.""" GROUP = "Group" + """Group.""" APPLICATION = "Application" + """Application.""" class PrivateEndpointProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the private endpoint connection.""" APPROVING = "Approving" + """Approving.""" READY = "Ready" + """Ready.""" DROPPING = "Dropping" + """Dropping.""" FAILED = "Failed" + """Failed.""" REJECTING = "Rejecting" + """Rejecting.""" class PrivateLinkServiceConnectionStateActionsRequire( # pylint: disable=name-too-long @@ -1000,48 +1403,66 @@ class PrivateLinkServiceConnectionStateActionsRequire( # pylint: disable=name-t """The actions required for private link service connection.""" NONE = "None" + """None.""" class PrivateLinkServiceConnectionStateStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The private link service connection status.""" APPROVED = "Approved" + """Approved.""" PENDING = "Pending" + """Pending.""" REJECTED = "Rejected" + """Rejected.""" DISCONNECTED = "Disconnected" + """Disconnected.""" class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The ARM provisioning state of the job execution.""" CREATED = "Created" + """Created.""" IN_PROGRESS = "InProgress" + """InProgress.""" SUCCEEDED = "Succeeded" + """Succeeded.""" FAILED = "Failed" + """Failed.""" CANCELED = "Canceled" + """Canceled.""" class QueryMetricUnitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The unit of the metric.""" PERCENTAGE = "percentage" + """percentage.""" KB = "KB" + """KB.""" MICROSECONDS = "microseconds" + """microseconds.""" COUNT = "count" + """count.""" class QueryTimeGrainType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Interval type (length).""" - PT1_H = "PT1H" - P1_D = "P1D" + PT1H = "PT1H" + """PT1H.""" + P1D = "P1D" + """P1D.""" class ReadOnlyEndpointFailoverPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Failover policy of the read-only endpoint for the failover group.""" DISABLED = "Disabled" + """Disabled.""" ENABLED = "Enabled" + """Enabled.""" class ReadWriteEndpointFailoverPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1050,7 +1471,9 @@ class ReadWriteEndpointFailoverPolicy(str, Enum, metaclass=CaseInsensitiveEnumMe """ MANUAL = "Manual" + """Manual.""" AUTOMATIC = "Automatic" + """Automatic.""" class RecommendedActionCurrentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1067,151 +1490,219 @@ class RecommendedActionCurrentState(str, Enum, metaclass=CaseInsensitiveEnumMeta """ ACTIVE = "Active" + """Active.""" PENDING = "Pending" + """Pending.""" EXECUTING = "Executing" + """Executing.""" VERIFYING = "Verifying" + """Verifying.""" PENDING_REVERT = "PendingRevert" + """PendingRevert.""" REVERT_CANCELLED = "RevertCancelled" + """RevertCancelled.""" REVERTING = "Reverting" + """Reverting.""" REVERTED = "Reverted" + """Reverted.""" IGNORED = "Ignored" + """Ignored.""" EXPIRED = "Expired" + """Expired.""" MONITORING = "Monitoring" + """Monitoring.""" RESOLVED = "Resolved" + """Resolved.""" SUCCESS = "Success" + """Success.""" ERROR = "Error" + """Error.""" class RecommendedActionInitiatedBy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Gets if approval for applying this recommended action was given by user/system.""" USER = "User" + """User.""" SYSTEM = "System" + """System.""" + + +class RecommendedSensitivityLabelSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Type of RecommendedSensitivityLabelSource.""" + + RECOMMENDED = "recommended" + """recommended.""" class RecommendedSensitivityLabelUpdateKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """RecommendedSensitivityLabelUpdateKind.""" + """Type of RecommendedSensitivityLabelUpdateKind.""" ENABLE = "enable" + """enable.""" DISABLE = "disable" + """disable.""" class ReplicaConnectedState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Link connected state.""" DISCONNECTED = "DISCONNECTED" + """DISCONNECTED.""" CONNECTED = "CONNECTED" + """CONNECTED.""" class ReplicaSynchronizationHealth(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Link health state.""" NOT_HEALTHY = "NOT_HEALTHY" + """NOT_HEALTHY.""" PARTIALLY_HEALTHY = "PARTIALLY_HEALTHY" + """PARTIALLY_HEALTHY.""" HEALTHY = "HEALTHY" + """HEALTHY.""" class ReplicationLinkType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED.""" GEO = "GEO" + """GEO.""" NAMED = "NAMED" + """NAMED.""" STANDBY = "STANDBY" + """STANDBY.""" class ReplicationModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Replication mode of the link.""" ASYNC = "Async" + """Async.""" SYNC = "Sync" + """Sync.""" class ReplicationRole(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Local replication role.""" PRIMARY = "Primary" + """Primary.""" SECONDARY = "Secondary" + """Secondary.""" NON_READABLE_SECONDARY = "NonReadableSecondary" + """NonReadableSecondary.""" SOURCE = "Source" + """Source.""" COPY = "Copy" + """Copy.""" class ReplicationState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED).""" PENDING = "PENDING" + """PENDING.""" SEEDING = "SEEDING" + """SEEDING.""" CATCH_UP = "CATCH_UP" + """CATCH_UP.""" SUSPENDED = "SUSPENDED" + """SUSPENDED.""" class ReplicaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ReplicaType.""" + """Type of ReplicaType.""" PRIMARY = "Primary" + """Primary.""" READABLE_SECONDARY = "ReadableSecondary" + """ReadableSecondary.""" class RestoreDetailsName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """RestoreDetailsName.""" + """Type of RestoreDetailsName.""" DEFAULT = "Default" + """Default.""" class RestorePointType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of restore point.""" CONTINUOUS = "CONTINUOUS" + """CONTINUOUS.""" DISCRETE = "DISCRETE" + """DISCRETE.""" class RoleChangeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the role change, can be Planned or Forced.""" FORCED = "Forced" + """Forced.""" PLANNED = "Planned" + """Planned.""" class RuleSeverity(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SQL Vulnerability Assessment rule severity.""" HIGH = "High" + """High.""" MEDIUM = "Medium" + """Medium.""" LOW = "Low" + """Low.""" INFORMATIONAL = "Informational" + """Informational.""" OBSOLETE = "Obsolete" + """Obsolete.""" class RuleStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SQL Vulnerability Assessment baseline status.""" NON_FINDING = "NonFinding" + """NonFinding.""" FINDING = "Finding" + """Finding.""" INTERNAL_ERROR = "InternalError" + """InternalError.""" class RuleType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """SQL Vulnerability Assessment rule type.""" BINARY = "Binary" + """Binary.""" BASELINE_EXPECTED = "BaselineExpected" + """BaselineExpected.""" POSITIVE_LIST = "PositiveList" + """PositiveList.""" NEGATIVE_LIST = "NegativeList" + """NegativeList.""" class SampleName(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The name of the sample schema to apply when creating this database.""" ADVENTURE_WORKS_LT = "AdventureWorksLT" + """AdventureWorksLT.""" WIDE_WORLD_IMPORTERS_STD = "WideWorldImportersStd" + """WideWorldImportersStd.""" WIDE_WORLD_IMPORTERS_FULL = "WideWorldImportersFull" + """WideWorldImportersFull.""" class SecondaryInstanceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only.""" GEO = "Geo" + """Geo.""" STANDBY = "Standby" + """Standby.""" class SecondaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1220,20 +1711,18 @@ class SecondaryType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ GEO = "Geo" + """Geo.""" NAMED = "Named" + """Named.""" STANDBY = "Standby" + """Standby.""" class SecurityAlertPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SecurityAlertPolicyName.""" - - DEFAULT = "default" - - -class SecurityAlertPolicyNameAutoGenerated(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SecurityAlertPolicyNameAutoGenerated.""" + """Type of SecurityAlertPolicyName.""" DEFAULT = "Default" + """Default.""" class SecurityAlertPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1242,8 +1731,11 @@ class SecurityAlertPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ NEW = "New" + """New.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class SecurityAlertsPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1252,74 +1744,98 @@ class SecurityAlertsPolicyState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class SecurityEventType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of the security event.""" UNDEFINED = "Undefined" + """Undefined.""" SQL_INJECTION_VULNERABILITY = "SqlInjectionVulnerability" + """SqlInjectionVulnerability.""" SQL_INJECTION_EXPLOIT = "SqlInjectionExploit" + """SqlInjectionExploit.""" class SeedingModeType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Database seeding mode – can be Automatic (default), or Manual for supported scenarios.""" AUTOMATIC = "Automatic" + """Automatic.""" MANUAL = "Manual" + """Manual.""" class SensitivityLabelRank(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SensitivityLabelRank.""" + """Type of SensitivityLabelRank.""" NONE = "None" + """None.""" LOW = "Low" + """Low.""" MEDIUM = "Medium" + """Medium.""" HIGH = "High" + """High.""" CRITICAL = "Critical" + """Critical.""" class SensitivityLabelSource(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SensitivityLabelSource.""" + """Type of SensitivityLabelSource.""" CURRENT = "current" + """current.""" RECOMMENDED = "recommended" + """recommended.""" class SensitivityLabelUpdateKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SensitivityLabelUpdateKind.""" + """Type of SensitivityLabelUpdateKind.""" SET = "set" + """set.""" REMOVE = "remove" + """remove.""" class ServerConfigurationOptionName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ServerConfigurationOptionName.""" + """Type of ServerConfigurationOptionName.""" ALLOW_POLYBASE_EXPORT = "allowPolybaseExport" + """allowPolybaseExport.""" class ServerConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The server connection type.""" DEFAULT = "Default" + """Default.""" REDIRECT = "Redirect" + """Redirect.""" PROXY = "Proxy" + """Proxy.""" class ServerCreateMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Create mode for server, only valid values for this are Normal and Restore.""" NORMAL = "Normal" + """Normal.""" RESTORE = "Restore" + """Restore.""" class ServerKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The encryption protector type like 'ServiceManaged', 'AzureKeyVault'.""" SERVICE_MANAGED = "ServiceManaged" + """ServiceManaged.""" AZURE_KEY_VAULT = "AzureKeyVault" + """AzureKeyVault.""" class ServerNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1328,7 +1844,9 @@ class ServerNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class ServerPublicNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1337,17 +1855,22 @@ class ServerPublicNetworkAccessFlag(str, Enum, metaclass=CaseInsensitiveEnumMeta """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" SECURED_BY_PERIMETER = "SecuredByPerimeter" + """SecuredByPerimeter.""" class ServerTrustGroupPropertiesTrustScopesItem( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): - """ServerTrustGroupPropertiesTrustScopesItem.""" + """Type of ServerTrustGroupPropertiesTrustScopesItem.""" GLOBAL_TRANSACTIONS = "GlobalTransactions" + """GlobalTransactions.""" SERVICE_BROKER = "ServiceBroker" + """ServiceBroker.""" class ServerWorkspaceFeature(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1356,14 +1879,18 @@ class ServerWorkspaceFeature(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ CONNECTED = "Connected" + """Connected.""" DISCONNECTED = "Disconnected" + """Disconnected.""" class ServicePrincipalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Service principal type.""" NONE = "None" + """None.""" SYSTEM_ASSIGNED = "SystemAssigned" + """SystemAssigned.""" class SetLegalHoldImmutability(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1372,26 +1899,32 @@ class SetLegalHoldImmutability(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class ShortTermRetentionPolicyName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ShortTermRetentionPolicyName.""" + """Type of ShortTermRetentionPolicyName.""" DEFAULT = "default" + """default.""" class SqlAgentConfigurationPropertiesState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of Sql Agent.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class SqlVulnerabilityAssessmentName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SqlVulnerabilityAssessmentName.""" + """Type of SqlVulnerabilityAssessmentName.""" DEFAULT = "default" + """default.""" class SqlVulnerabilityAssessmentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1400,119 +1933,173 @@ class SqlVulnerabilityAssessmentState(str, Enum, metaclass=CaseInsensitiveEnumMe """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class StartStopScheduleName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """StartStopScheduleName.""" + """Type of StartStopScheduleName.""" DEFAULT = "default" + """default.""" class StorageCapabilityStorageAccountType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The storage account type for the database's backups.""" GRS = "GRS" + """GRS.""" LRS = "LRS" + """LRS.""" ZRS = "ZRS" + """ZRS.""" GZRS = "GZRS" + """GZRS.""" class StorageKeyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity.""" SHARED_ACCESS_KEY = "SharedAccessKey" + """SharedAccessKey.""" STORAGE_ACCESS_KEY = "StorageAccessKey" + """StorageAccessKey.""" MANAGED_IDENTITY = "ManagedIdentity" + """ManagedIdentity.""" class SyncAgentState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """State of the sync agent.""" ONLINE = "Online" + """Online.""" OFFLINE = "Offline" + """Offline.""" NEVER_CONNECTED = "NeverConnected" + """NeverConnected.""" class SyncConflictResolutionPolicy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Conflict resolution policy of the sync group.""" HUB_WIN = "HubWin" + """HubWin.""" MEMBER_WIN = "MemberWin" + """MemberWin.""" class SyncDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sync direction of the sync member.""" BIDIRECTIONAL = "Bidirectional" + """Bidirectional.""" ONE_WAY_MEMBER_TO_HUB = "OneWayMemberToHub" + """OneWayMemberToHub.""" ONE_WAY_HUB_TO_MEMBER = "OneWayHubToMember" + """OneWayHubToMember.""" class SyncGroupLogType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the sync group log.""" ALL = "All" + """All.""" ERROR = "Error" + """Error.""" WARNING = "Warning" + """Warning.""" SUCCESS = "Success" + """Success.""" class SyncGroupState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sync state of the sync group.""" NOT_READY = "NotReady" + """NotReady.""" ERROR = "Error" + """Error.""" WARNING = "Warning" + """Warning.""" PROGRESSING = "Progressing" + """Progressing.""" GOOD = "Good" + """Good.""" class SyncGroupsType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """SyncGroupsType.""" + """Type of SyncGroupsType.""" ALL = "All" + """All.""" ERROR = "Error" + """Error.""" WARNING = "Warning" + """Warning.""" SUCCESS = "Success" + """Success.""" class SyncMemberDbType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Type of the sync agent linked database.""" AZURE_SQL_DATABASE = "AzureSqlDatabase" + """AzureSqlDatabase.""" SQL_SERVER_DATABASE = "SqlServerDatabase" + """SqlServerDatabase.""" class SyncMemberState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sync state of the sync member.""" SYNC_IN_PROGRESS = "SyncInProgress" + """SyncInProgress.""" SYNC_SUCCEEDED = "SyncSucceeded" + """SyncSucceeded.""" SYNC_FAILED = "SyncFailed" + """SyncFailed.""" DISABLED_TOMBSTONE_CLEANUP = "DisabledTombstoneCleanup" + """DisabledTombstoneCleanup.""" DISABLED_BACKUP_RESTORE = "DisabledBackupRestore" + """DisabledBackupRestore.""" SYNC_SUCCEEDED_WITH_WARNINGS = "SyncSucceededWithWarnings" + """SyncSucceededWithWarnings.""" SYNC_CANCELLING = "SyncCancelling" + """SyncCancelling.""" SYNC_CANCELLED = "SyncCancelled" + """SyncCancelled.""" UN_PROVISIONED = "UnProvisioned" + """UnProvisioned.""" PROVISIONING = "Provisioning" + """Provisioning.""" PROVISIONED = "Provisioned" + """Provisioned.""" PROVISION_FAILED = "ProvisionFailed" + """ProvisionFailed.""" DE_PROVISIONING = "DeProvisioning" + """DeProvisioning.""" DE_PROVISIONED = "DeProvisioned" + """DeProvisioned.""" DE_PROVISION_FAILED = "DeProvisionFailed" + """DeProvisionFailed.""" REPROVISIONING = "Reprovisioning" + """Reprovisioning.""" REPROVISION_FAILED = "ReprovisionFailed" + """ReprovisionFailed.""" UN_REPROVISIONED = "UnReprovisioned" + """UnReprovisioned.""" class TableTemporalType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The table temporal type.""" NON_TEMPORAL_TABLE = "NonTemporalTable" + """NonTemporalTable.""" HISTORY_TABLE = "HistoryTable" + """HistoryTable.""" SYSTEM_VERSIONED_TEMPORAL_TABLE = "SystemVersionedTemporalTable" + """SystemVersionedTemporalTable.""" class TimeBasedImmutability(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -1522,90 +2109,133 @@ class TimeBasedImmutability(str, Enum, metaclass=CaseInsensitiveEnumMeta): """ ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class TimeBasedImmutabilityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The time-based immutability mode. Only applicable if time-based immutability is enabled.""" LOCKED = "Locked" + """Locked.""" UNLOCKED = "Unlocked" + """Unlocked.""" class TransparentDataEncryptionName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """TransparentDataEncryptionName.""" + """Type of TransparentDataEncryptionName.""" CURRENT = "current" + """current.""" class TransparentDataEncryptionScanState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the encryption scan state of the transparent data encryption.""" NONE = "None" + """None.""" RESUME = "Resume" + """Resume.""" RUNNING = "Running" + """Running.""" SUSPEND = "Suspend" + """Suspend.""" ABORTED = "Aborted" + """Aborted.""" COMPLETED = "Completed" + """Completed.""" class TransparentDataEncryptionState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Specifies the state of the transparent data encryption.""" ENABLED = "Enabled" + """Enabled.""" DISABLED = "Disabled" + """Disabled.""" class UpsertManagedServerOperationStepWithEstimatesAndDurationStatus( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): - """UpsertManagedServerOperationStepWithEstimatesAndDurationStatus.""" + """Type of UpsertManagedServerOperationStepWithEstimatesAndDurationStatus.""" NOT_STARTED = "NotStarted" + """NotStarted.""" IN_PROGRESS = "InProgress" + """InProgress.""" SLOWED_DOWN = "SlowedDown" + """SlowedDown.""" COMPLETED = "Completed" + """Completed.""" FAILED = "Failed" + """Failed.""" CANCELED = "Canceled" + """Canceled.""" class VirtualNetworkRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Virtual Network Rule State.""" INITIALIZING = "Initializing" + """Initializing.""" IN_PROGRESS = "InProgress" + """InProgress.""" READY = "Ready" + """Ready.""" FAILED = "Failed" + """Failed.""" DELETING = "Deleting" + """Deleting.""" UNKNOWN = "Unknown" + """Unknown.""" class VulnerabilityAssessmentName(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """VulnerabilityAssessmentName.""" + """Type of VulnerabilityAssessmentName.""" DEFAULT = "default" + """default.""" class VulnerabilityAssessmentPolicyBaselineName( # pylint: disable=name-too-long str, Enum, metaclass=CaseInsensitiveEnumMeta ): - """VulnerabilityAssessmentPolicyBaselineName.""" + """Type of VulnerabilityAssessmentPolicyBaselineName.""" MASTER = "master" + """master.""" DEFAULT = "default" + """default.""" class VulnerabilityAssessmentScanState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The scan status.""" PASSED = "Passed" + """Passed.""" FAILED = "Failed" + """Failed.""" FAILED_TO_RUN = "FailedToRun" + """FailedToRun.""" IN_PROGRESS = "InProgress" + """InProgress.""" class VulnerabilityAssessmentScanTriggerType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The scan trigger type.""" ON_DEMAND = "OnDemand" + """OnDemand.""" RECURRING = "Recurring" + """Recurring.""" + + +class VulnerabilityAssessmentSystemDatabaseName( # pylint: disable=name-too-long + str, Enum, metaclass=CaseInsensitiveEnumMeta +): + """Type of VulnerabilityAssessmentSystemDatabaseName.""" + + MASTER = "master" + """master.""" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py new file mode 100644 index 000000000000..102ec0105b42 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py @@ -0,0 +1,25279 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +# pylint: disable=useless-super-delegation + +import datetime +from typing import Any, Mapping, Optional, TYPE_CHECKING, Union, overload + +from .._utils.model_base import Model as _Model, rest_field + +if TYPE_CHECKING: + from .. import models as _models + + +class AdministratorProperties(_Model): + """Properties of a active directory administrator. + + :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" + :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :ivar login: Login name of the server administrator. Required. + :vartype login: str + :ivar sid: SID (object ID) of the server administrator. Required. + :vartype sid: str + :ivar tenant_id: Tenant ID of the administrator. + :vartype tenant_id: str + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. + :vartype azure_ad_only_authentication: bool + """ + + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = rest_field( + name="administratorType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the sever administrator. \"ActiveDirectory\"""" + login: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Login name of the server administrator. Required.""" + sid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SID (object ID) of the server administrator. Required.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the administrator.""" + azure_ad_only_authentication: Optional[bool] = rest_field(name="azureADOnlyAuthentication", visibility=["read"]) + """Azure Active Directory only Authentication enabled.""" + + @overload + def __init__( + self, + *, + login: str, + sid: str, + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AdvancedThreatProtectionProperties(_Model): + """Properties of an Advanced Threat Protection state. + + :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or + disabled or a state has not been applied yet on the specific database or server. Required. + Known values are: "New", "Enabled", and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState + :ivar creation_time: Specifies the UTC creation time of the policy. + :vartype creation_time: ~datetime.datetime + """ + + state: Union[str, "_models.AdvancedThreatProtectionState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the Advanced Threat Protection, whether it is enabled or disabled or a + state has not been applied yet on the specific database or server. Required. Known values are: + \"New\", \"Enabled\", and \"Disabled\".""" + creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339") + """Specifies the UTC creation time of the policy.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.AdvancedThreatProtectionState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Resource(_Model): + """Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the resource.""" + type: Optional[str] = rest_field(visibility=["read"]) + """The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or + \"Microsoft.Storage/storageAccounts\".""" + system_data: Optional["_models.ArmSystemData"] = rest_field(name="systemData", visibility=["read"]) + """Azure Resource Manager metadata containing createdBy and modifiedBy information.""" + + +class ProxyResource(Resource): + """Proxy Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + """ + + +class Advisor(ProxyResource): + """Database, Server or Elastic Pool Advisor. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdvisorProperties + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.AdvisorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Resource kind.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "advisor_status", + "auto_execute_status", + "auto_execute_status_inherited_from", + "recommendations_status", + "last_checked", + "recommended_actions", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdvisorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class AdvisorProperties(_Model): + """Properties for a Database, Server or Elastic Pool Advisor. + + :ivar advisor_status: Gets the status of availability of this advisor to customers. Possible + values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Known values + are: "GA", "PublicPreview", "LimitedPublicPreview", and "PrivatePreview". + :vartype advisor_status: str or ~azure.mgmt.sql.models.AdvisorStatus + :ivar auto_execute_status: Gets the auto-execute status (whether to let the system execute the + recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Required. Known + values are: "Enabled", "Disabled", and "Default". + :vartype auto_execute_status: str or ~azure.mgmt.sql.models.AutoExecuteStatus + :ivar auto_execute_status_inherited_from: Gets the resource from which current value of + auto-execute status is inherited. Auto-execute status can be set on (and inherited from) + different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', + 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Known + values are: "Default", "Subscription", "Server", "ElasticPool", and "Database". + :vartype auto_execute_status_inherited_from: str or + ~azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom + :ivar recommendations_status: Gets that status of recommendations for this advisor and reason + for not having any recommendations. Possible values include, but are not limited to, 'Ok' + (Recommendations available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' + (Database is doing well), etc. + :vartype recommendations_status: str + :ivar last_checked: Gets the time when the current resource was analyzed for recommendations by + this advisor. + :vartype last_checked: ~datetime.datetime + :ivar recommended_actions: Gets the recommended actions for this advisor. + :vartype recommended_actions: list[~azure.mgmt.sql.models.RecommendedAction] + """ + + advisor_status: Optional[Union[str, "_models.AdvisorStatus"]] = rest_field( + name="advisorStatus", visibility=["read"] + ) + """Gets the status of availability of this advisor to customers. Possible values are 'GA', + 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Known values are: \"GA\", + \"PublicPreview\", \"LimitedPublicPreview\", and \"PrivatePreview\".""" + auto_execute_status: Union[str, "_models.AutoExecuteStatus"] = rest_field( + name="autoExecuteStatus", visibility=["read", "create", "update", "delete", "query"] + ) + """Gets the auto-execute status (whether to let the system execute the recommendations) of this + advisor. Possible values are 'Enabled' and 'Disabled'. Required. Known values are: \"Enabled\", + \"Disabled\", and \"Default\".""" + auto_execute_status_inherited_from: Optional[Union[str, "_models.AutoExecuteStatusInheritedFrom"]] = rest_field( + name="autoExecuteStatusInheritedFrom", visibility=["read"] + ) + """Gets the resource from which current value of auto-execute status is inherited. Auto-execute + status can be set on (and inherited from) different levels in the resource hierarchy. Possible + values are 'Subscription', 'Server', 'ElasticPool', 'Database' and 'Default' (when status is + not explicitly set on any level). Known values are: \"Default\", \"Subscription\", \"Server\", + \"ElasticPool\", and \"Database\".""" + recommendations_status: Optional[str] = rest_field(name="recommendationsStatus", visibility=["read"]) + """Gets that status of recommendations for this advisor and reason for not having any + recommendations. Possible values include, but are not limited to, 'Ok' (Recommendations + available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' (Database is doing + well), etc.""" + last_checked: Optional[datetime.datetime] = rest_field(name="lastChecked", visibility=["read"], format="rfc3339") + """Gets the time when the current resource was analyzed for recommendations by this advisor.""" + recommended_actions: Optional[list["_models.RecommendedAction"]] = rest_field( + name="recommendedActions", visibility=["read"] + ) + """Gets the recommended actions for this advisor.""" + + @overload + def __init__( + self, + *, + auto_execute_status: Union[str, "_models.AutoExecuteStatus"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ArmSystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutomaticTuningOptions(_Model): + """Automatic tuning properties for individual advisors. + + :ivar desired_state: Automatic tuning option desired state. Known values are: "Off", "On", and + "Default". + :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired + :ivar actual_state: Automatic tuning option actual state. Known values are: "Off" and "On". + :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeActual + :ivar reason_code: Reason code if desired and actual state are different. + :vartype reason_code: int + :ivar reason_desc: Reason description if desired and actual state are different. Known values + are: "Default", "Disabled", "AutoConfigured", "InheritedFromServer", "QueryStoreOff", + "QueryStoreReadOnly", and "NotSupported". + :vartype reason_desc: str or ~azure.mgmt.sql.models.AutomaticTuningDisabledReason + """ + + desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = rest_field( + name="desiredState", visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning option desired state. Known values are: \"Off\", \"On\", and \"Default\".""" + actual_state: Optional[Union[str, "_models.AutomaticTuningOptionModeActual"]] = rest_field( + name="actualState", visibility=["read"] + ) + """Automatic tuning option actual state. Known values are: \"Off\" and \"On\".""" + reason_code: Optional[int] = rest_field(name="reasonCode", visibility=["read"]) + """Reason code if desired and actual state are different.""" + reason_desc: Optional[Union[str, "_models.AutomaticTuningDisabledReason"]] = rest_field( + name="reasonDesc", visibility=["read"] + ) + """Reason description if desired and actual state are different. Known values are: \"Default\", + \"Disabled\", \"AutoConfigured\", \"InheritedFromServer\", \"QueryStoreOff\", + \"QueryStoreReadOnly\", and \"NotSupported\".""" + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutomaticTuningServerOptions(_Model): + """Automatic tuning properties for individual advisors. + + :ivar desired_state: Automatic tuning option desired state. Known values are: "Off", "On", and + "Default". + :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired + :ivar actual_state: Automatic tuning option actual state. Known values are: "Off" and "On". + :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeActual + :ivar reason_code: Reason code if desired and actual state are different. + :vartype reason_code: int + :ivar reason_desc: Reason description if desired and actual state are different. Known values + are: "Default", "Disabled", and "AutoConfigured". + :vartype reason_desc: str or ~azure.mgmt.sql.models.AutomaticTuningServerReason + """ + + desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = rest_field( + name="desiredState", visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning option desired state. Known values are: \"Off\", \"On\", and \"Default\".""" + actual_state: Optional[Union[str, "_models.AutomaticTuningOptionModeActual"]] = rest_field( + name="actualState", visibility=["read"] + ) + """Automatic tuning option actual state. Known values are: \"Off\" and \"On\".""" + reason_code: Optional[int] = rest_field(name="reasonCode", visibility=["read"]) + """Reason code if desired and actual state are different.""" + reason_desc: Optional[Union[str, "_models.AutomaticTuningServerReason"]] = rest_field( + name="reasonDesc", visibility=["read"] + ) + """Reason description if desired and actual state are different. Known values are: \"Default\", + \"Disabled\", and \"AutoConfigured\".""" + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutomaticTuningServerProperties(_Model): + """Server-level Automatic Tuning properties. + + :ivar desired_state: Automatic tuning desired state. Known values are: "Custom", "Auto", and + "Unspecified". + :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningServerMode + :ivar actual_state: Automatic tuning actual state. Known values are: "Custom", "Auto", and + "Unspecified". + :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningServerMode + :ivar options: Automatic tuning options definition. + :vartype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningServerOptions] + """ + + desired_state: Optional[Union[str, "_models.AutomaticTuningServerMode"]] = rest_field( + name="desiredState", visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning desired state. Known values are: \"Custom\", \"Auto\", and \"Unspecified\".""" + actual_state: Optional[Union[str, "_models.AutomaticTuningServerMode"]] = rest_field( + name="actualState", visibility=["read"] + ) + """Automatic tuning actual state. Known values are: \"Custom\", \"Auto\", and \"Unspecified\".""" + options: Optional[dict[str, "_models.AutomaticTuningServerOptions"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning options definition.""" + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, "_models.AutomaticTuningServerMode"]] = None, + options: Optional[dict[str, "_models.AutomaticTuningServerOptions"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class AutoPauseDelayTimeRange(_Model): + """Supported auto pause delay time range. + + :ivar min_value: Minimum value. + :vartype min_value: int + :ivar max_value: Maximum value. + :vartype max_value: int + :ivar step_size: Step value for discrete values between the minimum value and the maximum + value. + :vartype step_size: int + :ivar default: Default value is no value is provided. + :vartype default: int + :ivar unit: Unit of time that delay is expressed in. "Minutes" + :vartype unit: str or ~azure.mgmt.sql.models.PauseDelayTimeUnit + :ivar do_not_pause_value: Value that is used to not pause (infinite delay before pause). + :vartype do_not_pause_value: int + """ + + min_value: Optional[int] = rest_field(name="minValue", visibility=["read"]) + """Minimum value.""" + max_value: Optional[int] = rest_field(name="maxValue", visibility=["read"]) + """Maximum value.""" + step_size: Optional[int] = rest_field(name="stepSize", visibility=["read"]) + """Step value for discrete values between the minimum value and the maximum value.""" + default: Optional[int] = rest_field(visibility=["read"]) + """Default value is no value is provided.""" + unit: Optional[Union[str, "_models.PauseDelayTimeUnit"]] = rest_field(visibility=["read"]) + """Unit of time that delay is expressed in. \"Minutes\"""" + do_not_pause_value: Optional[int] = rest_field(name="doNotPauseValue", visibility=["read"]) + """Value that is used to not pause (infinite delay before pause).""" + + +class AzureADOnlyAuthProperties(_Model): + """Properties of a active directory only authentication. + + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. + Required. + :vartype azure_ad_only_authentication: bool + """ + + azure_ad_only_authentication: bool = rest_field( + name="azureADOnlyAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Active Directory only Authentication enabled. Required.""" + + @overload + def __init__( + self, + *, + azure_ad_only_authentication: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class BackupShortTermRetentionPolicy(ProxyResource): + """A short term retention policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicyProperties + """ + + properties: Optional["_models.BackupShortTermRetentionPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["retention_days", "diff_backup_interval_in_hours"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.BackupShortTermRetentionPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class BackupShortTermRetentionPolicyProperties(_Model): + """Properties of a short term retention policy. + + :ivar retention_days: The backup retention period in days. This is how many days Point-in-Time + Restore will be supported. + :vartype retention_days: int + :ivar diff_backup_interval_in_hours: The differential backup interval in hours. This is how + many interval hours between each differential backup will be supported. This is only applicable + to live databases but not dropped databases. Known values are: 12 and 24. + :vartype diff_backup_interval_in_hours: int or ~azure.mgmt.sql.models.DiffBackupIntervalInHours + """ + + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The backup retention period in days. This is how many days Point-in-Time Restore will be + supported.""" + diff_backup_interval_in_hours: Optional[Union[int, "_models.DiffBackupIntervalInHours"]] = rest_field( + name="diffBackupIntervalInHours", visibility=["read", "create", "update", "delete", "query"] + ) + """The differential backup interval in hours. This is how many interval hours between each + differential backup will be supported. This is only applicable to live databases but not + dropped databases. Known values are: 12 and 24.""" + + @overload + def __init__( + self, + *, + retention_days: Optional[int] = None, + diff_backup_interval_in_hours: Optional[Union[int, "_models.DiffBackupIntervalInHours"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Baseline(_Model): + """SQL Vulnerability Assessment baseline Details. + + :ivar expected_results: SQL Vulnerability Assessment baseline expected results. + :vartype expected_results: list[list[str]] + :ivar updated_time: SQL Vulnerability Assessment baseline update time (UTC). + :vartype updated_time: ~datetime.datetime + """ + + expected_results: Optional[list[list[str]]] = rest_field(name="expectedResults", visibility=["read"]) + """SQL Vulnerability Assessment baseline expected results.""" + updated_time: Optional[datetime.datetime] = rest_field(name="updatedTime", visibility=["read"], format="rfc3339") + """SQL Vulnerability Assessment baseline update time (UTC).""" + + +class BaselineAdjustedResult(_Model): + """SQL Vulnerability Assessment baseline adjusted results. + + :ivar baseline: SQL Vulnerability Assessment baseline details. + :vartype baseline: ~azure.mgmt.sql.models.Baseline + :ivar status: SQL Vulnerability Assessment baseline status. Known values are: "NonFinding", + "Finding", and "InternalError". + :vartype status: str or ~azure.mgmt.sql.models.RuleStatus + :ivar results_not_in_baseline: SQL Vulnerability Assessment results that are not in baseline. + :vartype results_not_in_baseline: list[list[str]] + :ivar results_only_in_baseline: SQL Vulnerability Assessment results that are in baseline. + :vartype results_only_in_baseline: list[list[str]] + """ + + baseline: Optional["_models.Baseline"] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment baseline details.""" + status: Optional[Union[str, "_models.RuleStatus"]] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment baseline status. Known values are: \"NonFinding\", \"Finding\", + and \"InternalError\".""" + results_not_in_baseline: Optional[list[list[str]]] = rest_field(name="resultsNotInBaseline", visibility=["read"]) + """SQL Vulnerability Assessment results that are not in baseline.""" + results_only_in_baseline: Optional[list[list[str]]] = rest_field(name="resultsOnlyInBaseline", visibility=["read"]) + """SQL Vulnerability Assessment results that are in baseline.""" + + +class BenchmarkReference(_Model): + """SQL Vulnerability Assessment benchmark reference. + + :ivar benchmark: SQL Vulnerability Assessment benchmark name. + :vartype benchmark: str + :ivar reference: SQL Vulnerability Assessment benchmark reference. + :vartype reference: str + """ + + benchmark: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment benchmark name.""" + reference: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment benchmark reference.""" + + +class CertificateInfo(_Model): + """Certificate information. + + :ivar certificate_name: The certificate name. + :vartype certificate_name: str + :ivar expiry_date: The certificate expiry date. + :vartype expiry_date: ~datetime.datetime + """ + + certificate_name: Optional[str] = rest_field(name="certificateName", visibility=["read"]) + """The certificate name.""" + expiry_date: Optional[datetime.datetime] = rest_field(name="expiryDate", visibility=["read"], format="rfc3339") + """The certificate expiry date.""" + + +class ChangeLongTermRetentionBackupAccessTierParameters(_Model): # pylint: disable=name-too-long + """Contains the information necessary to change long term retention backup access tier and related + operation mode. + + :ivar backup_storage_access_tier: The long term retention backup storage access tier. Required. + :vartype backup_storage_access_tier: str + :ivar operation_mode: The operation mode when updating ltr backup storage access tier. + Required. + :vartype operation_mode: str + """ + + backup_storage_access_tier: str = rest_field( + name="backupStorageAccessTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The long term retention backup storage access tier. Required.""" + operation_mode: str = rest_field(name="operationMode", visibility=["read", "create", "update", "delete", "query"]) + """The operation mode when updating ltr backup storage access tier. Required.""" + + @overload + def __init__( + self, + *, + backup_storage_access_tier: str, + operation_mode: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckNameAvailabilityRequest(_Model): + """A request to check whether the specified name for a resource is available. + + :ivar name: Required. + :vartype name: str + :ivar type: Required. "Microsoft.Sql/servers" + :vartype type: str or ~azure.mgmt.sql.models.CheckNameAvailabilityResourceType + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Required.""" + type: Union[str, "_models.CheckNameAvailabilityResourceType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. \"Microsoft.Sql/servers\"""" + + @overload + def __init__( + self, + *, + name: str, + type: Union[str, "_models.CheckNameAvailabilityResourceType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CheckNameAvailabilityResponse(_Model): + """The result of a name availability check. + + :ivar name: The name whose availability was checked. + :vartype name: str + :ivar available: True if the name is available, otherwise false. + :vartype available: bool + :ivar reason: The reason code explaining why the name is unavailable. Will be undefined if the + name is available. Known values are: "Invalid" and "AlreadyExists". + :vartype reason: str or ~azure.mgmt.sql.models.CheckNameAvailabilityReason + :ivar message: A message explaining why the name is unavailable. Will be undefined if the name + is available. + :vartype message: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name whose availability was checked.""" + available: Optional[bool] = rest_field(visibility=["read"]) + """True if the name is available, otherwise false.""" + reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = rest_field(visibility=["read"]) + """The reason code explaining why the name is unavailable. Will be undefined if the name is + available. Known values are: \"Invalid\" and \"AlreadyExists\".""" + message: Optional[str] = rest_field(visibility=["read"]) + """A message explaining why the name is unavailable. Will be undefined if the name is available.""" + + +class CompleteDatabaseRestoreDefinition(_Model): + """Contains the information necessary to perform a complete database restore operation. + + :ivar last_backup_name: The last backup name to apply. Required. + :vartype last_backup_name: str + """ + + last_backup_name: str = rest_field( + name="lastBackupName", visibility=["read", "create", "update", "delete", "query"] + ) + """The last backup name to apply. Required.""" + + @overload + def __init__( + self, + *, + last_backup_name: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CopyLongTermRetentionBackupParameters(_Model): + """Contains the information necessary to perform long term retention backup copy operation. + + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParametersProperties + """ + + properties: Optional["_models.CopyLongTermRetentionBackupParametersProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "target_subscription_id", + "target_resource_group", + "target_server_resource_id", + "target_server_fully_qualified_domain_name", + "target_database_name", + "target_backup_storage_redundancy", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.CopyLongTermRetentionBackupParametersProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class CopyLongTermRetentionBackupParametersProperties(_Model): # pylint: disable=name-too-long + """Contains the properties to perform long term retention backup copy operation. + + :ivar target_subscription_id: The subscription that owns the target server. + :vartype target_subscription_id: str + :ivar target_resource_group: The resource group that owns the target server. + :vartype target_resource_group: str + :ivar target_server_resource_id: The resource Id of the target server that owns the database. + :vartype target_server_resource_id: str + :ivar target_server_fully_qualified_domain_name: The fully qualified domain name of the target + server. + :vartype target_server_fully_qualified_domain_name: str + :ivar target_database_name: The name of the database owns the copied backup. + :vartype target_database_name: str + :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. Known + values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype target_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + """ + + target_subscription_id: Optional[str] = rest_field(name="targetSubscriptionId", visibility=["create"]) + """The subscription that owns the target server.""" + target_resource_group: Optional[str] = rest_field(name="targetResourceGroup", visibility=["create"]) + """The resource group that owns the target server.""" + target_server_resource_id: Optional[str] = rest_field(name="targetServerResourceId", visibility=["create"]) + """The resource Id of the target server that owns the database.""" + target_server_fully_qualified_domain_name: Optional[str] = rest_field( + name="targetServerFullyQualifiedDomainName", visibility=["create"] + ) + """The fully qualified domain name of the target server.""" + target_database_name: Optional[str] = rest_field(name="targetDatabaseName", visibility=["create"]) + """The name of the database owns the copied backup.""" + target_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="targetBackupStorageRedundancy", visibility=["create"] + ) + """The storage redundancy type of the copied backup. Known values are: \"Geo\", \"Local\", + \"Zone\", and \"GeoZone\".""" + + @overload + def __init__( + self, + *, + target_subscription_id: Optional[str] = None, + target_resource_group: Optional[str] = None, + target_server_resource_id: Optional[str] = None, + target_server_fully_qualified_domain_name: Optional[str] = None, + target_database_name: Optional[str] = None, + target_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class CreateDatabaseRestorePointDefinition(_Model): + """Contains the information necessary to perform a create database restore point operation. + + :ivar restore_point_label: The restore point label to apply. Required. + :vartype restore_point_label: str + """ + + restore_point_label: str = rest_field( + name="restorePointLabel", visibility=["read", "create", "update", "delete", "query"] + ) + """The restore point label to apply. Required.""" + + @overload + def __init__( + self, + *, + restore_point_label: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TrackedResource(Resource): + """Tracked Resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + """ + + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: str = rest_field(visibility=["read", "create"]) + """The geo-location where the resource lives. Required.""" + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Database(TrackedResource): + """A database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseProperties + :ivar sku: The database SKU. + + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU + name, tier/edition, family, and capacity) that are available to your subscription in an Azure + region, use the ``Capabilities_ListByLocation`` REST API or one of the following commands: + + + + .. code-block:: azurecli + + az sql db list-editions -l -o table + + + + .. code-block:: powershell + + Get-AzSqlServerServiceObjective -Location . + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar kind: Kind of database. This is metadata used for the Azure portal experience. + :vartype kind: str + :ivar managed_by: Resource that manages the database. + :vartype managed_by: str + :ivar identity: The Azure Active Directory identity of the database. + :vartype identity: ~azure.mgmt.sql.models.DatabaseIdentity + """ + + properties: Optional["_models.DatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The database SKU. + + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU + name, tier/edition, family, and capacity) that are available to your subscription in an Azure + region, use the ``Capabilities_ListByLocation`` REST API or one of the following commands: + + + + .. code-block:: azurecli + + az sql db list-editions -l -o table + + + + .. code-block:: powershell + + Get-AzSqlServerServiceObjective -Location .""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of database. This is metadata used for the Azure portal experience.""" + managed_by: Optional[str] = rest_field(name="managedBy", visibility=["read"]) + """Resource that manages the database.""" + identity: Optional["_models.DatabaseIdentity"] = rest_field(visibility=["read", "create"]) + """The Azure Active Directory identity of the database.""" + + __flattened_items = [ + "create_mode", + "collation", + "max_size_bytes", + "sample_name", + "elastic_pool_id", + "source_database_id", + "status", + "database_id", + "creation_date", + "current_service_objective_name", + "requested_service_objective_name", + "default_secondary_location", + "failover_group_id", + "restore_point_in_time", + "source_database_deletion_date", + "recovery_services_recovery_point_id", + "long_term_retention_backup_resource_id", + "recoverable_database_id", + "restorable_dropped_database_id", + "catalog_collation", + "zone_redundant", + "license_type", + "max_log_size_bytes", + "earliest_restore_date", + "read_scale", + "high_availability_replica_count", + "secondary_type", + "current_sku", + "auto_pause_delay", + "current_backup_storage_redundancy", + "requested_backup_storage_redundancy", + "min_capacity", + "paused_date", + "resumed_date", + "maintenance_configuration_id", + "is_ledger_on", + "is_infra_encryption_enabled", + "federated_client_id", + "keys_property", + "encryption_protector", + "preferred_enclave_type", + "use_free_limit", + "free_limit_exhaustion_behavior", + "source_resource_id", + "manual_cutover", + "perform_cutover", + "availability_zone", + "encryption_protector_auto_rotation", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.DatabaseProperties"] = None, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.DatabaseIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseAdvancedThreatProtection(ProxyResource): + """A database Advanced Threat Protection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdvancedThreatProtectionProperties + """ + + properties: Optional["_models.AdvancedThreatProtectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state", "creation_time"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdvancedThreatProtectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseAutomaticTuning(ProxyResource): + """Database-level Automatic Tuning. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseAutomaticTuningProperties + """ + + properties: Optional["_models.DatabaseAutomaticTuningProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["desired_state", "actual_state", "options"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseAutomaticTuningProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseAutomaticTuningProperties(_Model): + """Database-level Automatic Tuning properties. + + :ivar desired_state: Automatic tuning desired state. Known values are: "Inherit", "Custom", + "Auto", and "Unspecified". + :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningMode + :ivar actual_state: Automatic tuning actual state. Known values are: "Inherit", "Custom", + "Auto", and "Unspecified". + :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningMode + :ivar options: Automatic tuning options definition. + :vartype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningOptions] + """ + + desired_state: Optional[Union[str, "_models.AutomaticTuningMode"]] = rest_field( + name="desiredState", visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning desired state. Known values are: \"Inherit\", \"Custom\", \"Auto\", and + \"Unspecified\".""" + actual_state: Optional[Union[str, "_models.AutomaticTuningMode"]] = rest_field( + name="actualState", visibility=["read"] + ) + """Automatic tuning actual state. Known values are: \"Inherit\", \"Custom\", \"Auto\", and + \"Unspecified\".""" + options: Optional[dict[str, "_models.AutomaticTuningOptions"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Automatic tuning options definition.""" + + @overload + def __init__( + self, + *, + desired_state: Optional[Union[str, "_models.AutomaticTuningMode"]] = None, + options: Optional[dict[str, "_models.AutomaticTuningOptions"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseBlobAuditingPolicy(ProxyResource): + """A database blob auditing policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicyProperties + :ivar kind: Resource kind. + :vartype kind: str + """ + + properties: Optional["_models.DatabaseBlobAuditingPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Resource kind.""" + + __flattened_items = [ + "retention_days", + "audit_actions_and_groups", + "is_storage_secondary_key_in_use", + "is_azure_monitor_target_enabled", + "queue_delay_ms", + "is_managed_identity_in_use", + "state", + "storage_endpoint", + "storage_account_access_key", + "storage_account_subscription_id", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseBlobAuditingPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseBlobAuditingPolicyProperties(_Model): + """Properties of a database blob auditing policy. + + :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage + account. + :vartype retention_days: int + :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_. + :vartype audit_actions_and_groups: list[str] + :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the + storage's secondary key. + :vartype is_storage_secondary_key_in_use: bool + :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_azure_monitor_target_enabled: bool + :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. + :vartype queue_delay_ms: int + :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob + storage. + :vartype is_managed_identity_in_use: bool + :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). If state + is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + :vartype storage_account_access_key: str + :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. + :vartype storage_account_subscription_id: str + """ + + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the audit logs in the storage account.""" + audit_actions_and_groups: Optional[list[str]] = rest_field( + name="auditActionsAndGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_.""" + is_storage_secondary_key_in_use: Optional[bool] = rest_field( + name="isStorageSecondaryKeyInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether storageAccountAccessKey value is the storage's secondary key.""" + is_azure_monitor_target_enabled: Optional[bool] = rest_field( + name="isAzureMonitorTargetEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + queue_delay_ms: Optional[int] = rest_field( + name="queueDelayMs", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the amount of time in milliseconds that can elapse before audit actions are forced to + be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.""" + is_managed_identity_in_use: Optional[bool] = rest_field( + name="isManagedIdentityInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether Managed Identity is used to access blob storage.""" + state: Union[str, "_models.BlobAuditingPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled is required.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355).""" + storage_account_subscription_id: Optional[str] = rest_field( + name="storageAccountSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage subscription Id.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.BlobAuditingPolicyState"], + retention_days: Optional[int] = None, + audit_actions_and_groups: Optional[list[str]] = None, + is_storage_secondary_key_in_use: Optional[bool] = None, + is_azure_monitor_target_enabled: Optional[bool] = None, + queue_delay_ms: Optional[int] = None, + is_managed_identity_in_use: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + storage_account_subscription_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseColumn(ProxyResource): + """A database column resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseColumnProperties + """ + + properties: Optional["_models.DatabaseColumnProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["column_type", "temporal_type", "memory_optimized", "is_computed"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseColumnProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseColumnProperties(_Model): + """Database column properties. + + :ivar column_type: The column data type. Known values are: "image", "text", "uniqueidentifier", + "date", "time", "datetime2", "datetimeoffset", "tinyint", "smallint", "int", "smalldatetime", + "real", "money", "datetime", "float", "sql_variant", "ntext", "bit", "decimal", "numeric", + "smallmoney", "bigint", "hierarchyid", "geometry", "geography", "varbinary", "varchar", + "binary", "char", "timestamp", "nvarchar", "nchar", "xml", and "sysname". + :vartype column_type: str or ~azure.mgmt.sql.models.ColumnDataType + :ivar temporal_type: The table temporal type. Known values are: "NonTemporalTable", + "HistoryTable", and "SystemVersionedTemporalTable". + :vartype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :ivar memory_optimized: Whether or not the column belongs to a memory optimized table. + :vartype memory_optimized: bool + :ivar is_computed: Whether or not the column is computed. + :vartype is_computed: bool + """ + + column_type: Optional[Union[str, "_models.ColumnDataType"]] = rest_field( + name="columnType", visibility=["read", "create", "update", "delete", "query"] + ) + """The column data type. Known values are: \"image\", \"text\", \"uniqueidentifier\", \"date\", + \"time\", \"datetime2\", \"datetimeoffset\", \"tinyint\", \"smallint\", \"int\", + \"smalldatetime\", \"real\", \"money\", \"datetime\", \"float\", \"sql_variant\", \"ntext\", + \"bit\", \"decimal\", \"numeric\", \"smallmoney\", \"bigint\", \"hierarchyid\", \"geometry\", + \"geography\", \"varbinary\", \"varchar\", \"binary\", \"char\", \"timestamp\", \"nvarchar\", + \"nchar\", \"xml\", and \"sysname\".""" + temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = rest_field( + name="temporalType", visibility=["read", "create", "update", "delete", "query"] + ) + """The table temporal type. Known values are: \"NonTemporalTable\", \"HistoryTable\", and + \"SystemVersionedTemporalTable\".""" + memory_optimized: Optional[bool] = rest_field( + name="memoryOptimized", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the column belongs to a memory optimized table.""" + is_computed: Optional[bool] = rest_field( + name="isComputed", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the column is computed.""" + + @overload + def __init__( + self, + *, + column_type: Optional[Union[str, "_models.ColumnDataType"]] = None, + temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = None, + memory_optimized: Optional[bool] = None, + is_computed: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceAutoGenerated(_Model): + """ARM resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Resource ID.""" + name: Optional[str] = rest_field(visibility=["read"]) + """Resource name.""" + type: Optional[str] = rest_field(visibility=["read"]) + """Resource type.""" + + +class ProxyResourceAutoGenerated(ResourceAutoGenerated): + """ARM proxy resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + +class DatabaseExtensions(ProxyResourceAutoGenerated): + """An Import, Export, or PolybaseImport resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseExtensionsProperties + """ + + properties: Optional["_models.DatabaseExtensionsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "operation_mode", + "storage_key_type", + "storage_key", + "storage_uri", + "administrator_login", + "administrator_login_password", + "authentication_type", + "database_edition", + "service_objective_name", + "max_size_bytes", + "network_isolation", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseExtensionsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseExtensionsProperties(_Model): + """Contains the database information after a successful Import, Export, or PolybaseImport. + + :ivar operation_mode: Operation mode of the operation: Import, Export, or PolybaseImport. + Required. Known values are: "PolybaseImport", "Import", and "Export". + :vartype operation_mode: str or ~azure.mgmt.sql.models.OperationMode + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity. + Required. Known values are: "SharedAccessKey", "StorageAccessKey", and "ManagedIdentity". + :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype storage_key: str + :ivar storage_uri: Storage Uri for the storage account. Required. + :vartype storage_uri: str + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. + :vartype administrator_login: str + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :vartype administrator_login_password: str + :ivar authentication_type: Authentication type used to access the SQL: Sql, ADPassword or + ManagedIdentity. + :vartype authentication_type: str + :ivar database_edition: Database edition for the newly created database in the case of an + import operation. + :vartype database_edition: str + :ivar service_objective_name: Database service level objective for the newly created database + in the case of an import operation. + :vartype service_objective_name: str + :ivar max_size_bytes: Database max size in bytes for the newly created database in the case of + an import operation. + :vartype max_size_bytes: str + :ivar network_isolation: Optional resource information to enable network isolation for request. + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + operation_mode: Union[str, "_models.OperationMode"] = rest_field(name="operationMode", visibility=["create"]) + """Operation mode of the operation: Import, Export, or PolybaseImport. Required. Known values are: + \"PolybaseImport\", \"Import\", and \"Export\".""" + storage_key_type: Union[str, "_models.StorageKeyType"] = rest_field(name="storageKeyType", visibility=["create"]) + """Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity. Required. Known values + are: \"SharedAccessKey\", \"StorageAccessKey\", and \"ManagedIdentity\".""" + storage_key: str = rest_field(name="storageKey", visibility=["create"]) + """Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should + specify the Managed Identity's resource ID. Required.""" + storage_uri: str = rest_field(name="storageUri", visibility=["create"]) + """Storage Uri for the storage account. Required.""" + administrator_login: Optional[str] = rest_field(name="administratorLogin", visibility=["create"]) + """Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify + the Managed Identity's resource ID.""" + administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["create"]) + """Administrator login password. If AuthenticationType is ManagedIdentity, this field should not + be specified.""" + authentication_type: Optional[str] = rest_field(name="authenticationType", visibility=["create"]) + """Authentication type used to access the SQL: Sql, ADPassword or ManagedIdentity.""" + database_edition: Optional[str] = rest_field(name="databaseEdition", visibility=["create"]) + """Database edition for the newly created database in the case of an import operation.""" + service_objective_name: Optional[str] = rest_field(name="serviceObjectiveName", visibility=["create"]) + """Database service level objective for the newly created database in the case of an import + operation.""" + max_size_bytes: Optional[str] = rest_field(name="maxSizeBytes", visibility=["create"]) + """Database max size in bytes for the newly created database in the case of an import operation.""" + network_isolation: Optional["_models.NetworkIsolationSettings"] = rest_field( + name="networkIsolation", visibility=["create"] + ) + """Optional resource information to enable network isolation for request.""" + + @overload + def __init__( + self, + *, + operation_mode: Union[str, "_models.OperationMode"], + storage_key_type: Union[str, "_models.StorageKeyType"], + storage_key: str, + storage_uri: str, + administrator_login: Optional[str] = None, + administrator_login_password: Optional[str] = None, + authentication_type: Optional[str] = None, + database_edition: Optional[str] = None, + service_objective_name: Optional[str] = None, + max_size_bytes: Optional[str] = None, + network_isolation: Optional["_models.NetworkIsolationSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar type: The identity type. Known values are: "None" and "UserAssigned". + :vartype type: str or ~azure.mgmt.sql.models.DatabaseIdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :ivar user_assigned_identities: The resource ids of the user assigned identities to use. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.DatabaseUserIdentity] + """ + + type: Optional[Union[str, "_models.DatabaseIdentityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity type. Known values are: \"None\" and \"UserAssigned\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The Azure Active Directory tenant id.""" + user_assigned_identities: Optional[dict[str, "_models.DatabaseUserIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ids of the user assigned identities to use.""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.DatabaseIdentityType"]] = None, + user_assigned_identities: Optional[dict[str, "_models.DatabaseUserIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseKey(_Model): + """Database level key used for encryption at rest. + + :ivar type: The database key type. Only supported value is 'AzureKeyVault'. "AzureKeyVault" + :vartype type: str or ~azure.mgmt.sql.models.DatabaseKeyType + :ivar thumbprint: Thumbprint of the database key. + :vartype thumbprint: str + :ivar creation_date: The database key creation date. + :vartype creation_date: ~datetime.datetime + :ivar subregion: Subregion of the server key. + :vartype subregion: str + :ivar key_version: The database key's version. + :vartype key_version: str + """ + + type: Optional[Union[str, "_models.DatabaseKeyType"]] = rest_field(visibility=["read"]) + """The database key type. Only supported value is 'AzureKeyVault'. \"AzureKeyVault\"""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the database key.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The database key creation date.""" + subregion: Optional[str] = rest_field(visibility=["read"]) + """Subregion of the server key.""" + key_version: Optional[str] = rest_field(name="keyVersion", visibility=["read"]) + """The database key's version.""" + + +class DatabaseOperation(ProxyResourceAutoGenerated): + """A database operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseOperationProperties + """ + + properties: Optional["_models.DatabaseOperationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "database_name", + "operation", + "operation_friendly_name", + "percent_complete", + "server_name", + "start_time", + "state", + "error_code", + "error_description", + "error_severity", + "is_user_error", + "estimated_completion_time", + "description", + "is_cancellable", + "operation_phase_details", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseOperationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseOperationProperties(_Model): + """The properties of a database operation. + + :ivar database_name: The name of the database the operation is being performed on. + :vartype database_name: str + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar server_name: The name of the server. + :vartype server_name: str + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + :ivar operation_phase_details: The operation phase details. + :vartype operation_phase_details: ~azure.mgmt.sql.models.PhaseDetails + """ + + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database the operation is being performed on.""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the operation completed.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """The name of the server.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[Union[str, "_models.ManagementOperationState"]] = rest_field(visibility=["read"]) + """The operation state. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", + \"CancelInProgress\", and \"Cancelled\".""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + is_user_error: Optional[bool] = rest_field(name="isUserError", visibility=["read"]) + """Whether or not the error is a user error.""" + estimated_completion_time: Optional[datetime.datetime] = rest_field( + name="estimatedCompletionTime", visibility=["read"], format="rfc3339" + ) + """The estimated completion time of the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The operation description.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Whether the operation can be cancelled.""" + operation_phase_details: Optional["_models.PhaseDetails"] = rest_field( + name="operationPhaseDetails", visibility=["read"] + ) + """The operation phase details.""" + + +class DatabaseProperties(_Model): + """The database's properties. + + :ivar create_mode: Specifies the mode of database creation. + + Default: regular database creation. + + Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified + as the resource ID of the source database. + + Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId + must be specified as the resource ID of the existing primary database. + + PointInTimeRestore: Creates a database by restoring a point in time backup of an existing + database. sourceDatabaseId must be specified as the resource ID of the existing database, and + restorePointInTime must be specified. + + Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be + specified as the recoverable database resource ID to restore. + + Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must + be specified. If sourceDatabaseId is the database's original resource ID, then + sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable + dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may + also be specified to restore from an earlier point in time. + + RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention + vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource + ID. + + Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse + edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", + "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", + "RestoreLongTermRetentionBackup", and "OnlineSecondary". + :vartype create_mode: str or ~azure.mgmt.sql.models.CreateMode + :ivar collation: The collation of the database. + :vartype collation: str + :ivar max_size_bytes: The max size of the database expressed in bytes. + :vartype max_size_bytes: int + :ivar sample_name: The name of the sample schema to apply when creating this database. Known + values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". + :vartype sample_name: str or ~azure.mgmt.sql.models.SampleName + :ivar elastic_pool_id: The resource identifier of the elastic pool containing this database. + :vartype elastic_pool_id: str + :ivar source_database_id: The resource identifier of the source database associated with create + operation of this database. + :vartype source_database_id: str + :ivar status: The status of the database. Known values are: "Online", "Restoring", + "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", + "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", + "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", + "Disabled", "Stopping", "Stopped", and "Starting". + :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus + :ivar database_id: The ID of the database. + :vartype database_id: str + :ivar creation_date: The creation date of the database (ISO8601 format). + :vartype creation_date: ~datetime.datetime + :ivar current_service_objective_name: The current service level objective name of the database. + :vartype current_service_objective_name: str + :ivar requested_service_objective_name: The requested service level objective name of the + database. + :vartype requested_service_objective_name: str + :ivar default_secondary_location: The default secondary region for this database. + :vartype default_secondary_location: str + :ivar failover_group_id: Failover Group resource identifier that this database belongs to. + :vartype failover_group_id: str + :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source + database that will be restored to create the new database. + :vartype restore_point_in_time: ~datetime.datetime + :ivar source_database_deletion_date: Specifies the time that the database was deleted. + :vartype source_database_deletion_date: ~datetime.datetime + :ivar recovery_services_recovery_point_id: The resource identifier of the recovery point + associated with create operation of this database. + :vartype recovery_services_recovery_point_id: str + :ivar long_term_retention_backup_resource_id: The resource identifier of the long term + retention backup associated with create operation of this database. + :vartype long_term_retention_backup_resource_id: str + :ivar recoverable_database_id: The resource identifier of the recoverable database associated + with create operation of this database. + :vartype recoverable_database_id: str + :ivar restorable_dropped_database_id: The resource identifier of the restorable dropped + database associated with create operation of this database. + :vartype restorable_dropped_database_id: str + :ivar catalog_collation: Collation of the metadata catalog. Known values are: + "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". + :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType + :ivar zone_redundant: Whether or not this database is zone redundant, which means the replicas + of this database will be spread across multiple availability zones. + :vartype zone_redundant: bool + :ivar license_type: The license type to apply for this database. ``LicenseIncluded`` if you + need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid + Benefit. Known values are: "LicenseIncluded" and "BasePrice". + :vartype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType + :ivar max_log_size_bytes: The max log size for this database. + :vartype max_log_size_bytes: int + :ivar earliest_restore_date: This records the earliest start date and time that restore is + available for this database (ISO8601 format). + :vartype earliest_restore_date: ~datetime.datetime + :ivar read_scale: The state of read-only routing. If enabled, connections that have application + intent set to readonly in their connection string may be routed to a readonly secondary replica + in the same region. Not applicable to a Hyperscale database within an elastic pool. Known + values are: "Enabled" and "Disabled". + :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale + :ivar high_availability_replica_count: The number of secondary replicas associated with the + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. + :vartype high_availability_replica_count: int + :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values + are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". + :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType + :ivar current_sku: The name and tier of the SKU. + :vartype current_sku: ~azure.mgmt.sql.models.Sku + :ivar auto_pause_delay: Time in minutes after which database is automatically paused. A value + of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups + for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar min_capacity: Minimal capacity that database will always have allocated, if not paused. + :vartype min_capacity: float + :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 + format). Null if the database is ready. + :vartype paused_date: ~datetime.datetime + :ivar resumed_date: The date when database was resumed by user action or database login + (ISO8601 format). Null if the database is paused. + :vartype resumed_date: ~datetime.datetime + :ivar maintenance_configuration_id: Maintenance configuration id assigned to the database. This + configuration defines the period when the maintenance updates will occur. + :vartype maintenance_configuration_id: str + :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables + in the database are ledger tables. Note: the value of this property cannot be changed after the + database has been created. + :vartype is_ledger_on: bool + :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. + :vartype is_infra_encryption_enabled: bool + :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. + :vartype federated_client_id: str + :ivar keys_property: The resource ids of the user assigned identities to use. + :vartype keys_property: dict[str, ~azure.mgmt.sql.models.DatabaseKey] + :ivar encryption_protector: The azure key vault URI of the database if it's configured with per + Database Customer Managed Keys. + :vartype encryption_protector: str + :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType + :ivar use_free_limit: Whether or not the database uses free monthly limits. Allowed on one + database in a subscription. + :vartype use_free_limit: bool + :ivar free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are + exhausted for the free database. + + AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the + month. + + BillForUsage: The database will continue to be online upon exhaustion of free limits and any + overage will be billed. Known values are: "AutoPause" and "BillOverUsage". + :vartype free_limit_exhaustion_behavior: str or + ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior + :ivar source_resource_id: The resource identifier of the source associated with the create + operation of this database. + + This property is only supported for DataWarehouse edition and allows to restore across + subscriptions. + + When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, + restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode + must be PointInTimeRestore, Restore or Recover. + + When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing + database or existing sql pool, and restorePointInTime must be specified. + + When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped + database or restorable dropped sql pool. + + When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or + recoverable sql pool. + + When source subscription belongs to a different tenant than target subscription, + “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. + For more details about “x-ms-authorization-auxiliary” header see + `https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant + `_. + :vartype source_resource_id: str + :ivar manual_cutover: Whether or not customer controlled manual cutover needs to be done during + Update Database operation to Hyperscale tier. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier. + + When manualCutover is specified, the scaling operation will wait for user input to trigger + cutover to Hyperscale database. + + To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in + Waiting state. + :vartype manual_cutover: bool + :ivar perform_cutover: To trigger customer controlled manual cutover during the wait state + while Scaling operation is in progress. + + This property parameter is only applicable for scaling operations that are initiated along with + 'manualCutover' parameter. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier is already in progress. + + When performCutover is specified, the scaling operation will trigger cutover and perform + role-change to Hyperscale database. + :vartype perform_cutover: bool + :ivar availability_zone: Specifies the availability zone the database is pinned to. Known + values are: "NoPreference", "1", "2", and "3". + :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType + :ivar encryption_protector_auto_rotation: The flag to enable or disable auto rotation of + database encryption protector AKV key. + :vartype encryption_protector_auto_rotation: bool + :ivar provisioning_state: Specifies the provisioning state for this resource. + :vartype provisioning_state: str + """ + + create_mode: Optional[Union[str, "_models.CreateMode"]] = rest_field(name="createMode", visibility=["create"]) + """Specifies the mode of database creation. + + Default: regular database creation. + + Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified + as the resource ID of the source database. + + Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId + must be specified as the resource ID of the existing primary database. + + PointInTimeRestore: Creates a database by restoring a point in time backup of an existing + database. sourceDatabaseId must be specified as the resource ID of the existing database, and + restorePointInTime must be specified. + + Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be + specified as the recoverable database resource ID to restore. + + Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must + be specified. If sourceDatabaseId is the database's original resource ID, then + sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable + dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may + also be specified to restore from an earlier point in time. + + RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention + vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource + ID. + + Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse + edition. Known values are: \"Default\", \"Copy\", \"Secondary\", \"PointInTimeRestore\", + \"Restore\", \"Recovery\", \"RestoreExternalBackup\", \"RestoreExternalBackupSecondary\", + \"RestoreLongTermRetentionBackup\", and \"OnlineSecondary\".""" + collation: Optional[str] = rest_field(visibility=["read", "create"]) + """The collation of the database.""" + max_size_bytes: Optional[int] = rest_field( + name="maxSizeBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The max size of the database expressed in bytes.""" + sample_name: Optional[Union[str, "_models.SampleName"]] = rest_field(name="sampleName", visibility=["create"]) + """The name of the sample schema to apply when creating this database. Known values are: + \"AdventureWorksLT\", \"WideWorldImportersStd\", and \"WideWorldImportersFull\".""" + elastic_pool_id: Optional[str] = rest_field( + name="elasticPoolId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource identifier of the elastic pool containing this database.""" + source_database_id: Optional[str] = rest_field(name="sourceDatabaseId", visibility=["create"]) + """The resource identifier of the source database associated with create operation of this + database.""" + status: Optional[Union[str, "_models.DatabaseStatus"]] = rest_field(visibility=["read"]) + """The status of the database. Known values are: \"Online\", \"Restoring\", \"RecoveryPending\", + \"Recovering\", \"Suspect\", \"Offline\", \"Standby\", \"Shutdown\", \"EmergencyMode\", + \"AutoClosed\", \"Copying\", \"Creating\", \"Inaccessible\", \"OfflineSecondary\", \"Pausing\", + \"Paused\", \"Resuming\", \"Scaling\", \"OfflineChangingDwPerformanceTiers\", + \"OnlineChangingDwPerformanceTiers\", \"Disabled\", \"Stopping\", \"Stopped\", and + \"Starting\".""" + database_id: Optional[str] = rest_field(name="databaseId", visibility=["read"]) + """The ID of the database.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the database (ISO8601 format).""" + current_service_objective_name: Optional[str] = rest_field(name="currentServiceObjectiveName", visibility=["read"]) + """The current service level objective name of the database.""" + requested_service_objective_name: Optional[str] = rest_field( + name="requestedServiceObjectiveName", visibility=["read"] + ) + """The requested service level objective name of the database.""" + default_secondary_location: Optional[str] = rest_field(name="defaultSecondaryLocation", visibility=["read"]) + """The default secondary region for this database.""" + failover_group_id: Optional[str] = rest_field(name="failoverGroupId", visibility=["read"]) + """Failover Group resource identifier that this database belongs to.""" + restore_point_in_time: Optional[datetime.datetime] = rest_field( + name="restorePointInTime", visibility=["create"], format="rfc3339" + ) + """Specifies the point in time (ISO8601 format) of the source database that will be restored to + create the new database.""" + source_database_deletion_date: Optional[datetime.datetime] = rest_field( + name="sourceDatabaseDeletionDate", visibility=["create"], format="rfc3339" + ) + """Specifies the time that the database was deleted.""" + recovery_services_recovery_point_id: Optional[str] = rest_field( + name="recoveryServicesRecoveryPointId", visibility=["create"] + ) + """The resource identifier of the recovery point associated with create operation of this + database.""" + long_term_retention_backup_resource_id: Optional[str] = rest_field( + name="longTermRetentionBackupResourceId", visibility=["create"] + ) + """The resource identifier of the long term retention backup associated with create operation of + this database.""" + recoverable_database_id: Optional[str] = rest_field(name="recoverableDatabaseId", visibility=["create"]) + """The resource identifier of the recoverable database associated with create operation of this + database.""" + restorable_dropped_database_id: Optional[str] = rest_field( + name="restorableDroppedDatabaseId", visibility=["create"] + ) + """The resource identifier of the restorable dropped database associated with create operation of + this database.""" + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = rest_field( + name="catalogCollation", visibility=["read", "create"] + ) + """Collation of the metadata catalog. Known values are: \"DATABASE_DEFAULT\" and + \"SQL_Latin1_General_CP1_CI_AS\".""" + zone_redundant: Optional[bool] = rest_field( + name="zoneRedundant", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this database is zone redundant, which means the replicas of this database will + be spread across multiple availability zones.""" + license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to apply for this database. ``LicenseIncluded`` if you need a license, or + ``BasePrice`` if you have a license and are eligible for the Azure Hybrid Benefit. Known values + are: \"LicenseIncluded\" and \"BasePrice\".""" + max_log_size_bytes: Optional[int] = rest_field(name="maxLogSizeBytes", visibility=["read"]) + """The max log size for this database.""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """This records the earliest start date and time that restore is available for this database + (ISO8601 format).""" + read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = rest_field( + name="readScale", visibility=["read", "update"] + ) + """The state of read-only routing. If enabled, connections that have application intent set to + readonly in their connection string may be routed to a readonly secondary replica in the same + region. Not applicable to a Hyperscale database within an elastic pool. Known values are: + \"Enabled\" and \"Disabled\".""" + high_availability_replica_count: Optional[int] = rest_field( + name="highAvailabilityReplicaCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas associated with the Business Critical, Premium, or Hyperscale + edition database that are used to provide high availability. Not applicable to a Hyperscale + database within an elastic pool.""" + secondary_type: Optional[Union[str, "_models.SecondaryType"]] = rest_field( + name="secondaryType", visibility=["read", "create", "update", "delete", "query"] + ) + """The secondary type of the database if it is a secondary. Valid values are Geo, Named and + Standby. Known values are: \"Geo\", \"Named\", and \"Standby\".""" + current_sku: Optional["_models.Sku"] = rest_field(name="currentSku", visibility=["read"]) + """The name and tier of the SKU.""" + auto_pause_delay: Optional[int] = rest_field( + name="autoPauseDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Time in minutes after which database is automatically paused. A value of -1 means that + automatic pause is disabled.""" + current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="currentBackupStorageRedundancy", visibility=["read"] + ) + """The storage account type used to store backups for this database. Known values are: \"Geo\", + \"Local\", \"Zone\", and \"GeoZone\".""" + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="requestedBackupStorageRedundancy", visibility=["read", "create", "update", "delete", "query"] + ) + """The storage account type to be used to store backups for this database. Known values are: + \"Geo\", \"Local\", \"Zone\", and \"GeoZone\".""" + min_capacity: Optional[float] = rest_field( + name="minCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal capacity that database will always have allocated, if not paused.""" + paused_date: Optional[datetime.datetime] = rest_field(name="pausedDate", visibility=["read"], format="rfc3339") + """The date when database was paused by user configuration or action(ISO8601 format). Null if the + database is ready.""" + resumed_date: Optional[datetime.datetime] = rest_field(name="resumedDate", visibility=["read"], format="rfc3339") + """The date when database was resumed by user action or database login (ISO8601 format). Null if + the database is paused.""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Maintenance configuration id assigned to the database. This configuration defines the period + when the maintenance updates will occur.""" + is_ledger_on: Optional[bool] = rest_field( + name="isLedgerOn", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this database is a ledger database, which means all tables in the database are + ledger tables. Note: the value of this property cannot be changed after the database has been + created.""" + is_infra_encryption_enabled: Optional[bool] = rest_field(name="isInfraEncryptionEnabled", visibility=["read"]) + """Infra encryption is enabled for this database.""" + federated_client_id: Optional[str] = rest_field( + name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Client id used for cross tenant per database CMK scenario.""" + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """The resource ids of the user assigned identities to use.""" + encryption_protector: Optional[str] = rest_field( + name="encryptionProtector", visibility=["read", "create", "update", "delete", "query"] + ) + """The azure key vault URI of the database if it's configured with per Database Customer Managed + Keys.""" + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = rest_field( + name="preferredEnclaveType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of enclave requested on the database i.e. Default or VBS enclaves. Known values are: + \"Default\" and \"VBS\".""" + use_free_limit: Optional[bool] = rest_field( + name="useFreeLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the database uses free monthly limits. Allowed on one database in a + subscription.""" + free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = rest_field( + name="freeLimitExhaustionBehavior", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the behavior when monthly free limits are exhausted for the free database. + + AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the + month. + + BillForUsage: The database will continue to be online upon exhaustion of free limits and any + overage will be billed. Known values are: \"AutoPause\" and \"BillOverUsage\".""" + source_resource_id: Optional[str] = rest_field(name="sourceResourceId", visibility=["create"]) + """The resource identifier of the source associated with the create operation of this database. + + This property is only supported for DataWarehouse edition and allows to restore across + subscriptions. + + When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, + restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode + must be PointInTimeRestore, Restore or Recover. + + When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing + database or existing sql pool, and restorePointInTime must be specified. + + When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped + database or restorable dropped sql pool. + + When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or + recoverable sql pool. + + When source subscription belongs to a different tenant than target subscription, + “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. + For more details about “x-ms-authorization-auxiliary” header see + `https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant + `_.""" + manual_cutover: Optional[bool] = rest_field( + name="manualCutover", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not customer controlled manual cutover needs to be done during Update Database + operation to Hyperscale tier. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier. + + When manualCutover is specified, the scaling operation will wait for user input to trigger + cutover to Hyperscale database. + + To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in + Waiting state.""" + perform_cutover: Optional[bool] = rest_field( + name="performCutover", visibility=["read", "create", "update", "delete", "query"] + ) + """To trigger customer controlled manual cutover during the wait state while Scaling operation is + in progress. + + This property parameter is only applicable for scaling operations that are initiated along with + 'manualCutover' parameter. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier is already in progress. + + When performCutover is specified, the scaling operation will trigger cutover and perform + role-change to Hyperscale database.""" + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = rest_field( + name="availabilityZone", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the availability zone the database is pinned to. Known values are: \"NoPreference\", + \"1\", \"2\", and \"3\".""" + encryption_protector_auto_rotation: Optional[bool] = rest_field( + name="encryptionProtectorAutoRotation", visibility=["read", "create", "update", "delete", "query"] + ) + """The flag to enable or disable auto rotation of database encryption protector AKV key.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Specifies the provisioning state for this resource.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + collation: Optional[str] = None, + max_size_bytes: Optional[int] = None, + sample_name: Optional[Union[str, "_models.SampleName"]] = None, + elastic_pool_id: Optional[str] = None, + source_database_id: Optional[str] = None, + restore_point_in_time: Optional[datetime.datetime] = None, + source_database_deletion_date: Optional[datetime.datetime] = None, + recovery_services_recovery_point_id: Optional[str] = None, + long_term_retention_backup_resource_id: Optional[str] = None, + recoverable_database_id: Optional[str] = None, + restorable_dropped_database_id: Optional[str] = None, + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, + zone_redundant: Optional[bool] = None, + license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = None, + read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = None, + high_availability_replica_count: Optional[int] = None, + secondary_type: Optional[Union[str, "_models.SecondaryType"]] = None, + auto_pause_delay: Optional[int] = None, + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + min_capacity: Optional[float] = None, + maintenance_configuration_id: Optional[str] = None, + is_ledger_on: Optional[bool] = None, + federated_client_id: Optional[str] = None, + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = None, + encryption_protector: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, + use_free_limit: Optional[bool] = None, + free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None, + source_resource_id: Optional[str] = None, + manual_cutover: Optional[bool] = None, + perform_cutover: Optional[bool] = None, + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, + encryption_protector_auto_rotation: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseSchema(ProxyResource): + """A database schema resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + """ + + +class DatabaseSecurityAlertPolicy(ProxyResource): + """A database security alert policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SecurityAlertsPolicyProperties + """ + + properties: Optional["_models.SecurityAlertsPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "state", + "disabled_alerts", + "email_addresses", + "email_account_admins", + "storage_endpoint", + "storage_account_access_key", + "retention_days", + "creation_time", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityAlertsPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseSqlVulnerabilityAssessmentBaselineSet(ProxyResource): # pylint: disable=name-too-long + """A database sql vulnerability assessment baseline set. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSetProperties + """ + + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentBaselineSetProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["results"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentBaselineSetProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseSqlVulnerabilityAssessmentBaselineSetProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Sql Vulnerability Assessment baseline set. + + :ivar results: The baseline set result. Required. + :vartype results: dict[str, list[list[str]]] + """ + + results: dict[str, list[list[str]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The baseline set result. Required.""" + + @overload + def __init__( + self, + *, + results: dict[str, list[list[str]]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaseline(ProxyResource): # pylint: disable=name-too-long + """A database sql vulnerability assessment rule baseline. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties + """ + + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["results"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselineInput(ProxyResourceAutoGenerated): # pylint: disable=name-too-long + """A database sql vulnerability assessment rule baseline input. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineInputResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties + """ + + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineInputResource.""" + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["latest_scan", "results"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselineInputProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Sql Vulnerability Assessment rule baseline. + + :ivar latest_scan: The latest scan flag. Required. + :vartype latest_scan: bool + :ivar results: The rule baseline result. Required. + :vartype results: list[list[str]] + """ + + latest_scan: bool = rest_field(name="latestScan", visibility=["read", "create", "update", "delete", "query"]) + """The latest scan flag. Required.""" + results: list[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rule baseline result. Required.""" + + @overload + def __init__( + self, + *, + latest_scan: bool, + results: list[list[str]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput( + ProxyResourceAutoGenerated +): # pylint: disable=name-too-long + """A database sql vulnerability assessment rule baseline list input. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar system_data: SystemData of + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties + """ + + system_data: Optional["_models.SystemData"] = rest_field(name="systemData", visibility=["read"]) + """SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputResource.""" + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["latest_scan", "results"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Sql Vulnerability Assessment rule baseline. + + :ivar latest_scan: The latest scan flag. Required. + :vartype latest_scan: bool + :ivar results: The rule baseline result list. Required. + :vartype results: dict[str, list[list[str]]] + """ + + latest_scan: bool = rest_field(name="latestScan", visibility=["read", "create", "update", "delete", "query"]) + """The latest scan flag. Required.""" + results: dict[str, list[list[str]]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rule baseline result list. Required.""" + + @overload + def __init__( + self, + *, + latest_scan: bool, + results: dict[str, list[list[str]]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselineProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Sql Vulnerability Assessment rule baseline. + + :ivar results: The rule baseline result. Required. + :vartype results: list[list[str]] + """ + + results: list[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rule baseline result. Required.""" + + @overload + def __init__( + self, + *, + results: list[list[str]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseTable(ProxyResource): + """A database table resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseTableProperties + """ + + properties: Optional["_models.DatabaseTableProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["temporal_type", "memory_optimized"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseTableProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseTableProperties(_Model): + """Database table properties. + + :ivar temporal_type: The table temporal type. Known values are: "NonTemporalTable", + "HistoryTable", and "SystemVersionedTemporalTable". + :vartype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :ivar memory_optimized: Whether or not the table is memory optimized. + :vartype memory_optimized: bool + """ + + temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = rest_field( + name="temporalType", visibility=["read", "create", "update", "delete", "query"] + ) + """The table temporal type. Known values are: \"NonTemporalTable\", \"HistoryTable\", and + \"SystemVersionedTemporalTable\".""" + memory_optimized: Optional[bool] = rest_field( + name="memoryOptimized", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the table is memory optimized.""" + + @overload + def __init__( + self, + *, + temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = None, + memory_optimized: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseUpdate(_Model): + """A database update resource. + + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar identity: Database identity. + :vartype identity: ~azure.mgmt.sql.models.DatabaseIdentity + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseUpdateProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + identity: Optional["_models.DatabaseIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Database identity.""" + properties: Optional["_models.DatabaseUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = [ + "create_mode", + "collation", + "max_size_bytes", + "sample_name", + "elastic_pool_id", + "source_database_id", + "status", + "database_id", + "creation_date", + "current_service_objective_name", + "requested_service_objective_name", + "default_secondary_location", + "failover_group_id", + "restore_point_in_time", + "source_database_deletion_date", + "recovery_services_recovery_point_id", + "long_term_retention_backup_resource_id", + "recoverable_database_id", + "restorable_dropped_database_id", + "catalog_collation", + "zone_redundant", + "license_type", + "max_log_size_bytes", + "earliest_restore_date", + "read_scale", + "high_availability_replica_count", + "secondary_type", + "current_sku", + "auto_pause_delay", + "current_backup_storage_redundancy", + "requested_backup_storage_redundancy", + "min_capacity", + "paused_date", + "resumed_date", + "maintenance_configuration_id", + "is_ledger_on", + "is_infra_encryption_enabled", + "federated_client_id", + "keys_property", + "encryption_protector", + "preferred_enclave_type", + "use_free_limit", + "free_limit_exhaustion_behavior", + "manual_cutover", + "perform_cutover", + "encryption_protector_auto_rotation", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.DatabaseIdentity"] = None, + properties: Optional["_models.DatabaseUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseUpdateProperties(_Model): + """A database update properties. + + :ivar create_mode: Specifies the mode of database creation. + + Default: regular database creation. + + Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified + as the resource ID of the source database. + + Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId + must be specified as the resource ID of the existing primary database. + + PointInTimeRestore: Creates a database by restoring a point in time backup of an existing + database. sourceDatabaseId must be specified as the resource ID of the existing database, and + restorePointInTime must be specified. + + Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be + specified as the recoverable database resource ID to restore. + + Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must + be specified. If sourceDatabaseId is the database's original resource ID, then + sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable + dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may + also be specified to restore from an earlier point in time. + + RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention + vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource + ID. + + Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse + edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", + "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", + "RestoreLongTermRetentionBackup", and "OnlineSecondary". + :vartype create_mode: str or ~azure.mgmt.sql.models.CreateMode + :ivar collation: The collation of the database. + :vartype collation: str + :ivar max_size_bytes: The max size of the database expressed in bytes. + :vartype max_size_bytes: int + :ivar sample_name: The name of the sample schema to apply when creating this database. Known + values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". + :vartype sample_name: str or ~azure.mgmt.sql.models.SampleName + :ivar elastic_pool_id: The resource identifier of the elastic pool containing this database. + :vartype elastic_pool_id: str + :ivar source_database_id: The resource identifier of the source database associated with create + operation of this database. + :vartype source_database_id: str + :ivar status: The status of the database. Known values are: "Online", "Restoring", + "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", + "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", + "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", + "Disabled", "Stopping", "Stopped", and "Starting". + :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus + :ivar database_id: The ID of the database. + :vartype database_id: str + :ivar creation_date: The creation date of the database (ISO8601 format). + :vartype creation_date: ~datetime.datetime + :ivar current_service_objective_name: The current service level objective name of the database. + :vartype current_service_objective_name: str + :ivar requested_service_objective_name: The requested service level objective name of the + database. + :vartype requested_service_objective_name: str + :ivar default_secondary_location: The default secondary region for this database. + :vartype default_secondary_location: str + :ivar failover_group_id: Failover Group resource identifier that this database belongs to. + :vartype failover_group_id: str + :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source + database that will be restored to create the new database. + :vartype restore_point_in_time: ~datetime.datetime + :ivar source_database_deletion_date: Specifies the time that the database was deleted. + :vartype source_database_deletion_date: ~datetime.datetime + :ivar recovery_services_recovery_point_id: The resource identifier of the recovery point + associated with create operation of this database. + :vartype recovery_services_recovery_point_id: str + :ivar long_term_retention_backup_resource_id: The resource identifier of the long term + retention backup associated with create operation of this database. + :vartype long_term_retention_backup_resource_id: str + :ivar recoverable_database_id: The resource identifier of the recoverable database associated + with create operation of this database. + :vartype recoverable_database_id: str + :ivar restorable_dropped_database_id: The resource identifier of the restorable dropped + database associated with create operation of this database. + :vartype restorable_dropped_database_id: str + :ivar catalog_collation: Collation of the metadata catalog. Known values are: + "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". + :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType + :ivar zone_redundant: Whether or not this database is zone redundant, which means the replicas + of this database will be spread across multiple availability zones. + :vartype zone_redundant: bool + :ivar license_type: The license type to apply for this database. ``LicenseIncluded`` if you + need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid + Benefit. Known values are: "LicenseIncluded" and "BasePrice". + :vartype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType + :ivar max_log_size_bytes: The max log size for this database. + :vartype max_log_size_bytes: int + :ivar earliest_restore_date: This records the earliest start date and time that restore is + available for this database (ISO8601 format). + :vartype earliest_restore_date: ~datetime.datetime + :ivar read_scale: The state of read-only routing. If enabled, connections that have application + intent set to readonly in their connection string may be routed to a readonly secondary replica + in the same region. Not applicable to a Hyperscale database within an elastic pool. Known + values are: "Enabled" and "Disabled". + :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale + :ivar high_availability_replica_count: The number of secondary replicas associated with the + Business Critical, Premium, or Hyperscale edition database that are used to provide high + availability. Not applicable to a Hyperscale database within an elastic pool. + :vartype high_availability_replica_count: int + :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values + are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". + :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType + :ivar current_sku: The name and tier of the SKU. + :vartype current_sku: ~azure.mgmt.sql.models.Sku + :ivar auto_pause_delay: Time in minutes after which database is automatically paused. A value + of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups + for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar min_capacity: Minimal capacity that database will always have allocated, if not paused. + :vartype min_capacity: float + :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 + format). Null if the database is ready. + :vartype paused_date: ~datetime.datetime + :ivar resumed_date: The date when database was resumed by user action or database login + (ISO8601 format). Null if the database is paused. + :vartype resumed_date: ~datetime.datetime + :ivar maintenance_configuration_id: Maintenance configuration id assigned to the database. This + configuration defines the period when the maintenance updates will occur. + :vartype maintenance_configuration_id: str + :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables + in the database are ledger tables. Note: the value of this property cannot be changed after the + database has been created. + :vartype is_ledger_on: bool + :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. + :vartype is_infra_encryption_enabled: bool + :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. + :vartype federated_client_id: str + :ivar keys_property: The resource ids of the user assigned identities to use. + :vartype keys_property: dict[str, ~azure.mgmt.sql.models.DatabaseKey] + :ivar encryption_protector: The azure key vault URI of the database if it's configured with per + Database Customer Managed Keys. + :vartype encryption_protector: str + :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS + enclaves. Known values are: "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType + :ivar use_free_limit: Whether or not the database uses free monthly limits. Allowed on one + database in a subscription. + :vartype use_free_limit: bool + :ivar free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are + exhausted for the free database. + + AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the + month. + + BillForUsage: The database will continue to be online upon exhaustion of free limits and any + overage will be billed. Known values are: "AutoPause" and "BillOverUsage". + :vartype free_limit_exhaustion_behavior: str or + ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior + :ivar manual_cutover: Whether or not customer controlled manual cutover needs to be done during + Update Database operation to Hyperscale tier. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier. + + When manualCutover is specified, the scaling operation will wait for user input to trigger + cutover to Hyperscale database. + + To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in + Waiting state. + :vartype manual_cutover: bool + :ivar perform_cutover: To trigger customer controlled manual cutover during the wait state + while Scaling operation is in progress. + + This property parameter is only applicable for scaling operations that are initiated along with + 'manualCutover' parameter. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier is already in progress. + + When performCutover is specified, the scaling operation will trigger cutover and perform + role-change to Hyperscale database. + :vartype perform_cutover: bool + :ivar encryption_protector_auto_rotation: The flag to enable or disable auto rotation of + database encryption protector AKV key. + :vartype encryption_protector_auto_rotation: bool + :ivar provisioning_state: Specifies the provisioning state for this resource. + :vartype provisioning_state: str + """ + + create_mode: Optional[Union[str, "_models.CreateMode"]] = rest_field(name="createMode", visibility=["create"]) + """Specifies the mode of database creation. + + Default: regular database creation. + + Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified + as the resource ID of the source database. + + Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId + must be specified as the resource ID of the existing primary database. + + PointInTimeRestore: Creates a database by restoring a point in time backup of an existing + database. sourceDatabaseId must be specified as the resource ID of the existing database, and + restorePointInTime must be specified. + + Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be + specified as the recoverable database resource ID to restore. + + Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must + be specified. If sourceDatabaseId is the database's original resource ID, then + sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable + dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may + also be specified to restore from an earlier point in time. + + RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention + vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource + ID. + + Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse + edition. Known values are: \"Default\", \"Copy\", \"Secondary\", \"PointInTimeRestore\", + \"Restore\", \"Recovery\", \"RestoreExternalBackup\", \"RestoreExternalBackupSecondary\", + \"RestoreLongTermRetentionBackup\", and \"OnlineSecondary\".""" + collation: Optional[str] = rest_field(visibility=["read", "create"]) + """The collation of the database.""" + max_size_bytes: Optional[int] = rest_field( + name="maxSizeBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The max size of the database expressed in bytes.""" + sample_name: Optional[Union[str, "_models.SampleName"]] = rest_field(name="sampleName", visibility=["create"]) + """The name of the sample schema to apply when creating this database. Known values are: + \"AdventureWorksLT\", \"WideWorldImportersStd\", and \"WideWorldImportersFull\".""" + elastic_pool_id: Optional[str] = rest_field( + name="elasticPoolId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource identifier of the elastic pool containing this database.""" + source_database_id: Optional[str] = rest_field(name="sourceDatabaseId", visibility=["create"]) + """The resource identifier of the source database associated with create operation of this + database.""" + status: Optional[Union[str, "_models.DatabaseStatus"]] = rest_field(visibility=["read"]) + """The status of the database. Known values are: \"Online\", \"Restoring\", \"RecoveryPending\", + \"Recovering\", \"Suspect\", \"Offline\", \"Standby\", \"Shutdown\", \"EmergencyMode\", + \"AutoClosed\", \"Copying\", \"Creating\", \"Inaccessible\", \"OfflineSecondary\", \"Pausing\", + \"Paused\", \"Resuming\", \"Scaling\", \"OfflineChangingDwPerformanceTiers\", + \"OnlineChangingDwPerformanceTiers\", \"Disabled\", \"Stopping\", \"Stopped\", and + \"Starting\".""" + database_id: Optional[str] = rest_field(name="databaseId", visibility=["read"]) + """The ID of the database.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the database (ISO8601 format).""" + current_service_objective_name: Optional[str] = rest_field(name="currentServiceObjectiveName", visibility=["read"]) + """The current service level objective name of the database.""" + requested_service_objective_name: Optional[str] = rest_field( + name="requestedServiceObjectiveName", visibility=["read"] + ) + """The requested service level objective name of the database.""" + default_secondary_location: Optional[str] = rest_field(name="defaultSecondaryLocation", visibility=["read"]) + """The default secondary region for this database.""" + failover_group_id: Optional[str] = rest_field(name="failoverGroupId", visibility=["read"]) + """Failover Group resource identifier that this database belongs to.""" + restore_point_in_time: Optional[datetime.datetime] = rest_field( + name="restorePointInTime", visibility=["create"], format="rfc3339" + ) + """Specifies the point in time (ISO8601 format) of the source database that will be restored to + create the new database.""" + source_database_deletion_date: Optional[datetime.datetime] = rest_field( + name="sourceDatabaseDeletionDate", visibility=["create"], format="rfc3339" + ) + """Specifies the time that the database was deleted.""" + recovery_services_recovery_point_id: Optional[str] = rest_field( + name="recoveryServicesRecoveryPointId", visibility=["create"] + ) + """The resource identifier of the recovery point associated with create operation of this + database.""" + long_term_retention_backup_resource_id: Optional[str] = rest_field( + name="longTermRetentionBackupResourceId", visibility=["create"] + ) + """The resource identifier of the long term retention backup associated with create operation of + this database.""" + recoverable_database_id: Optional[str] = rest_field(name="recoverableDatabaseId", visibility=["create"]) + """The resource identifier of the recoverable database associated with create operation of this + database.""" + restorable_dropped_database_id: Optional[str] = rest_field( + name="restorableDroppedDatabaseId", visibility=["create"] + ) + """The resource identifier of the restorable dropped database associated with create operation of + this database.""" + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = rest_field( + name="catalogCollation", visibility=["read", "create"] + ) + """Collation of the metadata catalog. Known values are: \"DATABASE_DEFAULT\" and + \"SQL_Latin1_General_CP1_CI_AS\".""" + zone_redundant: Optional[bool] = rest_field( + name="zoneRedundant", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this database is zone redundant, which means the replicas of this database will + be spread across multiple availability zones.""" + license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to apply for this database. ``LicenseIncluded`` if you need a license, or + ``BasePrice`` if you have a license and are eligible for the Azure Hybrid Benefit. Known values + are: \"LicenseIncluded\" and \"BasePrice\".""" + max_log_size_bytes: Optional[int] = rest_field(name="maxLogSizeBytes", visibility=["read"]) + """The max log size for this database.""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """This records the earliest start date and time that restore is available for this database + (ISO8601 format).""" + read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = rest_field( + name="readScale", visibility=["read", "update"] + ) + """The state of read-only routing. If enabled, connections that have application intent set to + readonly in their connection string may be routed to a readonly secondary replica in the same + region. Not applicable to a Hyperscale database within an elastic pool. Known values are: + \"Enabled\" and \"Disabled\".""" + high_availability_replica_count: Optional[int] = rest_field( + name="highAvailabilityReplicaCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas associated with the Business Critical, Premium, or Hyperscale + edition database that are used to provide high availability. Not applicable to a Hyperscale + database within an elastic pool.""" + secondary_type: Optional[Union[str, "_models.SecondaryType"]] = rest_field( + name="secondaryType", visibility=["read", "create", "update", "delete", "query"] + ) + """The secondary type of the database if it is a secondary. Valid values are Geo, Named and + Standby. Known values are: \"Geo\", \"Named\", and \"Standby\".""" + current_sku: Optional["_models.Sku"] = rest_field(name="currentSku", visibility=["read"]) + """The name and tier of the SKU.""" + auto_pause_delay: Optional[int] = rest_field( + name="autoPauseDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Time in minutes after which database is automatically paused. A value of -1 means that + automatic pause is disabled.""" + current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="currentBackupStorageRedundancy", visibility=["read"] + ) + """The storage account type used to store backups for this database. Known values are: \"Geo\", + \"Local\", \"Zone\", and \"GeoZone\".""" + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="requestedBackupStorageRedundancy", visibility=["read", "create", "update", "delete", "query"] + ) + """The storage account type to be used to store backups for this database. Known values are: + \"Geo\", \"Local\", \"Zone\", and \"GeoZone\".""" + min_capacity: Optional[float] = rest_field( + name="minCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal capacity that database will always have allocated, if not paused.""" + paused_date: Optional[datetime.datetime] = rest_field(name="pausedDate", visibility=["read"], format="rfc3339") + """The date when database was paused by user configuration or action(ISO8601 format). Null if the + database is ready.""" + resumed_date: Optional[datetime.datetime] = rest_field(name="resumedDate", visibility=["read"], format="rfc3339") + """The date when database was resumed by user action or database login (ISO8601 format). Null if + the database is paused.""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Maintenance configuration id assigned to the database. This configuration defines the period + when the maintenance updates will occur.""" + is_ledger_on: Optional[bool] = rest_field( + name="isLedgerOn", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this database is a ledger database, which means all tables in the database are + ledger tables. Note: the value of this property cannot be changed after the database has been + created.""" + is_infra_encryption_enabled: Optional[bool] = rest_field(name="isInfraEncryptionEnabled", visibility=["read"]) + """Infra encryption is enabled for this database.""" + federated_client_id: Optional[str] = rest_field( + name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Client id used for cross tenant per database CMK scenario.""" + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """The resource ids of the user assigned identities to use.""" + encryption_protector: Optional[str] = rest_field( + name="encryptionProtector", visibility=["read", "create", "update", "delete", "query"] + ) + """The azure key vault URI of the database if it's configured with per Database Customer Managed + Keys.""" + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = rest_field( + name="preferredEnclaveType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of enclave requested on the database i.e. Default or VBS enclaves. Known values are: + \"Default\" and \"VBS\".""" + use_free_limit: Optional[bool] = rest_field( + name="useFreeLimit", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the database uses free monthly limits. Allowed on one database in a + subscription.""" + free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = rest_field( + name="freeLimitExhaustionBehavior", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the behavior when monthly free limits are exhausted for the free database. + + AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the + month. + + BillForUsage: The database will continue to be online upon exhaustion of free limits and any + overage will be billed. Known values are: \"AutoPause\" and \"BillOverUsage\".""" + manual_cutover: Optional[bool] = rest_field( + name="manualCutover", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not customer controlled manual cutover needs to be done during Update Database + operation to Hyperscale tier. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier. + + When manualCutover is specified, the scaling operation will wait for user input to trigger + cutover to Hyperscale database. + + To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in + Waiting state.""" + perform_cutover: Optional[bool] = rest_field( + name="performCutover", visibility=["read", "create", "update", "delete", "query"] + ) + """To trigger customer controlled manual cutover during the wait state while Scaling operation is + in progress. + + This property parameter is only applicable for scaling operations that are initiated along with + 'manualCutover' parameter. + + This property is only applicable when scaling database from Business Critical/General + Purpose/Premium/Standard tier to Hyperscale tier is already in progress. + + When performCutover is specified, the scaling operation will trigger cutover and perform + role-change to Hyperscale database.""" + encryption_protector_auto_rotation: Optional[bool] = rest_field( + name="encryptionProtectorAutoRotation", visibility=["read", "create", "update", "delete", "query"] + ) + """The flag to enable or disable auto rotation of database encryption protector AKV key.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """Specifies the provisioning state for this resource.""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + create_mode: Optional[Union[str, "_models.CreateMode"]] = None, + collation: Optional[str] = None, + max_size_bytes: Optional[int] = None, + sample_name: Optional[Union[str, "_models.SampleName"]] = None, + elastic_pool_id: Optional[str] = None, + source_database_id: Optional[str] = None, + restore_point_in_time: Optional[datetime.datetime] = None, + source_database_deletion_date: Optional[datetime.datetime] = None, + recovery_services_recovery_point_id: Optional[str] = None, + long_term_retention_backup_resource_id: Optional[str] = None, + recoverable_database_id: Optional[str] = None, + restorable_dropped_database_id: Optional[str] = None, + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, + zone_redundant: Optional[bool] = None, + license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = None, + read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = None, + high_availability_replica_count: Optional[int] = None, + secondary_type: Optional[Union[str, "_models.SecondaryType"]] = None, + auto_pause_delay: Optional[int] = None, + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + min_capacity: Optional[float] = None, + maintenance_configuration_id: Optional[str] = None, + is_ledger_on: Optional[bool] = None, + federated_client_id: Optional[str] = None, + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = None, + encryption_protector: Optional[str] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, + use_free_limit: Optional[bool] = None, + free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None, + manual_cutover: Optional[bool] = None, + perform_cutover: Optional[bool] = None, + encryption_protector_auto_rotation: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseUsage(ProxyResourceAutoGenerated): + """Usage metric of a database. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseUsageProperties + """ + + properties: Optional["_models.DatabaseUsageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["display_name", "current_value", "limit", "unit"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseUsageProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseUsageProperties(_Model): + """Properties of a database usage. + + :ivar display_name: User-readable name of the metric. + :vartype display_name: str + :ivar current_value: Current value of the metric. + :vartype current_value: float + :ivar limit: Boundary value of the metric. + :vartype limit: float + :ivar unit: Unit of the metric. + :vartype unit: str + """ + + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """User-readable name of the metric.""" + current_value: Optional[float] = rest_field(name="currentValue", visibility=["read"]) + """Current value of the metric.""" + limit: Optional[float] = rest_field(visibility=["read"]) + """Boundary value of the metric.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Unit of the metric.""" + + +class DatabaseUserIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory principal id.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The Azure Active Directory client id.""" + + +class DatabaseVulnerabilityAssessment(ProxyResource): + """A database vulnerability assessment. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentProperties + """ + + properties: Optional["_models.DatabaseVulnerabilityAssessmentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "storage_container_path", + "storage_container_sas_key", + "storage_account_access_key", + "recurring_scans", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseVulnerabilityAssessmentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseVulnerabilityAssessmentProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Vulnerability Assessment. + + :ivar storage_container_path: A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). It is required if server level + vulnerability assessment policy doesn't set. + :vartype storage_container_path: str + :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to + the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' + isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not + behind a Vnet or a firewall. + :vartype storage_container_sas_key: str + :ivar storage_account_access_key: Specifies the identifier key of the storage account for + vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet + or a firewall. + :vartype storage_account_access_key: str + :ivar recurring_scans: The recurring scans settings. + :vartype recurring_scans: + ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties + """ + + storage_container_path: Optional[str] = rest_field(name="storageContainerPath", visibility=["create", "update"]) + """A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). It is required if server level + vulnerability assessment policy doesn't set.""" + storage_container_sas_key: Optional[str] = rest_field( + name="storageContainerSasKey", visibility=["create", "update"] + ) + """A shared access signature (SAS Key) that has write access to the blob container specified in + 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. Applies only if the storage account is not behind a Vnet or + a firewall.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the storage account for vulnerability assessment scan results. + If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. Applies only + if the storage account is not behind a Vnet or a firewall.""" + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = rest_field( + name="recurringScans", visibility=["read", "create", "update", "delete", "query"] + ) + """The recurring scans settings.""" + + @overload + def __init__( + self, + *, + storage_container_path: Optional[str] = None, + storage_container_sas_key: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseVulnerabilityAssessmentRuleBaseline(ProxyResource): # pylint: disable=name-too-long + """A database vulnerability assessment rule baseline. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineProperties + """ + + properties: Optional["_models.DatabaseVulnerabilityAssessmentRuleBaselineProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["baseline_results"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseVulnerabilityAssessmentRuleBaselineProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DatabaseVulnerabilityAssessmentRuleBaselineItem(_Model): # pylint: disable=name-too-long + """Properties for an Azure SQL Database Vulnerability Assessment rule baseline's result. + + :ivar result: The rule baseline result. Required. + :vartype result: list[str] + """ + + result: list[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The rule baseline result. Required.""" + + @overload + def __init__( + self, + *, + result: list[str], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseVulnerabilityAssessmentRuleBaselineProperties(_Model): # pylint: disable=name-too-long + """Properties of a database Vulnerability Assessment rule baseline. + + :ivar baseline_results: The rule baseline result. Required. + :vartype baseline_results: + list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] + """ + + baseline_results: list["_models.DatabaseVulnerabilityAssessmentRuleBaselineItem"] = rest_field( + name="baselineResults", visibility=["read", "create", "update", "delete", "query"] + ) + """The rule baseline result. Required.""" + + @overload + def __init__( + self, + *, + baseline_results: list["_models.DatabaseVulnerabilityAssessmentRuleBaselineItem"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DatabaseVulnerabilityAssessmentScanExportProperties(_Model): # pylint: disable=name-too-long + """Properties of the export operation's result. + + :ivar exported_report_location: Location of the exported report (e.g. + `https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx + `_). + :vartype exported_report_location: str + """ + + exported_report_location: Optional[str] = rest_field(name="exportedReportLocation", visibility=["read"]) + """Location of the exported report (e.g. + `https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx + `_).""" + + +class DatabaseVulnerabilityAssessmentScansExport(ProxyResourceAutoGenerated): # pylint: disable=name-too-long + """A database Vulnerability Assessment scan export resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScanExportProperties + """ + + properties: Optional["_models.DatabaseVulnerabilityAssessmentScanExportProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["exported_report_location"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DatabaseVulnerabilityAssessmentScanExportProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DataMaskingPolicy(ProxyResource): + """A database data masking policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DataMaskingPolicyProperties + :ivar location: The location of the data masking policy. + :vartype location: str + :ivar kind: The kind of Data Masking Policy. Metadata, used for Azure portal. + :vartype kind: str + """ + + properties: Optional["_models.DataMaskingPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + location: Optional[str] = rest_field(visibility=["read"]) + """The location of the data masking policy.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """The kind of Data Masking Policy. Metadata, used for Azure portal.""" + + __flattened_items = ["data_masking_state", "exempt_principals", "application_principals", "masking_level"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DataMaskingPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DataMaskingPolicyProperties(_Model): + """The properties of a database data masking policy. + + :ivar data_masking_state: The state of the data masking policy. Required. Known values are: + "Enabled" and "Disabled". + :vartype data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState + :ivar exempt_principals: The list of the exempt principals. Specifies the semicolon-separated + list of database users for which the data masking policy does not apply. The specified users + receive data results without masking for all of the database queries. + :vartype exempt_principals: str + :ivar application_principals: The list of the application principals. This is a legacy + parameter and is no longer used. + :vartype application_principals: str + :ivar masking_level: The masking level. This is a legacy parameter and is no longer used. + :vartype masking_level: str + """ + + data_masking_state: Union[str, "_models.DataMaskingState"] = rest_field( + name="dataMaskingState", visibility=["read", "create", "update", "delete", "query"] + ) + """The state of the data masking policy. Required. Known values are: \"Enabled\" and \"Disabled\".""" + exempt_principals: Optional[str] = rest_field( + name="exemptPrincipals", visibility=["read", "create", "update", "delete", "query"] + ) + """The list of the exempt principals. Specifies the semicolon-separated list of database users for + which the data masking policy does not apply. The specified users receive data results without + masking for all of the database queries.""" + application_principals: Optional[str] = rest_field(name="applicationPrincipals", visibility=["read"]) + """The list of the application principals. This is a legacy parameter and is no longer used.""" + masking_level: Optional[str] = rest_field(name="maskingLevel", visibility=["read"]) + """The masking level. This is a legacy parameter and is no longer used.""" + + @overload + def __init__( + self, + *, + data_masking_state: Union[str, "_models.DataMaskingState"], + exempt_principals: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataMaskingRule(ProxyResourceAutoGenerated): + """A database data masking rule. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar location: The location of the data masking rule. + :vartype location: str + :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure portal. + :vartype kind: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DataMaskingRuleProperties + """ + + location: Optional[str] = rest_field(visibility=["read"]) + """The location of the data masking rule.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """The kind of Data Masking Rule. Metadata, used for Azure portal.""" + properties: Optional["_models.DataMaskingRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "id", + "rule_state", + "schema_name", + "table_name", + "column_name", + "alias_name", + "masking_function", + "number_from", + "number_to", + "prefix_size", + "suffix_size", + "replacement_string", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DataMaskingRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DataMaskingRuleProperties(_Model): + """The properties of a database data masking rule. + + :ivar id: The rule Id. + :vartype id: str + :ivar rule_state: The rule state. Used to delete a rule. To delete an existing rule, specify + the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. + However, if the rule doesn't already exist, the rule will be created with ruleState set to + enabled, regardless of the provided value of ruleState. Known values are: "Enabled" and + "Disabled". + :vartype rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState + :ivar schema_name: The schema name on which the data masking rule is applied. Required. + :vartype schema_name: str + :ivar table_name: The table name on which the data masking rule is applied. Required. + :vartype table_name: str + :ivar column_name: The column name on which the data masking rule is applied. Required. + :vartype column_name: str + :ivar alias_name: The alias name. This is a legacy parameter and is no longer used. + :vartype alias_name: str + :ivar masking_function: The masking function that is used for the data masking rule. Required. + Known values are: "Default", "CCN", "Email", "Number", "SSN", and "Text". + :vartype masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction + :ivar number_from: The numberFrom property of the masking rule. Required if maskingFunction is + set to Number, otherwise this parameter will be ignored. + :vartype number_from: str + :ivar number_to: The numberTo property of the data masking rule. Required if maskingFunction is + set to Number, otherwise this parameter will be ignored. + :vartype number_to: str + :ivar prefix_size: If maskingFunction is set to Text, the number of characters to show unmasked + in the beginning of the string. Otherwise, this parameter will be ignored. + :vartype prefix_size: str + :ivar suffix_size: If maskingFunction is set to Text, the number of characters to show unmasked + at the end of the string. Otherwise, this parameter will be ignored. + :vartype suffix_size: str + :ivar replacement_string: If maskingFunction is set to Text, the character to use for masking + the unexposed part of the string. Otherwise, this parameter will be ignored. + :vartype replacement_string: str + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The rule Id.""" + rule_state: Optional[Union[str, "_models.DataMaskingRuleState"]] = rest_field( + name="ruleState", visibility=["read", "create", "update", "delete", "query"] + ) + """The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, + tableName, columnName, maskingFunction, and specify ruleState as disabled. However, if the rule + doesn't already exist, the rule will be created with ruleState set to enabled, regardless of + the provided value of ruleState. Known values are: \"Enabled\" and \"Disabled\".""" + schema_name: str = rest_field(name="schemaName", visibility=["read", "create", "update", "delete", "query"]) + """The schema name on which the data masking rule is applied. Required.""" + table_name: str = rest_field(name="tableName", visibility=["read", "create", "update", "delete", "query"]) + """The table name on which the data masking rule is applied. Required.""" + column_name: str = rest_field(name="columnName", visibility=["read", "create", "update", "delete", "query"]) + """The column name on which the data masking rule is applied. Required.""" + alias_name: Optional[str] = rest_field(name="aliasName", visibility=["read", "create", "update", "delete", "query"]) + """The alias name. This is a legacy parameter and is no longer used.""" + masking_function: Union[str, "_models.DataMaskingFunction"] = rest_field( + name="maskingFunction", visibility=["read", "create", "update", "delete", "query"] + ) + """The masking function that is used for the data masking rule. Required. Known values are: + \"Default\", \"CCN\", \"Email\", \"Number\", \"SSN\", and \"Text\".""" + number_from: Optional[str] = rest_field( + name="numberFrom", visibility=["read", "create", "update", "delete", "query"] + ) + """The numberFrom property of the masking rule. Required if maskingFunction is set to Number, + otherwise this parameter will be ignored.""" + number_to: Optional[str] = rest_field(name="numberTo", visibility=["read", "create", "update", "delete", "query"]) + """The numberTo property of the data masking rule. Required if maskingFunction is set to Number, + otherwise this parameter will be ignored.""" + prefix_size: Optional[str] = rest_field( + name="prefixSize", visibility=["read", "create", "update", "delete", "query"] + ) + """If maskingFunction is set to Text, the number of characters to show unmasked in the beginning + of the string. Otherwise, this parameter will be ignored.""" + suffix_size: Optional[str] = rest_field( + name="suffixSize", visibility=["read", "create", "update", "delete", "query"] + ) + """If maskingFunction is set to Text, the number of characters to show unmasked at the end of the + string. Otherwise, this parameter will be ignored.""" + replacement_string: Optional[str] = rest_field( + name="replacementString", visibility=["read", "create", "update", "delete", "query"] + ) + """If maskingFunction is set to Text, the character to use for masking the unexposed part of the + string. Otherwise, this parameter will be ignored.""" + + @overload + def __init__( + self, + *, + schema_name: str, + table_name: str, + column_name: str, + masking_function: Union[str, "_models.DataMaskingFunction"], + rule_state: Optional[Union[str, "_models.DataMaskingRuleState"]] = None, + alias_name: Optional[str] = None, + number_from: Optional[str] = None, + number_to: Optional[str] = None, + prefix_size: Optional[str] = None, + suffix_size: Optional[str] = None, + replacement_string: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataSyncParticipantIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar type: The Datasync identity type. Required. Known values are: "None", "SystemAssigned", + "UserAssigned", and "SystemAssignedUserAssigned". + :vartype type: str or ~azure.mgmt.sql.models.DataSyncParticipantIdentityType + :ivar tenant_id: The DataSync participant identity tenant id. + :vartype tenant_id: str + :ivar user_assigned_identities: The resource ids of the user assigned identities to use. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.DataSyncParticipantUserAssignedIdentity] + """ + + type: Union[str, "_models.DataSyncParticipantIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Datasync identity type. Required. Known values are: \"None\", \"SystemAssigned\", + \"UserAssigned\", and \"SystemAssignedUserAssigned\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The DataSync participant identity tenant id.""" + user_assigned_identities: Optional[dict[str, "_models.DataSyncParticipantUserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ids of the user assigned identities to use.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.DataSyncParticipantIdentityType"], + tenant_id: Optional[str] = None, + user_assigned_identities: Optional[dict[str, "_models.DataSyncParticipantUserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DataSyncParticipantUserAssignedIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory principal id.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The Azure Active Directory client id.""" + + +class DataWarehouseUserActivities(ProxyResource): + """User activities of a data warehouse. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DataWarehouseUserActivitiesProperties + """ + + properties: Optional["_models.DataWarehouseUserActivitiesProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["active_queries_count"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DataWarehouseUserActivitiesProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DataWarehouseUserActivitiesProperties(_Model): + """User activities of a data warehouse. This currently includes the count of running or suspended + queries. For more information, please view the sys.dm_pdw_exec_requests dynamic management view + (DMV). + + :ivar active_queries_count: Count of running and suspended queries. + :vartype active_queries_count: int + """ + + active_queries_count: Optional[int] = rest_field(name="activeQueriesCount", visibility=["read"]) + """Count of running and suspended queries.""" + + +class DeletedServer(ProxyResource): + """A deleted server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DeletedServerProperties + """ + + properties: Optional["_models.DeletedServerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["version", "deletion_time", "original_id", "fully_qualified_domain_name"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DeletedServerProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DeletedServerProperties(_Model): + """The properties of a deleted server. + + :ivar version: The version of the deleted server. + :vartype version: str + :ivar deletion_time: The deletion time of the deleted server. + :vartype deletion_time: ~datetime.datetime + :ivar original_id: The original ID of the server before deletion. + :vartype original_id: str + :ivar fully_qualified_domain_name: The fully qualified domain name of the server. + :vartype fully_qualified_domain_name: str + """ + + version: Optional[str] = rest_field(visibility=["read"]) + """The version of the deleted server.""" + deletion_time: Optional[datetime.datetime] = rest_field(name="deletionTime", visibility=["read"], format="rfc3339") + """The deletion time of the deleted server.""" + original_id: Optional[str] = rest_field(name="originalId", visibility=["read"]) + """The original ID of the server before deletion.""" + fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) + """The fully qualified domain name of the server.""" + + +class DistributedAvailabilityGroup(ProxyResource): + """Distributed availability group between box and Sql Managed Instance. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.DistributedAvailabilityGroupProperties + """ + + properties: Optional["_models.DistributedAvailabilityGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "distributed_availability_group_name", + "distributed_availability_group_id", + "replication_mode", + "partner_link_role", + "partner_availability_group_name", + "partner_endpoint", + "instance_link_role", + "instance_availability_group_name", + "failover_mode", + "seeding_mode", + "databases", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.DistributedAvailabilityGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class DistributedAvailabilityGroupDatabase(_Model): + """Database specific information. + + :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 + """ + + database_name: Optional[str] = rest_field( + name="databaseName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the database in link.""" + instance_replica_id: Optional[str] = rest_field(name="instanceReplicaId", visibility=["read"]) + """Managed instance replica id.""" + partner_replica_id: Optional[str] = rest_field(name="partnerReplicaId", visibility=["read"]) + """SQL server replica id.""" + replica_state: Optional[str] = rest_field(name="replicaState", visibility=["read"]) + """Current link state.""" + seeding_progress: Optional[str] = rest_field(name="seedingProgress", visibility=["read"]) + """Seeding progress.""" + synchronization_health: Optional[Union[str, "_models.ReplicaSynchronizationHealth"]] = rest_field( + name="synchronizationHealth", visibility=["read"] + ) + """Link health state. Known values are: \"NOT_HEALTHY\", \"PARTIALLY_HEALTHY\", and \"HEALTHY\".""" + connected_state: Optional[Union[str, "_models.ReplicaConnectedState"]] = rest_field( + name="connectedState", visibility=["read"] + ) + """Link connected state. Known values are: \"DISCONNECTED\" and \"CONNECTED\".""" + last_received_lsn: Optional[str] = rest_field(name="lastReceivedLsn", visibility=["read"]) + """Last received LSN.""" + last_received_time: Optional[datetime.datetime] = rest_field( + name="lastReceivedTime", visibility=["read"], format="rfc3339" + ) + """Last received LSN time.""" + last_sent_lsn: Optional[str] = rest_field(name="lastSentLsn", visibility=["read"]) + """Last sent LSN.""" + last_sent_time: Optional[datetime.datetime] = rest_field(name="lastSentTime", visibility=["read"], format="rfc3339") + """Last sent LSN time.""" + last_commit_lsn: Optional[str] = rest_field(name="lastCommitLsn", visibility=["read"]) + """Last commit LSN.""" + last_commit_time: Optional[datetime.datetime] = rest_field( + name="lastCommitTime", visibility=["read"], format="rfc3339" + ) + """Last commit LSN time.""" + last_hardened_lsn: Optional[str] = rest_field(name="lastHardenedLsn", visibility=["read"]) + """Last hardened LSN.""" + last_hardened_time: Optional[datetime.datetime] = rest_field( + name="lastHardenedTime", visibility=["read"], format="rfc3339" + ) + """Last hardened LSN time.""" + last_backup_lsn: Optional[str] = rest_field(name="lastBackupLsn", visibility=["read"]) + """Last backup LSN.""" + last_backup_time: Optional[datetime.datetime] = rest_field( + name="lastBackupTime", visibility=["read"], format="rfc3339" + ) + """Last backup LSN time.""" + most_recent_link_error: Optional[str] = rest_field(name="mostRecentLinkError", visibility=["read"]) + """The most recent link connection error description.""" + partner_auth_cert_validity: Optional["_models.CertificateInfo"] = rest_field( + name="partnerAuthCertValidity", visibility=["read"] + ) + """SQL server certificate validity.""" + instance_send_replication_lag_seconds: Optional[int] = rest_field( + name="instanceSendReplicationLagSeconds", visibility=["read"] + ) + """Replication lag when Managed Instance link side is primary.""" + instance_redo_replication_lag_seconds: Optional[int] = rest_field( + name="instanceRedoReplicationLagSeconds", visibility=["read"] + ) + """Redo lag when Managed Instance link side is primary.""" + + @overload + def __init__( + self, + *, + database_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DistributedAvailabilityGroupProperties(_Model): + """The properties of a distributed availability group. + + :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. + :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] + """ + + distributed_availability_group_name: Optional[str] = rest_field( + name="distributedAvailabilityGroupName", visibility=["read"] + ) + """Name of the distributed availability group.""" + distributed_availability_group_id: Optional[str] = rest_field( + name="distributedAvailabilityGroupId", visibility=["read"] + ) + """ID of the distributed availability group.""" + replication_mode: Optional[Union[str, "_models.ReplicationModeType"]] = rest_field( + name="replicationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Replication mode of the link. Known values are: \"Async\" and \"Sync\".""" + partner_link_role: Optional[Union[str, "_models.LinkRole"]] = rest_field( + name="partnerLinkRole", visibility=["read"] + ) + """SQL server side link role. Known values are: \"Primary\" and \"Secondary\".""" + partner_availability_group_name: Optional[str] = rest_field( + name="partnerAvailabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL server side availability group name.""" + partner_endpoint: Optional[str] = rest_field( + name="partnerEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL server side endpoint - IP or DNS resolvable name.""" + instance_link_role: Optional[Union[str, "_models.LinkRole"]] = rest_field( + name="instanceLinkRole", visibility=["read", "create", "update", "delete", "query"] + ) + """Managed instance side link role. Known values are: \"Primary\" and \"Secondary\".""" + instance_availability_group_name: Optional[str] = rest_field( + name="instanceAvailabilityGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """Managed instance side availability group name.""" + failover_mode: Optional[Union[str, "_models.FailoverModeType"]] = rest_field( + name="failoverMode", visibility=["read", "create", "update", "delete", "query"] + ) + """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\".""" + seeding_mode: Optional[Union[str, "_models.SeedingModeType"]] = rest_field( + name="seedingMode", visibility=["read", "create", "update", "delete", "query"] + ) + """Database seeding mode – can be Automatic (default), or Manual for supported scenarios. Known + values are: \"Automatic\" and \"Manual\".""" + databases: Optional[list["_models.DistributedAvailabilityGroupDatabase"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Databases in the distributed availability group.""" + + @overload + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DistributedAvailabilityGroupSetRole(_Model): + """Distributed availability group failover request. + + :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 + """ + + instance_role: Union[str, "_models.InstanceRole"] = rest_field(name="instanceRole", visibility=["create", "update"]) + """New role of managed instance in a distributed availability group, can be Primary or Secondary. + Required. Known values are: \"Primary\" and \"Secondary\".""" + role_change_type: Union[str, "_models.RoleChangeType"] = rest_field( + name="roleChangeType", visibility=["create", "update"] + ) + """The type of the role change, can be Planned or Forced. Required. Known values are: \"Forced\" + and \"Planned\".""" + + @overload + def __init__( + self, + *, + instance_role: Union[str, "_models.InstanceRole"], + role_change_type: Union[str, "_models.RoleChangeType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class DistributedAvailabilityGroupsFailoverRequest(_Model): # pylint: disable=name-too-long + """Distributed availability group failover. + + :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 + """ + + failover_type: Union[str, "_models.FailoverType"] = rest_field(name="failoverType", visibility=["create", "update"]) + """The failover type, can be ForcedAllowDataLoss or Planned. Required. Known values are: + \"ForcedAllowDataLoss\" and \"Planned\".""" + + @overload + def __init__( + self, + *, + failover_type: Union[str, "_models.FailoverType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EditionCapability(_Model): + """The edition capability. + + :ivar name: The database edition name. + :vartype name: str + :ivar supported_service_level_objectives: The list of supported service objectives for the + edition. + :vartype supported_service_level_objectives: + list[~azure.mgmt.sql.models.ServiceObjectiveCapability] + :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. + :vartype zone_redundant: bool + :ivar read_scale: The read scale capability for the edition. + :vartype read_scale: ~azure.mgmt.sql.models.ReadScaleCapability + :ivar supported_storage_capabilities: The list of supported storage capabilities for this + edition. + :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] + :ivar zone_pinning: Whether or not zone pinning is supported for the edition. + :vartype zone_pinning: bool + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The database edition name.""" + supported_service_level_objectives: Optional[list["_models.ServiceObjectiveCapability"]] = rest_field( + name="supportedServiceLevelObjectives", visibility=["read"] + ) + """The list of supported service objectives for the edition.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the edition.""" + read_scale: Optional["_models.ReadScaleCapability"] = rest_field(name="readScale", visibility=["read"]) + """The read scale capability for the edition.""" + supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = rest_field( + name="supportedStorageCapabilities", visibility=["read"] + ) + """The list of supported storage capabilities for this edition.""" + zone_pinning: Optional[bool] = rest_field(name="zonePinning", visibility=["read"]) + """Whether or not zone pinning is supported for the edition.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPool(TrackedResource): + """An elastic pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ElasticPoolProperties + :ivar sku: The elastic pool SKU. + + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU + name, tier/edition, family, and capacity) that are available to your subscription in an Azure + region, use the ``Capabilities_ListByLocation`` REST API or the following command: + + + + .. code-block:: azurecli + + az sql elastic-pool list-editions -l -o table. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar kind: Kind of elastic pool. This is metadata used for the Azure portal experience. + :vartype kind: str + """ + + properties: Optional["_models.ElasticPoolProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The elastic pool SKU. + + The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU + name, tier/edition, family, and capacity) that are available to your subscription in an Azure + region, use the ``Capabilities_ListByLocation`` REST API or the following command: + + + + .. code-block:: azurecli + + az sql elastic-pool list-editions -l -o table.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of elastic pool. This is metadata used for the Azure portal experience.""" + + __flattened_items = [ + "state", + "creation_date", + "max_size_bytes", + "min_capacity", + "per_database_settings", + "zone_redundant", + "license_type", + "maintenance_configuration_id", + "high_availability_replica_count", + "auto_pause_delay", + "preferred_enclave_type", + "availability_zone", + "current_sku", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ElasticPoolProperties"] = None, + sku: Optional["_models.Sku"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ElasticPoolEditionCapability(_Model): + """The elastic pool edition capability. + + :ivar name: The elastic pool edition name. + :vartype name: str + :ivar supported_elastic_pool_performance_levels: The list of supported elastic pool DTU levels + for the edition. + :vartype supported_elastic_pool_performance_levels: + list[~azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability] + :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. + :vartype zone_redundant: bool + :ivar zone_pinning: Whether or not zone pinning is supported for the edition. + :vartype zone_pinning: bool + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The elastic pool edition name.""" + supported_elastic_pool_performance_levels: Optional[list["_models.ElasticPoolPerformanceLevelCapability"]] = ( + rest_field(name="supportedElasticPoolPerformanceLevels", visibility=["read"]) + ) + """The list of supported elastic pool DTU levels for the edition.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the edition.""" + zone_pinning: Optional[bool] = rest_field(name="zonePinning", visibility=["read"]) + """Whether or not zone pinning is supported for the edition.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolOperation(ProxyResourceAutoGenerated): + """A elastic pool operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ElasticPoolOperationProperties + """ + + properties: Optional["_models.ElasticPoolOperationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "elastic_pool_name", + "operation", + "operation_friendly_name", + "percent_complete", + "server_name", + "start_time", + "state", + "error_code", + "error_description", + "error_severity", + "is_user_error", + "estimated_completion_time", + "description", + "is_cancellable", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ElasticPoolOperationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ElasticPoolOperationProperties(_Model): + """The properties of a elastic pool operation. + + :ivar elastic_pool_name: The name of the elastic pool the operation is being performed on. + :vartype elastic_pool_name: str + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar server_name: The name of the server. + :vartype server_name: str + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. + :vartype state: str + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + elastic_pool_name: Optional[str] = rest_field(name="elasticPoolName", visibility=["read"]) + """The name of the elastic pool the operation is being performed on.""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the operation completed.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """The name of the server.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[str] = rest_field(visibility=["read"]) + """The operation state.""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + is_user_error: Optional[bool] = rest_field(name="isUserError", visibility=["read"]) + """Whether or not the error is a user error.""" + estimated_completion_time: Optional[datetime.datetime] = rest_field( + name="estimatedCompletionTime", visibility=["read"], format="rfc3339" + ) + """The estimated completion time of the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The operation description.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Whether the operation can be cancelled.""" + + +class ElasticPoolPerDatabaseMaxPerformanceLevelCapability(_Model): # pylint: disable=name-too-long + """The max per-database performance level capability. + + :ivar limit: The maximum performance level per database. + :vartype limit: float + :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". + :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit + :ivar supported_per_database_min_performance_levels: The list of supported min database + performance levels. + :vartype supported_per_database_min_performance_levels: + list[~azure.mgmt.sql.models.ElasticPoolPerDatabaseMinPerformanceLevelCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + limit: Optional[float] = rest_field(visibility=["read"]) + """The maximum performance level per database.""" + unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = rest_field(visibility=["read"]) + """Unit type used to measure performance level. Known values are: \"DTU\" and \"VCores\".""" + supported_per_database_min_performance_levels: Optional[ + list["_models.ElasticPoolPerDatabaseMinPerformanceLevelCapability"] + ] = rest_field(name="supportedPerDatabaseMinPerformanceLevels", visibility=["read"]) + """The list of supported min database performance levels.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolPerDatabaseMinPerformanceLevelCapability(_Model): # pylint: disable=name-too-long + """The minimum per-database performance level capability. + + :ivar limit: The minimum performance level per database. + :vartype limit: float + :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". + :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + limit: Optional[float] = rest_field(visibility=["read"]) + """The minimum performance level per database.""" + unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = rest_field(visibility=["read"]) + """Unit type used to measure performance level. Known values are: \"DTU\" and \"VCores\".""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolPerDatabaseSettings(_Model): + """Per database settings of an elastic pool. + + :ivar min_capacity: The minimum capacity all databases are guaranteed. + :vartype min_capacity: float + :ivar max_capacity: The maximum capacity any one database can consume. + :vartype max_capacity: float + :ivar auto_pause_delay: Auto Pause Delay for per database within pool. + :vartype auto_pause_delay: int + """ + + min_capacity: Optional[float] = rest_field( + name="minCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """The minimum capacity all databases are guaranteed.""" + max_capacity: Optional[float] = rest_field( + name="maxCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum capacity any one database can consume.""" + auto_pause_delay: Optional[int] = rest_field( + name="autoPauseDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Auto Pause Delay for per database within pool.""" + + @overload + def __init__( + self, + *, + min_capacity: Optional[float] = None, + max_capacity: Optional[float] = None, + auto_pause_delay: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolPerformanceLevelCapability(_Model): + """The Elastic Pool performance level capability. + + :ivar performance_level: The performance level for the pool. + :vartype performance_level: ~azure.mgmt.sql.models.PerformanceLevelCapability + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar supported_license_types: List of supported license types. + :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] + :ivar max_database_count: The maximum number of databases supported. + :vartype max_database_count: int + :ivar included_max_size: The included (free) max size for this performance level. + :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar supported_max_sizes: The list of supported max sizes. + :vartype supported_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] + :ivar supported_per_database_max_sizes: The list of supported per database max sizes. + :vartype supported_per_database_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] + :ivar supported_per_database_max_performance_levels: The list of supported per database max + performance levels. + :vartype supported_per_database_max_performance_levels: + list[~azure.mgmt.sql.models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability] + :ivar zone_redundant: Whether or not zone redundancy is supported for the performance level. + :vartype zone_redundant: bool + :ivar supported_maintenance_configurations: List of supported maintenance configurations. + :vartype supported_maintenance_configurations: + list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] + :ivar supported_min_capacities: List of supported min capacities. + :vartype supported_min_capacities: list[~azure.mgmt.sql.models.MinCapacityCapability] + :ivar supported_auto_pause_delay: Supported time range for auto pause delay. + :vartype supported_auto_pause_delay: ~azure.mgmt.sql.models.AutoPauseDelayTimeRange + :ivar supported_per_database_auto_pause_delay: Supported time range for per database auto pause + delay. + :vartype supported_per_database_auto_pause_delay: + ~azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange + :ivar supported_zones: List of supported availability zones. + :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + performance_level: Optional["_models.PerformanceLevelCapability"] = rest_field( + name="performanceLevel", visibility=["read"] + ) + """The performance level for the pool.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read"]) + """The sku.""" + supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = rest_field( + name="supportedLicenseTypes", visibility=["read"] + ) + """List of supported license types.""" + max_database_count: Optional[int] = rest_field(name="maxDatabaseCount", visibility=["read"]) + """The maximum number of databases supported.""" + included_max_size: Optional["_models.MaxSizeCapability"] = rest_field(name="includedMaxSize", visibility=["read"]) + """The included (free) max size for this performance level.""" + supported_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = rest_field( + name="supportedMaxSizes", visibility=["read"] + ) + """The list of supported max sizes.""" + supported_per_database_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = rest_field( + name="supportedPerDatabaseMaxSizes", visibility=["read"] + ) + """The list of supported per database max sizes.""" + supported_per_database_max_performance_levels: Optional[ + list["_models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability"] + ] = rest_field(name="supportedPerDatabaseMaxPerformanceLevels", visibility=["read"]) + """The list of supported per database max performance levels.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the performance level.""" + supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = rest_field( + name="supportedMaintenanceConfigurations", visibility=["read"] + ) + """List of supported maintenance configurations.""" + supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = rest_field( + name="supportedMinCapacities", visibility=["read"] + ) + """List of supported min capacities.""" + supported_auto_pause_delay: Optional["_models.AutoPauseDelayTimeRange"] = rest_field( + name="supportedAutoPauseDelay", visibility=["read"] + ) + """Supported time range for auto pause delay.""" + supported_per_database_auto_pause_delay: Optional["_models.PerDatabaseAutoPauseDelayTimeRange"] = rest_field( + name="supportedPerDatabaseAutoPauseDelay", visibility=["read"] + ) + """Supported time range for per database auto pause delay.""" + supported_zones: Optional[list["_models.ZonePinningCapability"]] = rest_field( + name="supportedZones", visibility=["read"] + ) + """List of supported availability zones.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolProperties(_Model): + """Properties of an elastic pool. + + :ivar state: The state of the elastic pool. Known values are: "Creating", "Ready", and + "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.ElasticPoolState + :ivar creation_date: The creation date of the elastic pool (ISO8601 format). + :vartype creation_date: ~datetime.datetime + :ivar max_size_bytes: The storage limit for the database elastic pool in bytes. + :vartype max_size_bytes: int + :ivar min_capacity: Minimal capacity that serverless pool will not shrink below, if not paused. + :vartype min_capacity: float + :ivar per_database_settings: The per database settings for the elastic pool. + :vartype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings + :ivar zone_redundant: Whether or not this elastic pool is zone redundant, which means the + replicas of this elastic pool will be spread across multiple availability zones. + :vartype zone_redundant: bool + :ivar license_type: The license type to apply for this elastic pool. Known values are: + "LicenseIncluded" and "BasePrice". + :vartype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType + :ivar maintenance_configuration_id: Maintenance configuration id assigned to the elastic pool. + This configuration defines the period when the maintenance updates will will occur. + :vartype maintenance_configuration_id: str + :ivar high_availability_replica_count: The number of secondary replicas associated with the + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. + :vartype high_availability_replica_count: int + :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int + :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: + "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType + :ivar availability_zone: Specifies the availability zone the pool's primary replica is pinned + to. Known values are: "NoPreference", "1", "2", and "3". + :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType + :ivar current_sku: The name and tier of the current SKU. + :vartype current_sku: ~azure.mgmt.sql.models.Sku + """ + + state: Optional[Union[str, "_models.ElasticPoolState"]] = rest_field(visibility=["read"]) + """The state of the elastic pool. Known values are: \"Creating\", \"Ready\", and \"Disabled\".""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the elastic pool (ISO8601 format).""" + max_size_bytes: Optional[int] = rest_field( + name="maxSizeBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The storage limit for the database elastic pool in bytes.""" + min_capacity: Optional[float] = rest_field( + name="minCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal capacity that serverless pool will not shrink below, if not paused.""" + per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = rest_field( + name="perDatabaseSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """The per database settings for the elastic pool.""" + zone_redundant: Optional[bool] = rest_field( + name="zoneRedundant", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this elastic pool is zone redundant, which means the replicas of this elastic + pool will be spread across multiple availability zones.""" + license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to apply for this elastic pool. Known values are: \"LicenseIncluded\" and + \"BasePrice\".""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Maintenance configuration id assigned to the elastic pool. This configuration defines the + period when the maintenance updates will will occur.""" + high_availability_replica_count: Optional[int] = rest_field( + name="highAvailabilityReplicaCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas associated with the Business Critical, Premium, or Hyperscale + edition elastic pool that are used to provide high availability. Applicable only to Hyperscale + elastic pools.""" + auto_pause_delay: Optional[int] = rest_field( + name="autoPauseDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Time in minutes after which elastic pool is automatically paused. A value of -1 means that + automatic pause is disabled.""" + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = rest_field( + name="preferredEnclaveType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of enclave requested on the elastic pool. Known values are: \"Default\" and \"VBS\".""" + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = rest_field( + name="availabilityZone", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the availability zone the pool's primary replica is pinned to. Known values are: + \"NoPreference\", \"1\", \"2\", and \"3\".""" + current_sku: Optional["_models.Sku"] = rest_field(name="currentSku", visibility=["read"]) + """The name and tier of the current SKU.""" + + @overload + def __init__( + self, + *, + max_size_bytes: Optional[int] = None, + min_capacity: Optional[float] = None, + per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = None, + zone_redundant: Optional[bool] = None, + license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, + maintenance_configuration_id: Optional[str] = None, + high_availability_replica_count: Optional[int] = None, + auto_pause_delay: Optional[int] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ElasticPoolUpdate(_Model): + """An elastic pool update. + + :ivar sku: An ARM Resource SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ElasticPoolUpdateProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """An ARM Resource SKU.""" + properties: Optional["_models.ElasticPoolUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = [ + "max_size_bytes", + "min_capacity", + "per_database_settings", + "zone_redundant", + "license_type", + "maintenance_configuration_id", + "high_availability_replica_count", + "auto_pause_delay", + "preferred_enclave_type", + "availability_zone", + "current_sku", + ] + + @overload + def __init__( + self, + *, + sku: Optional["_models.Sku"] = None, + properties: Optional["_models.ElasticPoolUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ElasticPoolUpdateProperties(_Model): + """Properties of an elastic pool. + + :ivar max_size_bytes: The storage limit for the database elastic pool in bytes. + :vartype max_size_bytes: int + :ivar min_capacity: Minimal capacity that serverless pool will not shrink below, if not paused. + :vartype min_capacity: float + :ivar per_database_settings: The per database settings for the elastic pool. + :vartype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings + :ivar zone_redundant: Whether or not this elastic pool is zone redundant, which means the + replicas of this elastic pool will be spread across multiple availability zones. + :vartype zone_redundant: bool + :ivar license_type: The license type to apply for this elastic pool. Known values are: + "LicenseIncluded" and "BasePrice". + :vartype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType + :ivar maintenance_configuration_id: Maintenance configuration id assigned to the elastic pool. + This configuration defines the period when the maintenance updates will will occur. + :vartype maintenance_configuration_id: str + :ivar high_availability_replica_count: The number of secondary replicas associated with the + Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high + availability. Applicable only to Hyperscale elastic pools. + :vartype high_availability_replica_count: int + :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A + value of -1 means that automatic pause is disabled. + :vartype auto_pause_delay: int + :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: + "Default" and "VBS". + :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType + :ivar availability_zone: Specifies the availability zone the pool's primary replica is pinned + to. Known values are: "NoPreference", "1", "2", and "3". + :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType + :ivar current_sku: The name and tier of the current SKU. + :vartype current_sku: ~azure.mgmt.sql.models.Sku + """ + + max_size_bytes: Optional[int] = rest_field( + name="maxSizeBytes", visibility=["read", "create", "update", "delete", "query"] + ) + """The storage limit for the database elastic pool in bytes.""" + min_capacity: Optional[float] = rest_field( + name="minCapacity", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal capacity that serverless pool will not shrink below, if not paused.""" + per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = rest_field( + name="perDatabaseSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """The per database settings for the elastic pool.""" + zone_redundant: Optional[bool] = rest_field( + name="zoneRedundant", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this elastic pool is zone redundant, which means the replicas of this elastic + pool will be spread across multiple availability zones.""" + license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type to apply for this elastic pool. Known values are: \"LicenseIncluded\" and + \"BasePrice\".""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Maintenance configuration id assigned to the elastic pool. This configuration defines the + period when the maintenance updates will will occur.""" + high_availability_replica_count: Optional[int] = rest_field( + name="highAvailabilityReplicaCount", visibility=["read", "create", "update", "delete", "query"] + ) + """The number of secondary replicas associated with the Business Critical, Premium, or Hyperscale + edition elastic pool that are used to provide high availability. Applicable only to Hyperscale + elastic pools.""" + auto_pause_delay: Optional[int] = rest_field( + name="autoPauseDelay", visibility=["read", "create", "update", "delete", "query"] + ) + """Time in minutes after which elastic pool is automatically paused. A value of -1 means that + automatic pause is disabled.""" + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = rest_field( + name="preferredEnclaveType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of enclave requested on the elastic pool. Known values are: \"Default\" and \"VBS\".""" + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = rest_field( + name="availabilityZone", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the availability zone the pool's primary replica is pinned to. Known values are: + \"NoPreference\", \"1\", \"2\", and \"3\".""" + current_sku: Optional["_models.Sku"] = rest_field(name="currentSku", visibility=["read"]) + """The name and tier of the current SKU.""" + + @overload + def __init__( + self, + *, + max_size_bytes: Optional[int] = None, + min_capacity: Optional[float] = None, + per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = None, + zone_redundant: Optional[bool] = None, + license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, + maintenance_configuration_id: Optional[str] = None, + high_availability_replica_count: Optional[int] = None, + auto_pause_delay: Optional[int] = None, + preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, + availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EncryptionProtector(ProxyResource): + """The server encryption protector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.EncryptionProtectorProperties + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal + experience. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.EncryptionProtectorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of encryption protector. This is metadata used for the Azure portal experience.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "subregion", + "server_key_name", + "server_key_type", + "uri", + "thumbprint", + "auto_rotation_enabled", + "key_version", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.EncryptionProtectorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class EncryptionProtectorProperties(_Model): + """Properties for an encryption protector execution. + + :ivar subregion: Subregion of the encryption protector. + :vartype subregion: str + :ivar server_key_name: The name of the server key. + :vartype server_key_name: str + :ivar server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + Required. Known values are: "ServiceManaged" and "AzureKeyVault". + :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the server key. + :vartype uri: str + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. + :vartype auto_rotation_enabled: bool + :ivar key_version: The version of the server key being used as encryption protector. + :vartype key_version: str + """ + + subregion: Optional[str] = rest_field(visibility=["read"]) + """Subregion of the encryption protector.""" + server_key_name: Optional[str] = rest_field( + name="serverKeyName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the server key.""" + server_key_type: Union[str, "_models.ServerKeyType"] = rest_field( + name="serverKeyType", visibility=["read", "create", "update", "delete", "query"] + ) + """The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Required. Known values + are: \"ServiceManaged\" and \"AzureKeyVault\".""" + uri: Optional[str] = rest_field(visibility=["read"]) + """The URI of the server key.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the server key.""" + auto_rotation_enabled: Optional[bool] = rest_field( + name="autoRotationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Key auto rotation opt-in flag. Either true or false.""" + key_version: Optional[str] = rest_field(name="keyVersion", visibility=["read"]) + """The version of the server key being used as encryption protector.""" + + @overload + def __init__( + self, + *, + server_key_type: Union[str, "_models.ServerKeyType"], + server_key_name: Optional[str] = None, + auto_rotation_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EndpointCertificate(ProxyResource): + """Certificate used on an endpoint on the Managed Instance. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.EndpointCertificateProperties + """ + + properties: Optional["_models.EndpointCertificateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["public_blob"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.EndpointCertificateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class EndpointCertificateProperties(_Model): + """The properties of an endpoint certificate. + + :ivar public_blob: The certificate public blob. + :vartype public_blob: str + """ + + public_blob: Optional[str] = rest_field( + name="publicBlob", visibility=["read", "create", "update", "delete", "query"] + ) + """The certificate public blob.""" + + @overload + def __init__( + self, + *, + public_blob: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class EndpointDependency(_Model): + """A domain name that the managed instance service needs to communicate with, along with + additional details. + + :ivar domain_name: The domain name of the dependency. + :vartype domain_name: str + :ivar endpoint_details: The IP Addresses and Ports used when connecting to DomainName. + :vartype endpoint_details: list[~azure.mgmt.sql.models.EndpointDetail] + """ + + domain_name: Optional[str] = rest_field(name="domainName", visibility=["read"]) + """The domain name of the dependency.""" + endpoint_details: Optional[list["_models.EndpointDetail"]] = rest_field(name="endpointDetails", visibility=["read"]) + """The IP Addresses and Ports used when connecting to DomainName.""" + + +class EndpointDetail(_Model): + """A domain name that the managed instance service needs to communicate with, along with + additional details. + + :ivar port: The port an endpoint is connected to. + :vartype port: int + """ + + port: Optional[int] = rest_field(visibility=["read"]) + """The port an endpoint is connected to.""" + + +class ErrorAdditionalInfo(_Model): + """The resource management error additional info. + + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: any + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """The additional info type.""" + info: Optional[Any] = rest_field(visibility=["read"]) + """The additional info.""" + + +class ErrorDetail(_Model): + """The error detail. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.sql.models.ErrorDetail] + :ivar additional_info: The error additional info. + :vartype additional_info: list[~azure.mgmt.sql.models.ErrorAdditionalInfo] + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + target: Optional[str] = rest_field(visibility=["read"]) + """The error target.""" + details: Optional[list["_models.ErrorDetail"]] = rest_field(visibility=["read"]) + """The error details.""" + additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = rest_field( + name="additionalInfo", visibility=["read"] + ) + """The error additional info.""" + + +class ErrorResponse(_Model): + """Error response. + + :ivar error: The error object. + :vartype error: ~azure.mgmt.sql.models.ErrorDetail + """ + + error: Optional["_models.ErrorDetail"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The error object.""" + + @overload + def __init__( + self, + *, + error: Optional["_models.ErrorDetail"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExportDatabaseDefinition(_Model): + """Contains the information necessary to perform export database operation. + + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". + :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype storage_key: str + :ivar storage_uri: Storage Uri. Required. + :vartype storage_uri: str + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype administrator_login: str + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :vartype administrator_login_password: str + :ivar authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. + :vartype authentication_type: str + :ivar network_isolation: Optional resource information to enable network isolation for request. + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + storage_key_type: Union[str, "_models.StorageKeyType"] = rest_field(name="storageKeyType", visibility=["create"]) + """Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. Required. Known values + are: \"SharedAccessKey\", \"StorageAccessKey\", and \"ManagedIdentity\".""" + storage_key: str = rest_field(name="storageKey", visibility=["create"]) + """Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should + specify the Managed Identity's resource ID. Required.""" + storage_uri: str = rest_field(name="storageUri", visibility=["create"]) + """Storage Uri. Required.""" + administrator_login: str = rest_field(name="administratorLogin", visibility=["create"]) + """Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify + the Managed Identity's resource ID. Required.""" + administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["create"]) + """Administrator login password. If AuthenticationType is ManagedIdentity, this field should not + be specified.""" + authentication_type: Optional[str] = rest_field(name="authenticationType", visibility=["create"]) + """Type of credentials provided for access to the target SQL server: SQL, ADPassword or + ManagedIdentity.""" + network_isolation: Optional["_models.NetworkIsolationSettings"] = rest_field( + name="networkIsolation", visibility=["create"] + ) + """Optional resource information to enable network isolation for request.""" + + @overload + def __init__( + self, + *, + storage_key_type: Union[str, "_models.StorageKeyType"], + storage_key: str, + storage_uri: str, + administrator_login: str, + administrator_login_password: Optional[str] = None, + authentication_type: Optional[str] = None, + network_isolation: Optional["_models.NetworkIsolationSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): + """An extended database blob auditing policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicyProperties + """ + + properties: Optional["_models.ExtendedDatabaseBlobAuditingPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "predicate_expression", + "retention_days", + "audit_actions_and_groups", + "is_storage_secondary_key_in_use", + "is_azure_monitor_target_enabled", + "queue_delay_ms", + "is_managed_identity_in_use", + "state", + "storage_endpoint", + "storage_account_access_key", + "storage_account_subscription_id", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExtendedDatabaseBlobAuditingPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ExtendedDatabaseBlobAuditingPolicyProperties(_Model): # pylint: disable=name-too-long + """Properties of an extended database blob auditing policy. + + :ivar predicate_expression: Specifies condition of where clause when creating an audit. + :vartype predicate_expression: str + :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage + account. + :vartype retention_days: int + :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_. + :vartype audit_actions_and_groups: list[str] + :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the + storage's secondary key. + :vartype is_storage_secondary_key_in_use: bool + :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_azure_monitor_target_enabled: bool + :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. + :vartype queue_delay_ms: int + :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob + storage. + :vartype is_managed_identity_in_use: bool + :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). If state + is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + :vartype storage_account_access_key: str + :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. + :vartype storage_account_subscription_id: str + """ + + predicate_expression: Optional[str] = rest_field( + name="predicateExpression", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies condition of where clause when creating an audit.""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the audit logs in the storage account.""" + audit_actions_and_groups: Optional[list[str]] = rest_field( + name="auditActionsAndGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_.""" + is_storage_secondary_key_in_use: Optional[bool] = rest_field( + name="isStorageSecondaryKeyInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether storageAccountAccessKey value is the storage's secondary key.""" + is_azure_monitor_target_enabled: Optional[bool] = rest_field( + name="isAzureMonitorTargetEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + queue_delay_ms: Optional[int] = rest_field( + name="queueDelayMs", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the amount of time in milliseconds that can elapse before audit actions are forced to + be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.""" + is_managed_identity_in_use: Optional[bool] = rest_field( + name="isManagedIdentityInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether Managed Identity is used to access blob storage.""" + state: Union[str, "_models.BlobAuditingPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled is required.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355).""" + storage_account_subscription_id: Optional[str] = rest_field( + name="storageAccountSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage subscription Id.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.BlobAuditingPolicyState"], + predicate_expression: Optional[str] = None, + retention_days: Optional[int] = None, + audit_actions_and_groups: Optional[list[str]] = None, + is_storage_secondary_key_in_use: Optional[bool] = None, + is_azure_monitor_target_enabled: Optional[bool] = None, + queue_delay_ms: Optional[int] = None, + is_managed_identity_in_use: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + storage_account_subscription_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ExtendedServerBlobAuditingPolicy(ProxyResource): + """An extended server blob auditing policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicyProperties + """ + + properties: Optional["_models.ExtendedServerBlobAuditingPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "is_devops_audit_enabled", + "predicate_expression", + "retention_days", + "audit_actions_and_groups", + "is_storage_secondary_key_in_use", + "is_azure_monitor_target_enabled", + "queue_delay_ms", + "is_managed_identity_in_use", + "state", + "storage_endpoint", + "storage_account_access_key", + "storage_account_subscription_id", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ExtendedServerBlobAuditingPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ExtendedServerBlobAuditingPolicyProperties(_Model): # pylint: disable=name-too-long + """Properties of an extended server blob auditing policy. + + :ivar is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, devops + logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled', + 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + + When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should also be created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_devops_audit_enabled: bool + :ivar predicate_expression: Specifies condition of where clause when creating an audit. + :vartype predicate_expression: str + :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage + account. + :vartype retention_days: int + :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_. + :vartype audit_actions_and_groups: list[str] + :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the + storage's secondary key. + :vartype is_storage_secondary_key_in_use: bool + :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_azure_monitor_target_enabled: bool + :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. + :vartype queue_delay_ms: int + :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob + storage. + :vartype is_managed_identity_in_use: bool + :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). If state + is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + :vartype storage_account_access_key: str + :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. + :vartype storage_account_subscription_id: str + """ + + is_devops_audit_enabled: Optional[bool] = rest_field( + name="isDevopsAuditEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled', + 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + + When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should also be created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + predicate_expression: Optional[str] = rest_field( + name="predicateExpression", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies condition of where clause when creating an audit.""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the audit logs in the storage account.""" + audit_actions_and_groups: Optional[list[str]] = rest_field( + name="auditActionsAndGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_.""" + is_storage_secondary_key_in_use: Optional[bool] = rest_field( + name="isStorageSecondaryKeyInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether storageAccountAccessKey value is the storage's secondary key.""" + is_azure_monitor_target_enabled: Optional[bool] = rest_field( + name="isAzureMonitorTargetEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + queue_delay_ms: Optional[int] = rest_field( + name="queueDelayMs", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the amount of time in milliseconds that can elapse before audit actions are forced to + be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.""" + is_managed_identity_in_use: Optional[bool] = rest_field( + name="isManagedIdentityInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether Managed Identity is used to access blob storage.""" + state: Union[str, "_models.BlobAuditingPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled is required.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355).""" + storage_account_subscription_id: Optional[str] = rest_field( + name="storageAccountSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage subscription Id.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.BlobAuditingPolicyState"], + is_devops_audit_enabled: Optional[bool] = None, + predicate_expression: Optional[str] = None, + retention_days: Optional[int] = None, + audit_actions_and_groups: Optional[list[str]] = None, + is_storage_secondary_key_in_use: Optional[bool] = None, + is_azure_monitor_target_enabled: Optional[bool] = None, + queue_delay_ms: Optional[int] = None, + is_managed_identity_in_use: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + storage_account_subscription_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FailoverGroup(ProxyResource): + """A failover group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.FailoverGroupProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.FailoverGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "read_write_endpoint", + "read_only_endpoint", + "replication_role", + "replication_state", + "partner_servers", + "databases", + "secondary_type", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.FailoverGroupProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class FailoverGroupProperties(_Model): + """Properties of a failover group. + + :ivar read_write_endpoint: Read-write endpoint of the failover group instance. Required. + :vartype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint + :ivar read_only_endpoint: Read-only endpoint of the failover group instance. + :vartype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint + :ivar replication_role: Local replication role of the failover group instance. Known values + are: "Primary" and "Secondary". + :vartype replication_role: str or ~azure.mgmt.sql.models.FailoverGroupReplicationRole + :ivar replication_state: Replication state of the failover group instance. + :vartype replication_state: str + :ivar partner_servers: List of partner server information for the failover group. Required. + :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 + """ + + read_write_endpoint: "_models.FailoverGroupReadWriteEndpoint" = rest_field( + name="readWriteEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-write endpoint of the failover group instance. Required.""" + read_only_endpoint: Optional["_models.FailoverGroupReadOnlyEndpoint"] = rest_field( + name="readOnlyEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-only endpoint of the failover group instance.""" + replication_role: Optional[Union[str, "_models.FailoverGroupReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """Local replication role of the failover group instance. Known values are: \"Primary\" and + \"Secondary\".""" + replication_state: Optional[str] = rest_field(name="replicationState", visibility=["read"]) + """Replication state of the failover group instance.""" + partner_servers: list["_models.PartnerInfo"] = rest_field( + name="partnerServers", visibility=["read", "create", "update", "delete", "query"] + ) + """List of partner server information for the failover group. Required.""" + databases: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of databases in the failover group.""" + secondary_type: Optional[Union[str, "_models.FailoverGroupDatabasesSecondaryType"]] = rest_field( + name="secondaryType", visibility=["create", "update"] + ) + """Databases secondary type on partner server. Known values are: \"Geo\" and \"Standby\".""" + + @overload + def __init__( + self, + *, + read_write_endpoint: "_models.FailoverGroupReadWriteEndpoint", + partner_servers: list["_models.PartnerInfo"], + read_only_endpoint: Optional["_models.FailoverGroupReadOnlyEndpoint"] = None, + databases: Optional[list[str]] = None, + secondary_type: Optional[Union[str, "_models.FailoverGroupDatabasesSecondaryType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FailoverGroupReadOnlyEndpoint(_Model): + """Read-only endpoint of the failover group instance. + + :ivar failover_policy: Failover policy of the read-only endpoint for the failover group. Known + values are: "Disabled" and "Enabled". + :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy + :ivar target_server: The target partner server where the read-only endpoint points to. + :vartype target_server: str + """ + + failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = rest_field( + name="failoverPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover policy of the read-only endpoint for the failover group. Known values are: + \"Disabled\" and \"Enabled\".""" + target_server: Optional[str] = rest_field( + name="targetServer", visibility=["read", "create", "update", "delete", "query"] + ) + """The target partner server where the read-only endpoint points to.""" + + @overload + def __init__( + self, + *, + failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = None, + target_server: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FailoverGroupReadWriteEndpoint(_Model): + """Read-write endpoint of the failover group instance. + + :ivar failover_policy: Failover policy of the read-write endpoint for the failover group. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. + Known values are: "Manual" and "Automatic". + :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy + :ivar failover_with_data_loss_grace_period_minutes: Grace period before failover with data loss + is attempted for the read-write endpoint. If failoverPolicy is Automatic then + failoverWithDataLossGracePeriodMinutes is required. + :vartype failover_with_data_loss_grace_period_minutes: int + """ + + failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"] = rest_field( + name="failoverPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover policy of the read-write endpoint for the failover group. If failoverPolicy is + Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. Known values are: + \"Manual\" and \"Automatic\".""" + failover_with_data_loss_grace_period_minutes: Optional[int] = rest_field( + name="failoverWithDataLossGracePeriodMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Grace period before failover with data loss is attempted for the read-write endpoint. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.""" + + @overload + def __init__( + self, + *, + failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"], + failover_with_data_loss_grace_period_minutes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FailoverGroupUpdate(_Model): + """A failover group update request. + + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.FailoverGroupUpdateProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.FailoverGroupUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = ["read_write_endpoint", "read_only_endpoint", "databases", "partner_servers", "secondary_type"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.FailoverGroupUpdateProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class FailoverGroupUpdateProperties(_Model): + """Properties of a failover group update. + + :ivar read_write_endpoint: Read-write endpoint of the failover group instance. + :vartype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint + :ivar read_only_endpoint: Read-only endpoint of the failover group instance. + :vartype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint + :ivar databases: List of databases in the failover group. + :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 + """ + + read_write_endpoint: Optional["_models.FailoverGroupReadWriteEndpoint"] = rest_field( + name="readWriteEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-write endpoint of the failover group instance.""" + read_only_endpoint: Optional["_models.FailoverGroupReadOnlyEndpoint"] = rest_field( + name="readOnlyEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-only endpoint of the failover group instance.""" + databases: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """List of databases in the failover group.""" + partner_servers: Optional[list["_models.PartnerInfo"]] = rest_field( + name="partnerServers", visibility=["read", "create", "update", "delete", "query"] + ) + """List of partner server information for the failover group.""" + secondary_type: Optional[Union[str, "_models.FailoverGroupDatabasesSecondaryType"]] = rest_field( + name="secondaryType", visibility=["create", "update"] + ) + """Databases secondary type on partner server. Known values are: \"Geo\" and \"Standby\".""" + + @overload + def __init__( + self, + *, + read_write_endpoint: Optional["_models.FailoverGroupReadWriteEndpoint"] = None, + 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, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceWithWritableName(_Model): + """ARM resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Resource ID.""" + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource name.""" + type: Optional[str] = rest_field(visibility=["read"]) + """Resource type.""" + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ProxyResourceWithWritableName(ResourceWithWritableName): + """ARM proxy resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FirewallRule(ProxyResourceWithWritableName): + """A server firewall rule. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerFirewallRuleProperties + """ + + properties: Optional["_models.ServerFirewallRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["start_ip_address", "end_ip_address"] + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.ServerFirewallRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class FirewallRuleList(_Model): + """A list of server firewall rules. + + :ivar values_property: + :vartype values_property: list[~azure.mgmt.sql.models.FirewallRule] + """ + + values_property: Optional[list["_models.FirewallRule"]] = rest_field( + name="values", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="values" + ) + + @overload + def __init__( + self, + *, + values_property: Optional[list["_models.FirewallRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class FreeLimitExhaustionBehaviorCapability(_Model): + """Supported free limit exhaustion behavior options. + + :ivar exhaustion_behavior_type: Free limit exhaustion behavior type. Known values are: + "AutoPause" and "BillOverUsage". + :vartype exhaustion_behavior_type: str or ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior + :ivar status: Free limit exhaustion behavior status. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + """ + + exhaustion_behavior_type: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = rest_field( + name="exhaustionBehaviorType", visibility=["read"] + ) + """Free limit exhaustion behavior type. Known values are: \"AutoPause\" and \"BillOverUsage\".""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """Free limit exhaustion behavior status. Known values are: \"Visible\", \"Available\", + \"Default\", and \"Disabled\".""" + + +class GeoBackupPolicy(ProxyResource): + """A Geo backup policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.GeoBackupPolicyProperties + :ivar location: Backup policy location. + :vartype location: str + :ivar kind: Kind of geo backup policy. This is metadata used for the Azure portal experience. + :vartype kind: str + """ + + properties: Optional["_models.GeoBackupPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Backup policy location.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of geo backup policy. This is metadata used for the Azure portal experience.""" + + __flattened_items = ["state", "storage_type"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.GeoBackupPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class GeoBackupPolicyProperties(_Model): + """The properties of the geo backup policy. + + :ivar state: The state of the geo backup policy. Required. Known values are: "Enabled" and + "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState + :ivar storage_type: The storage type of the geo backup policy. + :vartype storage_type: str + """ + + state: Union[str, "_models.GeoBackupPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The state of the geo backup policy. Required. Known values are: \"Enabled\" and \"Disabled\".""" + storage_type: Optional[str] = rest_field(name="storageType", visibility=["read"]) + """The storage type of the geo backup policy.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.GeoBackupPolicyState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportExistingDatabaseDefinition(_Model): + """Contains the information necessary to perform import operation for existing database. + + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". + :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype storage_key: str + :ivar storage_uri: Storage Uri. Required. + :vartype storage_uri: str + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype administrator_login: str + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :vartype administrator_login_password: str + :ivar authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. + :vartype authentication_type: str + :ivar network_isolation: Optional resource information to enable network isolation for request. + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + storage_key_type: Union[str, "_models.StorageKeyType"] = rest_field(name="storageKeyType", visibility=["create"]) + """Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. Required. Known values + are: \"SharedAccessKey\", \"StorageAccessKey\", and \"ManagedIdentity\".""" + storage_key: str = rest_field(name="storageKey", visibility=["create"]) + """Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should + specify the Managed Identity's resource ID. Required.""" + storage_uri: str = rest_field(name="storageUri", visibility=["create"]) + """Storage Uri. Required.""" + administrator_login: str = rest_field(name="administratorLogin", visibility=["create"]) + """Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify + the Managed Identity's resource ID. Required.""" + administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["create"]) + """Administrator login password. If AuthenticationType is ManagedIdentity, this field should not + be specified.""" + authentication_type: Optional[str] = rest_field(name="authenticationType", visibility=["create"]) + """Type of credentials provided for access to the target SQL server: SQL, ADPassword or + ManagedIdentity.""" + network_isolation: Optional["_models.NetworkIsolationSettings"] = rest_field( + name="networkIsolation", visibility=["create"] + ) + """Optional resource information to enable network isolation for request.""" + + @overload + def __init__( + self, + *, + storage_key_type: Union[str, "_models.StorageKeyType"], + storage_key: str, + storage_uri: str, + administrator_login: str, + administrator_login_password: Optional[str] = None, + authentication_type: Optional[str] = None, + network_isolation: Optional["_models.NetworkIsolationSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ImportExportExtensionsOperationResult(ProxyResource): + """An Extension operation result resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ImportExportExtensionsOperationResultProperties + """ + + properties: Optional["_models.ImportExportExtensionsOperationResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "request_id", + "request_type", + "last_modified_time", + "server_name", + "database_name", + "status", + "error_message", + "queued_time", + "blob_uri", + "private_endpoint_connections", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ImportExportExtensionsOperationResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ImportExportExtensionsOperationResultProperties(_Model): # pylint: disable=name-too-long + """Contains the operation result properties for import/export operation. + + :ivar request_id: Request Id. + :vartype request_id: str + :ivar request_type: Request type. + :vartype request_type: str + :ivar last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar server_name: Server name. + :vartype server_name: str + :ivar database_name: Database name. + :vartype database_name: str + :ivar status: Operation status. + :vartype status: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar queued_time: Queued time. + :vartype queued_time: str + :ivar blob_uri: Blob URI. + :vartype blob_uri: str + :ivar private_endpoint_connections: Gets the status of private endpoints associated with this + request. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] + """ + + request_id: Optional[str] = rest_field(name="requestId", visibility=["read"]) + """Request Id.""" + request_type: Optional[str] = rest_field(name="requestType", visibility=["read"]) + """Request type.""" + last_modified_time: Optional[str] = rest_field(name="lastModifiedTime", visibility=["read"]) + """Last modified time.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """Server name.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """Database name.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Operation status.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """Error message.""" + queued_time: Optional[str] = rest_field(name="queuedTime", visibility=["read"]) + """Queued time.""" + blob_uri: Optional[str] = rest_field(name="blobUri", visibility=["read"]) + """Blob URI.""" + private_endpoint_connections: Optional[list["_models.PrivateEndpointConnectionRequestStatus"]] = rest_field( + name="privateEndpointConnections", visibility=["read"] + ) + """Gets the status of private endpoints associated with this request.""" + + +class ImportExportOperationResult(ProxyResourceAutoGenerated): + """An ImportExport operation result resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ImportExportOperationResultProperties + """ + + properties: Optional["_models.ImportExportOperationResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "request_id", + "request_type", + "queued_time", + "last_modified_time", + "blob_uri", + "server_name", + "database_name", + "status", + "error_message", + "private_endpoint_connections", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ImportExportOperationResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ImportExportOperationResultProperties(_Model): + """Contains the operation result properties for import/export operation. + + :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 last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar blob_uri: Blob Uri. + :vartype blob_uri: str + :ivar server_name: Server name. + :vartype server_name: str + :ivar database_name: Database name. + :vartype database_name: str + :ivar status: Operation status. + :vartype status: str + :ivar error_message: Error message. + :vartype error_message: str + :ivar private_endpoint_connections: Gets the status of private endpoints associated with this + request. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] + """ + + request_id: Optional[str] = rest_field(name="requestId", visibility=["read"]) + """Request Id.""" + request_type: Optional[str] = rest_field(name="requestType", visibility=["read"]) + """Request type.""" + queued_time: Optional[str] = rest_field(name="queuedTime", visibility=["read"]) + """Queued time.""" + last_modified_time: Optional[str] = rest_field(name="lastModifiedTime", visibility=["read"]) + """Last modified time.""" + blob_uri: Optional[str] = rest_field(name="blobUri", visibility=["read"]) + """Blob Uri.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """Server name.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """Database name.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Operation status.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """Error message.""" + private_endpoint_connections: Optional[list["_models.PrivateEndpointConnectionRequestStatus"]] = rest_field( + name="privateEndpointConnections", visibility=["read"] + ) + """Gets the status of private endpoints associated with this request.""" + + +class ImportNewDatabaseDefinition(_Model): + """Contains the information necessary to perform import operation for new database. + + :ivar database_name: Name of the import database. + :vartype database_name: str + :ivar edition: Edition of the import database. + :vartype edition: str + :ivar service_objective_name: Service level objective name of the import database. + :vartype service_objective_name: str + :ivar max_size_bytes: Max size in bytes for the import database. + :vartype max_size_bytes: str + :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or + ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and + "ManagedIdentity". + :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype storage_key: str + :ivar storage_uri: Storage Uri. Required. + :vartype storage_uri: str + :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, + this field should specify the Managed Identity's resource ID. Required. + :vartype administrator_login: str + :ivar administrator_login_password: Administrator login password. If AuthenticationType is + ManagedIdentity, this field should not be specified. + :vartype administrator_login_password: str + :ivar authentication_type: Type of credentials provided for access to the target SQL server: + SQL, ADPassword or ManagedIdentity. + :vartype authentication_type: str + :ivar network_isolation: Optional resource information to enable network isolation for request. + :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + database_name: Optional[str] = rest_field(name="databaseName", visibility=["create"]) + """Name of the import database.""" + edition: Optional[str] = rest_field(visibility=["create"]) + """Edition of the import database.""" + service_objective_name: Optional[str] = rest_field(name="serviceObjectiveName", visibility=["create"]) + """Service level objective name of the import database.""" + max_size_bytes: Optional[str] = rest_field(name="maxSizeBytes", visibility=["create"]) + """Max size in bytes for the import database.""" + storage_key_type: Union[str, "_models.StorageKeyType"] = rest_field(name="storageKeyType", visibility=["create"]) + """Storage key type: StorageAccessKey, SharedAccessKey, or ManagedIdentity. Required. Known values + are: \"SharedAccessKey\", \"StorageAccessKey\", and \"ManagedIdentity\".""" + storage_key: str = rest_field(name="storageKey", visibility=["create"]) + """Storage key for the storage account. If StorageKeyType is ManagedIdentity, this field should + specify the Managed Identity's resource ID. Required.""" + storage_uri: str = rest_field(name="storageUri", visibility=["create"]) + """Storage Uri. Required.""" + administrator_login: str = rest_field(name="administratorLogin", visibility=["create"]) + """Administrator login name. If AuthenticationType is ManagedIdentity, this field should specify + the Managed Identity's resource ID. Required.""" + administrator_login_password: Optional[str] = rest_field(name="administratorLoginPassword", visibility=["create"]) + """Administrator login password. If AuthenticationType is ManagedIdentity, this field should not + be specified.""" + authentication_type: Optional[str] = rest_field(name="authenticationType", visibility=["create"]) + """Type of credentials provided for access to the target SQL server: SQL, ADPassword or + ManagedIdentity.""" + network_isolation: Optional["_models.NetworkIsolationSettings"] = rest_field( + name="networkIsolation", visibility=["create"] + ) + """Optional resource information to enable network isolation for request.""" + + @overload + def __init__( + self, + *, + storage_key_type: Union[str, "_models.StorageKeyType"], + storage_key: str, + storage_uri: str, + administrator_login: str, + database_name: Optional[str] = None, + edition: Optional[str] = None, + service_objective_name: Optional[str] = None, + max_size_bytes: Optional[str] = None, + administrator_login_password: Optional[str] = None, + authentication_type: Optional[str] = None, + network_isolation: Optional["_models.NetworkIsolationSettings"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstanceFailoverGroup(ProxyResource): + """An instance failover group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.InstanceFailoverGroupProperties + """ + + properties: Optional["_models.InstanceFailoverGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "secondary_type", + "read_write_endpoint", + "read_only_endpoint", + "replication_role", + "replication_state", + "partner_regions", + "managed_instance_pairs", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.InstanceFailoverGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InstanceFailoverGroupProperties(_Model): + """Properties of a instance failover group. + + :ivar secondary_type: Type of the geo-secondary instance. Set 'Standby' if the instance is used + as a DR option only. Known values are: "Geo" and "Standby". + :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryInstanceType + :ivar read_write_endpoint: Read-write endpoint of the failover group instance. Required. + :vartype read_write_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint + :ivar read_only_endpoint: Read-only endpoint of the failover group instance. + :vartype read_only_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint + :ivar replication_role: Local replication role of the failover group instance. Known values + are: "Primary" and "Secondary". + :vartype replication_role: str or ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + :ivar replication_state: Replication state of the failover group instance. + :vartype replication_state: str + :ivar partner_regions: Partner region information for the failover group. Required. + :vartype partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] + :ivar managed_instance_pairs: List of managed instance pairs in the failover group. Required. + :vartype managed_instance_pairs: list[~azure.mgmt.sql.models.ManagedInstancePairInfo] + """ + + secondary_type: Optional[Union[str, "_models.SecondaryInstanceType"]] = rest_field( + name="secondaryType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. + Known values are: \"Geo\" and \"Standby\".""" + read_write_endpoint: "_models.InstanceFailoverGroupReadWriteEndpoint" = rest_field( + name="readWriteEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-write endpoint of the failover group instance. Required.""" + read_only_endpoint: Optional["_models.InstanceFailoverGroupReadOnlyEndpoint"] = rest_field( + name="readOnlyEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Read-only endpoint of the failover group instance.""" + replication_role: Optional[Union[str, "_models.InstanceFailoverGroupReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """Local replication role of the failover group instance. Known values are: \"Primary\" and + \"Secondary\".""" + replication_state: Optional[str] = rest_field(name="replicationState", visibility=["read"]) + """Replication state of the failover group instance.""" + partner_regions: list["_models.PartnerRegionInfo"] = rest_field( + name="partnerRegions", visibility=["read", "create"] + ) + """Partner region information for the failover group. Required.""" + managed_instance_pairs: list["_models.ManagedInstancePairInfo"] = rest_field( + name="managedInstancePairs", visibility=["read", "create", "update", "delete", "query"] + ) + """List of managed instance pairs in the failover group. Required.""" + + @overload + def __init__( + self, + *, + read_write_endpoint: "_models.InstanceFailoverGroupReadWriteEndpoint", + partner_regions: list["_models.PartnerRegionInfo"], + managed_instance_pairs: list["_models.ManagedInstancePairInfo"], + secondary_type: Optional[Union[str, "_models.SecondaryInstanceType"]] = None, + read_only_endpoint: Optional["_models.InstanceFailoverGroupReadOnlyEndpoint"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstanceFailoverGroupReadOnlyEndpoint(_Model): + """Read-only endpoint of the failover group instance. + + :ivar failover_policy: Failover policy of the read-only endpoint for the failover group. Known + values are: "Disabled" and "Enabled". + :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy + """ + + failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = rest_field( + name="failoverPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover policy of the read-only endpoint for the failover group. Known values are: + \"Disabled\" and \"Enabled\".""" + + @overload + def __init__( + self, + *, + failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstanceFailoverGroupReadWriteEndpoint(_Model): + """Read-write endpoint of the failover group instance. + + :ivar failover_policy: Failover policy of the read-write endpoint for the failover group. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. + Known values are: "Manual" and "Automatic". + :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy + :ivar failover_with_data_loss_grace_period_minutes: Grace period before failover with data loss + is attempted for the read-write endpoint. If failoverPolicy is Automatic then + failoverWithDataLossGracePeriodMinutes is required. + :vartype failover_with_data_loss_grace_period_minutes: int + """ + + failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"] = rest_field( + name="failoverPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Failover policy of the read-write endpoint for the failover group. If failoverPolicy is + Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. Known values are: + \"Manual\" and \"Automatic\".""" + failover_with_data_loss_grace_period_minutes: Optional[int] = rest_field( + name="failoverWithDataLossGracePeriodMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Grace period before failover with data loss is attempted for the read-write endpoint. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required.""" + + @overload + def __init__( + self, + *, + failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"], + failover_with_data_loss_grace_period_minutes: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstancePool(TrackedResource): + """An Azure SQL instance pool. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.InstancePoolProperties + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + """ + + properties: Optional["_models.InstancePoolProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + + __flattened_items = ["subnet_id", "v_cores", "license_type", "dns_zone", "maintenance_configuration_id"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.InstancePoolProperties"] = None, + sku: Optional["_models.Sku"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InstancePoolEditionCapability(_Model): + """The instance pool capability. + + :ivar name: The instance pool version name. + :vartype name: str + :ivar supported_families: The supported families. + :vartype supported_families: list[~azure.mgmt.sql.models.InstancePoolFamilyCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The instance pool version name.""" + supported_families: Optional[list["_models.InstancePoolFamilyCapability"]] = rest_field( + name="supportedFamilies", visibility=["read"] + ) + """The supported families.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstancePoolFamilyCapability(_Model): + """The instance pool family capability. + + :ivar name: Family name. + :vartype name: str + :ivar supported_license_types: List of supported license types. + :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] + :ivar supported_vcores_values: List of supported virtual cores values. + :vartype supported_vcores_values: list[~azure.mgmt.sql.models.InstancePoolVcoresCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Family name.""" + supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = rest_field( + name="supportedLicenseTypes", visibility=["read"] + ) + """List of supported license types.""" + supported_vcores_values: Optional[list["_models.InstancePoolVcoresCapability"]] = rest_field( + name="supportedVcoresValues", visibility=["read"] + ) + """List of supported virtual cores values.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstancePoolOperation(ProxyResource): + """A instance pool operation. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.InstancePoolOperationProperties + """ + + properties: Optional["_models.InstancePoolOperationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "instance_pool_name", + "operation", + "operation_friendly_name", + "percent_complete", + "start_time", + "state", + "error_code", + "error_description", + "error_severity", + "error_type", + "estimated_completion_time", + "description", + "is_cancellable", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.InstancePoolOperationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InstancePoolOperationProperties(_Model): + """The properties of a instance pool operation. + + :ivar instance_pool_name: The name of the instance pool the operation is being performed on. + :vartype instance_pool_name: str + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar error_type: Error type (e.g. None, User). Known values are: "None" and "User". + :vartype error_type: str or ~azure.mgmt.sql.models.ErrorType + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + instance_pool_name: Optional[str] = rest_field(name="instancePoolName", visibility=["read"]) + """The name of the instance pool the operation is being performed on.""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the operation completed.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[Union[str, "_models.ManagementOperationState"]] = rest_field(visibility=["read"]) + """The operation state. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", + \"CancelInProgress\", and \"Cancelled\".""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + error_type: Optional[Union[str, "_models.ErrorType"]] = rest_field(name="errorType", visibility=["read"]) + """Error type (e.g. None, User). Known values are: \"None\" and \"User\".""" + estimated_completion_time: Optional[datetime.datetime] = rest_field( + name="estimatedCompletionTime", visibility=["read"], format="rfc3339" + ) + """The estimated completion time of the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The operation description.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Whether the operation can be cancelled.""" + + +class InstancePoolProperties(_Model): + """Properties of an instance pool. + + :ivar subnet_id: Resource ID of the subnet to place this instance pool in. Required. + :vartype subnet_id: str + :ivar v_cores: Count of vCores belonging to this instance pool. Required. + :vartype v_cores: int + :ivar license_type: The license type. Possible values are 'LicenseIncluded' (price for SQL + license is included) and 'BasePrice' (without SQL license price). Required. Known values are: + "LicenseIncluded" and "BasePrice". + :vartype license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType + :ivar dns_zone: The Dns Zone that the managed instance pool is in. + :vartype dns_zone: str + :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this + managed instance. + :vartype maintenance_configuration_id: str + """ + + subnet_id: str = rest_field(name="subnetId", visibility=["read", "create"]) + """Resource ID of the subnet to place this instance pool in. Required.""" + v_cores: int = rest_field(name="vCores", visibility=["read", "create", "update", "delete", "query"]) + """Count of vCores belonging to this instance pool. Required.""" + license_type: Union[str, "_models.InstancePoolLicenseType"] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """The license type. Possible values are 'LicenseIncluded' (price for SQL license is included) and + 'BasePrice' (without SQL license price). Required. Known values are: \"LicenseIncluded\" and + \"BasePrice\".""" + dns_zone: Optional[str] = rest_field(name="dnsZone", visibility=["read"]) + """The Dns Zone that the managed instance pool is in.""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies maintenance configuration id to apply to this managed instance.""" + + @overload + def __init__( + self, + *, + subnet_id: str, + v_cores: int, + license_type: Union[str, "_models.InstancePoolLicenseType"], + maintenance_configuration_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class InstancePoolUpdate(_Model): + """An update to an Instance pool. + + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.InstancePoolProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + properties: Optional["_models.InstancePoolProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = ["subnet_id", "v_cores", "license_type", "dns_zone", "maintenance_configuration_id"] + + @overload + def __init__( + self, + *, + sku: Optional["_models.Sku"] = None, + properties: Optional["_models.InstancePoolProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class InstancePoolVcoresCapability(_Model): + """The managed instance virtual cores capability. + + :ivar name: The virtual cores identifier. + :vartype name: str + :ivar value: The virtual cores value. + :vartype value: int + :ivar storage_limit: Storage limit. + :vartype storage_limit: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The virtual cores identifier.""" + value: Optional[int] = rest_field(visibility=["read"]) + """The virtual cores value.""" + storage_limit: Optional["_models.MaxSizeCapability"] = rest_field(name="storageLimit", visibility=["read"]) + """Storage limit.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class IPv6FirewallRule(ProxyResourceWithWritableName): + """An IPv6 server firewall rule. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.IPv6ServerFirewallRuleProperties + """ + + properties: Optional["_models.IPv6ServerFirewallRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["start_i_pv6_address", "end_i_pv6_address"] + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.IPv6ServerFirewallRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class IPv6ServerFirewallRuleProperties(_Model): + """The properties of an IPv6 server firewall rule. + + :ivar start_i_pv6_address: The start IP address of the firewall rule. Must be IPv6 format. + :vartype start_i_pv6_address: str + :ivar end_i_pv6_address: The end IP address of the firewall rule. Must be IPv6 format. Must be + greater than or equal to startIpv6Address. + :vartype end_i_pv6_address: str + """ + + start_i_pv6_address: Optional[str] = rest_field( + name="startIPv6Address", visibility=["read", "create", "update", "delete", "query"] + ) + """The start IP address of the firewall rule. Must be IPv6 format.""" + end_i_pv6_address: Optional[str] = rest_field( + name="endIPv6Address", visibility=["read", "create", "update", "delete", "query"] + ) + """The end IP address of the firewall rule. Must be IPv6 format. Must be greater than or equal to + startIpv6Address.""" + + @overload + def __init__( + self, + *, + start_i_pv6_address: Optional[str] = None, + end_i_pv6_address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Job(ProxyResource): + """A job. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobProperties + """ + + properties: Optional["_models.JobProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["description", "version", "schedule"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobAgent(TrackedResource): + """An Azure SQL job agent. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobAgentProperties + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar identity: The identity of the job agent. + :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity + """ + + properties: Optional["_models.JobAgentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + identity: Optional["_models.JobAgentIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity of the job agent.""" + + __flattened_items = ["database_id", "state"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.JobAgentProperties"] = None, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.JobAgentIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobAgentEditionCapability(_Model): + """The job agent edition capability. + + :ivar name: The job agent edition name. + :vartype name: str + :ivar supported_service_level_objectives: The list of supported service level objectives for + the edition. + :vartype supported_service_level_objectives: + list[~azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The job agent edition name.""" + supported_service_level_objectives: Optional[list["_models.JobAgentServiceLevelObjectiveCapability"]] = rest_field( + name="supportedServiceLevelObjectives", visibility=["read"] + ) + """The list of supported service level objectives for the edition.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobAgentIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar tenant_id: The job agent identity tenant id. + :vartype tenant_id: str + :ivar type: The job agent identity type. Required. Known values are: "None", "SystemAssigned", + "UserAssigned", and "SystemAssignedUserAssigned". + :vartype type: str or ~azure.mgmt.sql.models.JobAgentIdentityType + :ivar user_assigned_identities: The resource ids of the user assigned identities to use. + :vartype user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.JobAgentUserAssignedIdentity] + """ + + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """The job agent identity tenant id.""" + type: Union[str, "_models.JobAgentIdentityType"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The job agent identity type. Required. Known values are: \"None\", \"SystemAssigned\", + \"UserAssigned\", and \"SystemAssignedUserAssigned\".""" + user_assigned_identities: Optional[dict[str, "_models.JobAgentUserAssignedIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ids of the user assigned identities to use.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.JobAgentIdentityType"], + tenant_id: Optional[str] = None, + user_assigned_identities: Optional[dict[str, "_models.JobAgentUserAssignedIdentity"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobAgentProperties(_Model): + """Properties of a job agent. + + :ivar database_id: Resource ID of the database to store job metadata in. Required. + :vartype database_id: str + :ivar state: The state of the job agent. Known values are: "Creating", "Ready", "Updating", + "Deleting", and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.JobAgentState + """ + + database_id: str = rest_field(name="databaseId", visibility=["read", "create"]) + """Resource ID of the database to store job metadata in. Required.""" + state: Optional[Union[str, "_models.JobAgentState"]] = rest_field(visibility=["read"]) + """The state of the job agent. Known values are: \"Creating\", \"Ready\", \"Updating\", + \"Deleting\", and \"Disabled\".""" + + @overload + def __init__( + self, + *, + database_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobAgentServiceLevelObjectiveCapability(_Model): + """The job agent service level objective capability. + + :ivar name: The service objective name. + :vartype name: str + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The service objective name.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read"]) + """The sku.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobAgentUpdate(_Model): + """An update to an Azure SQL job agent. + + :ivar identity: Managed identity assigned to job agent. + :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + identity: Optional["_models.JobAgentIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Managed identity assigned to job agent.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + @overload + def __init__( + self, + *, + identity: Optional["_models.JobAgentIdentity"] = None, + sku: Optional["_models.Sku"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobAgentUserAssignedIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory principal id.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The Azure Active Directory client id.""" + + +class JobAgentVersionCapability(_Model): + """The job agent version capability. + + :ivar name: The job agent version name. + :vartype name: str + :ivar supported_editions: The list of supported editions. + :vartype supported_editions: list[~azure.mgmt.sql.models.JobAgentEditionCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The job agent version name.""" + supported_editions: Optional[list["_models.JobAgentEditionCapability"]] = rest_field( + name="supportedEditions", visibility=["read"] + ) + """The list of supported editions.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobCredential(ProxyResource): + """A stored credential that can be used by a job to connect to target databases. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobCredentialProperties + """ + + properties: Optional["_models.JobCredentialProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["username", "password"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobCredentialProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobCredentialProperties(_Model): + """Properties of a job credential. + + :ivar username: The credential user name. Required. + :vartype username: str + :ivar password: The credential password. Required. + :vartype password: str + """ + + username: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The credential user name. Required.""" + password: str = rest_field(visibility=["create", "update"]) + """The credential password. Required.""" + + @overload + def __init__( + self, + *, + username: str, + password: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobExecution(ProxyResource): + """An execution of a job. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobExecutionProperties + """ + + properties: Optional["_models.JobExecutionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "job_version", + "step_name", + "step_id", + "job_execution_id", + "lifecycle", + "provisioning_state", + "create_time", + "start_time", + "end_time", + "current_attempts", + "current_attempt_start_time", + "last_message", + "target", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobExecutionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobExecutionProperties(_Model): + """Properties for an Azure SQL Database Elastic job execution. + + :ivar job_version: The job version number. + :vartype job_version: int + :ivar step_name: The job step name. + :vartype step_name: str + :ivar step_id: The job step id. + :vartype step_id: int + :ivar job_execution_id: The unique identifier of the job execution. + :vartype job_execution_id: str + :ivar lifecycle: The detailed state of the job execution. Known values are: "Created", + "InProgress", "WaitingForChildJobExecutions", "WaitingForRetry", "Succeeded", + "SucceededWithSkipped", "Failed", "TimedOut", "Canceled", and "Skipped". + :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle + :ivar provisioning_state: The ARM provisioning state of the job execution. Known values are: + "Created", "InProgress", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState + :ivar create_time: The time that the job execution was created. + :vartype create_time: ~datetime.datetime + :ivar start_time: The time that the job execution started. + :vartype start_time: ~datetime.datetime + :ivar end_time: The time that the job execution completed. + :vartype end_time: ~datetime.datetime + :ivar current_attempts: Number of times the job execution has been attempted. + :vartype current_attempts: int + :ivar current_attempt_start_time: Start time of the current attempt. + :vartype current_attempt_start_time: ~datetime.datetime + :ivar last_message: The last status or error message. + :vartype last_message: str + :ivar target: The target that this execution is executed on. + :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget + """ + + job_version: Optional[int] = rest_field(name="jobVersion", visibility=["read"]) + """The job version number.""" + step_name: Optional[str] = rest_field(name="stepName", visibility=["read"]) + """The job step name.""" + step_id: Optional[int] = rest_field(name="stepId", visibility=["read"]) + """The job step id.""" + job_execution_id: Optional[str] = rest_field(name="jobExecutionId", visibility=["read"]) + """The unique identifier of the job execution.""" + lifecycle: Optional[Union[str, "_models.JobExecutionLifecycle"]] = rest_field(visibility=["read"]) + """The detailed state of the job execution. Known values are: \"Created\", \"InProgress\", + \"WaitingForChildJobExecutions\", \"WaitingForRetry\", \"Succeeded\", \"SucceededWithSkipped\", + \"Failed\", \"TimedOut\", \"Canceled\", and \"Skipped\".""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """The ARM provisioning state of the job execution. Known values are: \"Created\", \"InProgress\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + create_time: Optional[datetime.datetime] = rest_field(name="createTime", visibility=["read"], format="rfc3339") + """The time that the job execution was created.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The time that the job execution started.""" + end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The time that the job execution completed.""" + current_attempts: Optional[int] = rest_field( + name="currentAttempts", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of times the job execution has been attempted.""" + current_attempt_start_time: Optional[datetime.datetime] = rest_field( + name="currentAttemptStartTime", visibility=["read"], format="rfc3339" + ) + """Start time of the current attempt.""" + last_message: Optional[str] = rest_field(name="lastMessage", visibility=["read"]) + """The last status or error message.""" + target: Optional["_models.JobExecutionTarget"] = rest_field(visibility=["read"]) + """The target that this execution is executed on.""" + + @overload + def __init__( + self, + *, + current_attempts: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobExecutionTarget(_Model): + """The target that a job execution is executed on. + + :ivar type: The type of the target. Known values are: "TargetGroup", "SqlDatabase", + "SqlElasticPool", "SqlShardMap", and "SqlServer". + :vartype type: str or ~azure.mgmt.sql.models.JobTargetType + :ivar server_name: The server name. + :vartype server_name: str + :ivar database_name: The database name. + :vartype database_name: str + """ + + type: Optional[Union[str, "_models.JobTargetType"]] = rest_field(visibility=["read"]) + """The type of the target. Known values are: \"TargetGroup\", \"SqlDatabase\", \"SqlElasticPool\", + \"SqlShardMap\", and \"SqlServer\".""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """The server name.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The database name.""" + + +class JobPrivateEndpoint(ProxyResource): + """A job agent private endpoint. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobPrivateEndpointProperties + """ + + properties: Optional["_models.JobPrivateEndpointProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["target_server_azure_resource_id", "private_endpoint_id"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobPrivateEndpointProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobPrivateEndpointProperties(_Model): + """Properties of job agent private endpoint. + + :ivar target_server_azure_resource_id: ARM resource id of the server the private endpoint will + target. Required. + :vartype target_server_azure_resource_id: str + :ivar private_endpoint_id: Private endpoint id of the private endpoint. + :vartype private_endpoint_id: str + """ + + target_server_azure_resource_id: str = rest_field( + name="targetServerAzureResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the server the private endpoint will target. Required.""" + private_endpoint_id: Optional[str] = rest_field(name="privateEndpointId", visibility=["read"]) + """Private endpoint id of the private endpoint.""" + + @overload + def __init__( + self, + *, + target_server_azure_resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobProperties(_Model): + """Properties of a job. + + :ivar description: User-defined description of the job. + :vartype description: str + :ivar version: The job version number. + :vartype version: int + :ivar schedule: Schedule properties of the job. + :vartype schedule: ~azure.mgmt.sql.models.JobSchedule + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """User-defined description of the job.""" + version: Optional[int] = rest_field(visibility=["read"]) + """The job version number.""" + schedule: Optional["_models.JobSchedule"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schedule properties of the job.""" + + @overload + def __init__( + self, + *, + description: Optional[str] = None, + schedule: Optional["_models.JobSchedule"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobSchedule(_Model): + """Scheduling properties of a job. + + :ivar start_time: Schedule start time. + :vartype start_time: ~datetime.datetime + :ivar end_time: Schedule end time. + :vartype end_time: ~datetime.datetime + :ivar type: Schedule interval type. Known values are: "Once" and "Recurring". + :vartype type: str or ~azure.mgmt.sql.models.JobScheduleType + :ivar enabled: Whether or not the schedule is enabled. + :vartype enabled: bool + :ivar interval: Value of the schedule's recurring interval, if the ScheduleType is recurring. + ISO8601 duration format. + :vartype interval: str + """ + + start_time: Optional[datetime.datetime] = rest_field( + name="startTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Schedule start time.""" + end_time: Optional[datetime.datetime] = rest_field( + name="endTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """Schedule end time.""" + type: Optional[Union[str, "_models.JobScheduleType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Schedule interval type. Known values are: \"Once\" and \"Recurring\".""" + enabled: Optional[bool] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Whether or not the schedule is enabled.""" + interval: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Value of the schedule's recurring interval, if the ScheduleType is recurring. ISO8601 duration + format.""" + + @overload + def __init__( + self, + *, + start_time: Optional[datetime.datetime] = None, + end_time: Optional[datetime.datetime] = None, + type: Optional[Union[str, "_models.JobScheduleType"]] = None, + enabled: Optional[bool] = None, + interval: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobStep(ProxyResource): + """A job step. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobStepProperties + """ + + properties: Optional["_models.JobStepProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["step_id", "target_group", "credential", "action", "output", "execution_options"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobStepProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobStepAction(_Model): + """The action to be executed by a job step. + + :ivar type: Type of action being executed by the job step. "TSql" + :vartype type: str or ~azure.mgmt.sql.models.JobStepActionType + :ivar source: The source of the action to execute. "Inline" + :vartype source: str or ~azure.mgmt.sql.models.JobStepActionSource + :ivar value: The action value, for example the text of the T-SQL script to execute. Required. + :vartype value: str + """ + + type: Optional[Union[str, "_models.JobStepActionType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Type of action being executed by the job step. \"TSql\"""" + source: Optional[Union[str, "_models.JobStepActionSource"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The source of the action to execute. \"Inline\"""" + value: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action value, for example the text of the T-SQL script to execute. Required.""" + + @overload + def __init__( + self, + *, + value: str, + type: Optional[Union[str, "_models.JobStepActionType"]] = None, + source: Optional[Union[str, "_models.JobStepActionSource"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobStepExecutionOptions(_Model): + """The execution options of a job step. + + :ivar timeout_seconds: Execution timeout for the job step. + :vartype timeout_seconds: int + :ivar retry_attempts: Maximum number of times the job step will be reattempted if the first + attempt fails. + :vartype retry_attempts: int + :ivar initial_retry_interval_seconds: Initial delay between retries for job step execution. + :vartype initial_retry_interval_seconds: int + :ivar maximum_retry_interval_seconds: The maximum amount of time to wait between retries for + job step execution. + :vartype maximum_retry_interval_seconds: int + :ivar retry_interval_backoff_multiplier: The backoff multiplier for the time between retries. + :vartype retry_interval_backoff_multiplier: float + """ + + timeout_seconds: Optional[int] = rest_field( + name="timeoutSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Execution timeout for the job step.""" + retry_attempts: Optional[int] = rest_field( + name="retryAttempts", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum number of times the job step will be reattempted if the first attempt fails.""" + initial_retry_interval_seconds: Optional[int] = rest_field( + name="initialRetryIntervalSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """Initial delay between retries for job step execution.""" + maximum_retry_interval_seconds: Optional[int] = rest_field( + name="maximumRetryIntervalSeconds", visibility=["read", "create", "update", "delete", "query"] + ) + """The maximum amount of time to wait between retries for job step execution.""" + retry_interval_backoff_multiplier: Optional[float] = rest_field( + name="retryIntervalBackoffMultiplier", visibility=["read", "create", "update", "delete", "query"] + ) + """The backoff multiplier for the time between retries.""" + + @overload + def __init__( + self, + *, + timeout_seconds: Optional[int] = None, + retry_attempts: Optional[int] = None, + initial_retry_interval_seconds: Optional[int] = None, + maximum_retry_interval_seconds: Optional[int] = None, + retry_interval_backoff_multiplier: Optional[float] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobStepOutput(_Model): + """The output configuration of a job step. + + :ivar type: The output destination type. "SqlDatabase" + :vartype type: str or ~azure.mgmt.sql.models.JobStepOutputType + :ivar subscription_id: The output destination subscription id. + :vartype subscription_id: str + :ivar resource_group_name: The output destination resource group. + :vartype resource_group_name: str + :ivar server_name: The output destination server name. Required. + :vartype server_name: str + :ivar database_name: The output destination database. Required. + :vartype database_name: str + :ivar schema_name: The output destination schema. + :vartype schema_name: str + :ivar table_name: The output destination table. Required. + :vartype table_name: str + :ivar credential: The resource ID of the credential to use to connect to the output + destination. + :vartype credential: str + """ + + type: Optional[Union[str, "_models.JobStepOutputType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The output destination type. \"SqlDatabase\"""" + subscription_id: Optional[str] = rest_field( + name="subscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """The output destination subscription id.""" + resource_group_name: Optional[str] = rest_field( + name="resourceGroupName", visibility=["read", "create", "update", "delete", "query"] + ) + """The output destination resource group.""" + server_name: str = rest_field(name="serverName", visibility=["read", "create", "update", "delete", "query"]) + """The output destination server name. Required.""" + database_name: str = rest_field(name="databaseName", visibility=["read", "create", "update", "delete", "query"]) + """The output destination database. Required.""" + schema_name: Optional[str] = rest_field( + name="schemaName", visibility=["read", "create", "update", "delete", "query"] + ) + """The output destination schema.""" + table_name: str = rest_field(name="tableName", visibility=["read", "create", "update", "delete", "query"]) + """The output destination table. Required.""" + credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the credential to use to connect to the output destination.""" + + @overload + def __init__( + self, + *, + server_name: str, + database_name: str, + table_name: str, + type: Optional[Union[str, "_models.JobStepOutputType"]] = None, + subscription_id: Optional[str] = None, + resource_group_name: Optional[str] = None, + schema_name: Optional[str] = None, + credential: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobStepProperties(_Model): + """Properties of a job step. + + :ivar step_id: The job step's index within the job. If not specified when creating the job + step, it will be created as the last step. If not specified when updating the job step, the + step id is not modified. + :vartype step_id: int + :ivar target_group: The resource ID of the target group that the job step will be executed on. + Required. + :vartype target_group: str + :ivar credential: The resource ID of the job credential that will be used to connect to the + targets. + :vartype credential: str + :ivar action: The action payload of the job step. Required. + :vartype action: ~azure.mgmt.sql.models.JobStepAction + :ivar output: Output destination properties of the job step. + :vartype output: ~azure.mgmt.sql.models.JobStepOutput + :ivar execution_options: Execution options for the job step. + :vartype execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions + """ + + step_id: Optional[int] = rest_field(name="stepId", visibility=["read", "create", "update", "delete", "query"]) + """The job step's index within the job. If not specified when creating the job step, it will be + created as the last step. If not specified when updating the job step, the step id is not + modified.""" + target_group: str = rest_field(name="targetGroup", visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the target group that the job step will be executed on. Required.""" + credential: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The resource ID of the job credential that will be used to connect to the targets.""" + action: "_models.JobStepAction" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The action payload of the job step. Required.""" + output: Optional["_models.JobStepOutput"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Output destination properties of the job step.""" + execution_options: Optional["_models.JobStepExecutionOptions"] = rest_field( + name="executionOptions", visibility=["read", "create", "update", "delete", "query"] + ) + """Execution options for the job step.""" + + @overload + def __init__( + self, + *, + target_group: str, + action: "_models.JobStepAction", + step_id: Optional[int] = None, + credential: Optional[str] = None, + output: Optional["_models.JobStepOutput"] = None, + execution_options: Optional["_models.JobStepExecutionOptions"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobTarget(_Model): + """A job target, for example a specific database or a container of databases that is evaluated + during job execution. + + :ivar membership_type: Whether the target is included or excluded from the group. Known values + are: "Include" and "Exclude". + :vartype membership_type: str or ~azure.mgmt.sql.models.JobTargetGroupMembershipType + :ivar type: The target type. Required. Known values are: "TargetGroup", "SqlDatabase", + "SqlElasticPool", "SqlShardMap", and "SqlServer". + :vartype type: str or ~azure.mgmt.sql.models.JobTargetType + :ivar server_name: The target server name. + :vartype server_name: str + :ivar database_name: The target database name. + :vartype database_name: str + :ivar elastic_pool_name: The target elastic pool name. + :vartype elastic_pool_name: str + :ivar shard_map_name: The target shard map. + :vartype shard_map_name: str + :ivar refresh_credential: The resource ID of the credential that is used during job execution + to connect to the target and determine the list of databases inside the target. + :vartype refresh_credential: str + """ + + membership_type: Optional[Union[str, "_models.JobTargetGroupMembershipType"]] = rest_field( + name="membershipType", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether the target is included or excluded from the group. Known values are: \"Include\" and + \"Exclude\".""" + type: Union[str, "_models.JobTargetType"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target type. Required. Known values are: \"TargetGroup\", \"SqlDatabase\", + \"SqlElasticPool\", \"SqlShardMap\", and \"SqlServer\".""" + server_name: Optional[str] = rest_field( + name="serverName", visibility=["read", "create", "update", "delete", "query"] + ) + """The target server name.""" + database_name: Optional[str] = rest_field( + name="databaseName", visibility=["read", "create", "update", "delete", "query"] + ) + """The target database name.""" + elastic_pool_name: Optional[str] = rest_field( + name="elasticPoolName", visibility=["read", "create", "update", "delete", "query"] + ) + """The target elastic pool name.""" + shard_map_name: Optional[str] = rest_field( + name="shardMapName", visibility=["read", "create", "update", "delete", "query"] + ) + """The target shard map.""" + refresh_credential: Optional[str] = rest_field( + name="refreshCredential", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the credential that is used during job execution to connect to the target + and determine the list of databases inside the target.""" + + @overload + def __init__( + self, + *, + type: Union[str, "_models.JobTargetType"], + membership_type: Optional[Union[str, "_models.JobTargetGroupMembershipType"]] = None, + server_name: Optional[str] = None, + database_name: Optional[str] = None, + elastic_pool_name: Optional[str] = None, + shard_map_name: Optional[str] = None, + refresh_credential: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobTargetGroup(ProxyResource): + """A group of job targets. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.JobTargetGroupProperties + """ + + properties: Optional["_models.JobTargetGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["members"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.JobTargetGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class JobTargetGroupProperties(_Model): + """Properties of job target group. + + :ivar members: Members of the target group. Required. + :vartype members: list[~azure.mgmt.sql.models.JobTarget] + """ + + members: list["_models.JobTarget"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Members of the target group. Required.""" + + @overload + def __init__( + self, + *, + members: list["_models.JobTarget"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class JobVersion(ProxyResource): + """A job version. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + """ + + +class LedgerDigestUploads(ProxyResource): + """Azure SQL Database ledger digest upload settings. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.LedgerDigestUploadsProperties + """ + + properties: Optional["_models.LedgerDigestUploadsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["digest_storage_endpoint", "state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.LedgerDigestUploadsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LedgerDigestUploadsProperties(_Model): + """The properties of a database ledger digest upload settings. + + :ivar digest_storage_endpoint: The digest storage endpoint, which must be either an Azure blob + storage endpoint or an URI for Azure Confidential Ledger. + :vartype digest_storage_endpoint: str + :ivar state: Specifies the state of ledger digest upload. Known values are: "Enabled" and + "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.LedgerDigestUploadsState + """ + + digest_storage_endpoint: Optional[str] = rest_field( + name="digestStorageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for + Azure Confidential Ledger.""" + state: Optional[Union[str, "_models.LedgerDigestUploadsState"]] = rest_field(visibility=["read"]) + """Specifies the state of ledger digest upload. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + digest_storage_endpoint: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LicenseTypeCapability(_Model): + """The license type capability. + + :ivar name: License type identifier. + :vartype name: str + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """License type identifier.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LocationCapabilities(_Model): + """The location capability. + + :ivar name: The location name. + :vartype name: str + :ivar supported_server_versions: The list of supported server versions. + :vartype supported_server_versions: list[~azure.mgmt.sql.models.ServerVersionCapability] + :ivar supported_managed_instance_versions: The list of supported managed instance versions. + :vartype supported_managed_instance_versions: + list[~azure.mgmt.sql.models.ManagedInstanceVersionCapability] + :ivar supported_job_agent_versions: The list of supported job agent versions. + :vartype supported_job_agent_versions: list[~azure.mgmt.sql.models.JobAgentVersionCapability] + :ivar is_zone_resilient_provisioning_allowed: Whether or not the subscription is allowed to + provision zone resilient resources. + :vartype is_zone_resilient_provisioning_allowed: bool + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The location name.""" + supported_server_versions: Optional[list["_models.ServerVersionCapability"]] = rest_field( + name="supportedServerVersions", visibility=["read"] + ) + """The list of supported server versions.""" + supported_managed_instance_versions: Optional[list["_models.ManagedInstanceVersionCapability"]] = rest_field( + name="supportedManagedInstanceVersions", visibility=["read"] + ) + """The list of supported managed instance versions.""" + supported_job_agent_versions: Optional[list["_models.JobAgentVersionCapability"]] = rest_field( + name="supportedJobAgentVersions", visibility=["read"] + ) + """The list of supported job agent versions.""" + is_zone_resilient_provisioning_allowed: Optional[bool] = rest_field( + name="isZoneResilientProvisioningAllowed", visibility=["read"] + ) + """Whether or not the subscription is allowed to provision zone resilient resources.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LogicalDatabaseTransparentDataEncryption(ProxyResource): + """A logical database transparent data encryption scan state. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.TransparentDataEncryptionProperties + """ + + properties: Optional["_models.TransparentDataEncryptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state", "scan_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.TransparentDataEncryptionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LogSizeCapability(_Model): + """The log size capability. + + :ivar limit: The log size limit (see 'unit' for the units). + :vartype limit: int + :ivar unit: The units that the limit is expressed in. Known values are: "Megabytes", + "Gigabytes", "Terabytes", "Petabytes", and "Percent". + :vartype unit: str or ~azure.mgmt.sql.models.LogSizeUnit + """ + + limit: Optional[int] = rest_field(visibility=["read"]) + """The log size limit (see 'unit' for the units).""" + unit: Optional[Union[str, "_models.LogSizeUnit"]] = rest_field(visibility=["read"]) + """The units that the limit is expressed in. Known values are: \"Megabytes\", \"Gigabytes\", + \"Terabytes\", \"Petabytes\", and \"Percent\".""" + + +class LongTermRetentionBackup(ProxyResource): + """A long term retention backup. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.LongTermRetentionBackupProperties + """ + + properties: Optional["_models.LongTermRetentionBackupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "server_name", + "server_create_time", + "database_name", + "database_deletion_time", + "backup_time", + "backup_expiration_time", + "backup_storage_redundancy", + "requested_backup_storage_redundancy", + "is_backup_immutable", + "time_based_immutability", + "time_based_immutability_mode", + "legal_hold_immutability", + "backup_storage_access_tier", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.LongTermRetentionBackupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LongTermRetentionBackupOperationResult(ProxyResourceAutoGenerated): + """A LongTermRetentionBackup operation result resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.LongTermRetentionOperationResultProperties + """ + + properties: Optional["_models.LongTermRetentionOperationResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "request_id", + "operation_type", + "from_backup_resource_id", + "to_backup_resource_id", + "target_backup_storage_redundancy", + "status", + "message", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.LongTermRetentionOperationResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LongTermRetentionBackupProperties(_Model): + """Properties of a long term retention backup. + + :ivar server_name: The server name that the backup database belong to. + :vartype server_name: str + :ivar server_create_time: The create time of the server. + :vartype server_create_time: ~datetime.datetime + :ivar database_name: The name of the database the backup belong to. + :vartype database_name: str + :ivar database_deletion_time: The delete time of the database. + :vartype database_deletion_time: ~datetime.datetime + :ivar backup_time: The time the backup was taken. + :vartype backup_time: ~datetime.datetime + :ivar backup_expiration_time: The time the long term retention backup will expire. + :vartype backup_expiration_time: ~datetime.datetime + :ivar backup_storage_redundancy: The storage redundancy type of the backup. Known values are: + "Geo", "Local", "Zone", and "GeoZone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar requested_backup_storage_redundancy: The storage redundancy type of the backup. Known + values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar is_backup_immutable: The setting whether the LTR backup is immutable. + :vartype is_backup_immutable: bool + :ivar time_based_immutability: The setting for whether or not time-based immutability is + enabled for the LTR backup. When time-based immutability is enabled and locked, the backup + cannot be deleted until BackupExpirationTime. Known values are: "Enabled" and "Disabled". + :vartype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability + :ivar time_based_immutability_mode: The time-based immutability mode. Only applicable if + time-based immutability is enabled. Known values are: "Locked" and "Unlocked". + :vartype time_based_immutability_mode: str or ~azure.mgmt.sql.models.TimeBasedImmutabilityMode + :ivar legal_hold_immutability: The setting for whether LegalHold is enabled or disabled on the + LTR backup. When LegalHold is enabled, the backup cannot be deleted until the LegalHold is + removed. Known values are: "Enabled" and "Disabled". + :vartype legal_hold_immutability: str or ~azure.mgmt.sql.models.SetLegalHoldImmutability + :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backup. Known values + are: "Hot" and "Archive". + :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier + """ + + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """The server name that the backup database belong to.""" + server_create_time: Optional[datetime.datetime] = rest_field( + name="serverCreateTime", visibility=["read"], format="rfc3339" + ) + """The create time of the server.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database the backup belong to.""" + database_deletion_time: Optional[datetime.datetime] = rest_field( + name="databaseDeletionTime", visibility=["read"], format="rfc3339" + ) + """The delete time of the database.""" + backup_time: Optional[datetime.datetime] = rest_field(name="backupTime", visibility=["read"], format="rfc3339") + """The time the backup was taken.""" + backup_expiration_time: Optional[datetime.datetime] = rest_field( + name="backupExpirationTime", visibility=["read"], format="rfc3339" + ) + """The time the long term retention backup will expire.""" + backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="backupStorageRedundancy", visibility=["read"] + ) + """The storage redundancy type of the backup. Known values are: \"Geo\", \"Local\", \"Zone\", and + \"GeoZone\".""" + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="requestedBackupStorageRedundancy", visibility=["create", "update"] + ) + """The storage redundancy type of the backup. Known values are: \"Geo\", \"Local\", \"Zone\", and + \"GeoZone\".""" + is_backup_immutable: Optional[bool] = rest_field( + name="isBackupImmutable", visibility=["read", "create", "update", "delete", "query"] + ) + """The setting whether the LTR backup is immutable.""" + time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = rest_field( + name="timeBasedImmutability", visibility=["read", "create", "update", "delete", "query"] + ) + """The setting for whether or not time-based immutability is enabled for the LTR backup. When + time-based immutability is enabled and locked, the backup cannot be deleted until + BackupExpirationTime. Known values are: \"Enabled\" and \"Disabled\".""" + time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = rest_field( + name="timeBasedImmutabilityMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The time-based immutability mode. Only applicable if time-based immutability is enabled. Known + values are: \"Locked\" and \"Unlocked\".""" + legal_hold_immutability: Optional[Union[str, "_models.SetLegalHoldImmutability"]] = rest_field( + name="legalHoldImmutability", visibility=["read", "create", "update", "delete", "query"] + ) + """The setting for whether LegalHold is enabled or disabled on the LTR backup. When LegalHold is + enabled, the backup cannot be deleted until the LegalHold is removed. Known values are: + \"Enabled\" and \"Disabled\".""" + backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = rest_field( + name="backupStorageAccessTier", visibility=["read"] + ) + """The BackupStorageAccessTier for the LTR backup. Known values are: \"Hot\" and \"Archive\".""" + + @overload + def __init__( + self, + *, + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + is_backup_immutable: Optional[bool] = None, + time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = None, + time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = None, + legal_hold_immutability: Optional[Union[str, "_models.SetLegalHoldImmutability"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class LongTermRetentionOperationResultProperties(_Model): # pylint: disable=name-too-long + """Contains the operation result properties for long term retention backup operation. + + :ivar request_id: Request Id. + :vartype request_id: str + :ivar operation_type: Operation type. + :vartype operation_type: str + :ivar from_backup_resource_id: Source backup resource id. + :vartype from_backup_resource_id: str + :ivar to_backup_resource_id: Target backup resource id. + :vartype to_backup_resource_id: str + :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. Known + values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype target_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar status: Operation status. + :vartype status: str + :ivar message: Progress message. + :vartype message: str + """ + + request_id: Optional[str] = rest_field(name="requestId", visibility=["read"]) + """Request Id.""" + operation_type: Optional[str] = rest_field(name="operationType", visibility=["read"]) + """Operation type.""" + from_backup_resource_id: Optional[str] = rest_field(name="fromBackupResourceId", visibility=["read"]) + """Source backup resource id.""" + to_backup_resource_id: Optional[str] = rest_field(name="toBackupResourceId", visibility=["read"]) + """Target backup resource id.""" + target_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="targetBackupStorageRedundancy", visibility=["read"] + ) + """The storage redundancy type of the copied backup. Known values are: \"Geo\", \"Local\", + \"Zone\", and \"GeoZone\".""" + status: Optional[str] = rest_field(visibility=["read"]) + """Operation status.""" + message: Optional[str] = rest_field(visibility=["read"]) + """Progress message.""" + + +class LongTermRetentionPolicy(ProxyResource): + """A long term retention policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.LongTermRetentionPolicyProperties + """ + + properties: Optional["_models.LongTermRetentionPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "time_based_immutability", + "time_based_immutability_mode", + "weekly_retention", + "monthly_retention", + "yearly_retention", + "week_of_year", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.LongTermRetentionPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class LongTermRetentionPolicyProperties(_Model): + """Properties of a long term retention policy. + + :ivar time_based_immutability: The setting for whether to enable time-based immutability for + future backups. When set, future backups will have TimeBasedImmutability enabled. Known values + are: "Enabled" and "Disabled". + :vartype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability + :ivar time_based_immutability_mode: The setting for time-based immutability mode for future + backup (Value can be either Locked or UnLocked. Only effective if TimeBasedImmutability is + enabled). Caution: Immutability of LTR backup cannot be removed if TimeBasedImmutabilityMode is + Locked. Known values are: "Locked" and "Unlocked". + :vartype time_based_immutability_mode: str or ~azure.mgmt.sql.models.TimeBasedImmutabilityMode + :ivar weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. + :vartype weekly_retention: str + :ivar monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 format. + :vartype monthly_retention: str + :ivar yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. + :vartype yearly_retention: str + :ivar week_of_year: The week of year to take the yearly backup in an ISO 8601 format. + :vartype week_of_year: int + """ + + time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = rest_field( + name="timeBasedImmutability", visibility=["read", "create", "update", "delete", "query"] + ) + """The setting for whether to enable time-based immutability for future backups. When set, future + backups will have TimeBasedImmutability enabled. Known values are: \"Enabled\" and + \"Disabled\".""" + time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = rest_field( + name="timeBasedImmutabilityMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The setting for time-based immutability mode for future backup (Value can be either Locked or + UnLocked. Only effective if TimeBasedImmutability is enabled). Caution: Immutability of LTR + backup cannot be removed if TimeBasedImmutabilityMode is Locked. Known values are: \"Locked\" + and \"Unlocked\".""" + weekly_retention: Optional[str] = rest_field( + name="weeklyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The weekly retention policy for an LTR backup in an ISO 8601 format.""" + monthly_retention: Optional[str] = rest_field( + name="monthlyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly retention policy for an LTR backup in an ISO 8601 format.""" + yearly_retention: Optional[str] = rest_field( + name="yearlyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The yearly retention policy for an LTR backup in an ISO 8601 format.""" + week_of_year: Optional[int] = rest_field( + name="weekOfYear", visibility=["read", "create", "update", "delete", "query"] + ) + """The week of year to take the yearly backup in an ISO 8601 format.""" + + @overload + def __init__( + self, + *, + time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = None, + time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = None, + weekly_retention: Optional[str] = None, + monthly_retention: Optional[str] = None, + yearly_retention: Optional[str] = None, + week_of_year: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceConfigurationCapability(_Model): + """The maintenance configuration capability. + + :ivar name: Maintenance configuration name. + :vartype name: str + :ivar zone_redundant: Whether or not zone redundancy is supported for the maintenance + configuration. + :vartype zone_redundant: bool + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Maintenance configuration name.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the maintenance configuration.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceWindowOptions(ProxyResource): + """Maintenance window options. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.MaintenanceWindowOptionsProperties + """ + + properties: Optional["_models.MaintenanceWindowOptionsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "is_enabled", + "maintenance_window_cycles", + "min_duration_in_minutes", + "default_duration_in_minutes", + "min_cycles", + "time_granularity_in_minutes", + "allow_multiple_maintenance_windows_per_cycle", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.MaintenanceWindowOptionsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class MaintenanceWindowOptionsProperties(_Model): + """Maintenance window options properties. + + :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}. + :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 + :ivar default_duration_in_minutes: Default duration for maintenance window. + :vartype default_duration_in_minutes: int + :ivar min_cycles: Minimum number of maintenance windows cycles to be set on the database. + :vartype min_cycles: int + :ivar time_granularity_in_minutes: Time granularity in minutes for maintenance windows. + :vartype time_granularity_in_minutes: int + :ivar allow_multiple_maintenance_windows_per_cycle: Whether we allow multiple maintenance + windows per cycle. + :vartype allow_multiple_maintenance_windows_per_cycle: bool + """ + + is_enabled: Optional[bool] = rest_field( + name="isEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether maintenance windows are enabled for the database.""" + maintenance_window_cycles: Optional[list["_models.MaintenanceWindowTimeRange"]] = rest_field( + name="maintenanceWindowCycles", visibility=["read", "create", "update", "delete", "query"] + ) + """Available maintenance cycles e.g. {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}.""" + min_duration_in_minutes: Optional[int] = rest_field( + name="minDurationInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimum duration of maintenance window.""" + default_duration_in_minutes: Optional[int] = rest_field( + name="defaultDurationInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Default duration for maintenance window.""" + min_cycles: Optional[int] = rest_field(name="minCycles", visibility=["read", "create", "update", "delete", "query"]) + """Minimum number of maintenance windows cycles to be set on the database.""" + time_granularity_in_minutes: Optional[int] = rest_field( + name="timeGranularityInMinutes", visibility=["read", "create", "update", "delete", "query"] + ) + """Time granularity in minutes for maintenance windows.""" + allow_multiple_maintenance_windows_per_cycle: Optional[bool] = rest_field( + name="allowMultipleMaintenanceWindowsPerCycle", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether we allow multiple maintenance windows per cycle.""" + + @overload + def __init__( + self, + *, + is_enabled: Optional[bool] = None, + maintenance_window_cycles: Optional[list["_models.MaintenanceWindowTimeRange"]] = None, + min_duration_in_minutes: Optional[int] = None, + default_duration_in_minutes: Optional[int] = None, + min_cycles: Optional[int] = None, + time_granularity_in_minutes: Optional[int] = None, + allow_multiple_maintenance_windows_per_cycle: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceWindows(ProxyResource): + """Maintenance windows. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.MaintenanceWindowsProperties + """ + + properties: Optional["_models.MaintenanceWindowsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["time_ranges"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.MaintenanceWindowsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class MaintenanceWindowsProperties(_Model): + """Maintenance windows resource properties. + + :ivar time_ranges: + :vartype time_ranges: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] + """ + + time_ranges: Optional[list["_models.MaintenanceWindowTimeRange"]] = rest_field( + name="timeRanges", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + time_ranges: Optional[list["_models.MaintenanceWindowTimeRange"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaintenanceWindowTimeRange(_Model): + """Maintenance window time range. + + :ivar day_of_week: Day of maintenance window. Known values are: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", and "Saturday". + :vartype day_of_week: str or ~azure.mgmt.sql.models.DayOfWeek + :ivar start_time: Start time minutes offset from 12am. + :vartype start_time: str + :ivar duration: Duration of maintenance window in minutes. + :vartype duration: str + """ + + day_of_week: Optional[Union[str, "_models.DayOfWeek"]] = rest_field( + name="dayOfWeek", visibility=["read", "create", "update", "delete", "query"] + ) + """Day of maintenance window. Known values are: \"Sunday\", \"Monday\", \"Tuesday\", + \"Wednesday\", \"Thursday\", \"Friday\", and \"Saturday\".""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """Start time minutes offset from 12am.""" + duration: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Duration of maintenance window in minutes.""" + + @overload + def __init__( + self, + *, + day_of_week: Optional[Union[str, "_models.DayOfWeek"]] = None, + start_time: Optional[str] = None, + duration: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedBackupShortTermRetentionPolicy(ProxyResource): + """A short term retention policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicyProperties + """ + + properties: Optional["_models.ManagedBackupShortTermRetentionPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["retention_days"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedBackupShortTermRetentionPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedBackupShortTermRetentionPolicyProperties(_Model): # pylint: disable=name-too-long + """Properties of a short term retention policy. + + :ivar retention_days: The backup retention period in days. This is how many days Point-in-Time + Restore will be supported. + :vartype retention_days: int + """ + + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """The backup retention period in days. This is how many days Point-in-Time Restore will be + supported.""" + + @overload + def __init__( + self, + *, + retention_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedDatabase(TrackedResource): + """A managed database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedDatabaseProperties + """ + + properties: Optional["_models.ManagedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "collation", + "status", + "creation_date", + "earliest_restore_point", + "restore_point_in_time", + "default_secondary_location", + "catalog_collation", + "create_mode", + "storage_container_uri", + "source_database_id", + "cross_subscription_source_database_id", + "restorable_dropped_database_id", + "cross_subscription_restorable_dropped_database_id", + "storage_container_identity", + "storage_container_sas_token", + "failover_group_id", + "recoverable_database_id", + "long_term_retention_backup_resource_id", + "auto_complete_restore", + "last_backup_name", + "cross_subscription_target_managed_instance_id", + "is_ledger_on", + "extended_accessibility_info", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ManagedDatabaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedDatabaseAdvancedThreatProtection(ProxyResource): + """A managed database Advanced Threat Protection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdvancedThreatProtectionProperties + """ + + properties: Optional["_models.AdvancedThreatProtectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state", "creation_time"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdvancedThreatProtectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedDatabaseExtendedAccessibilityInfo(_Model): + """Managed Database Extended Accessibility Information. + + :ivar inaccessibility_reason_error_code: SQL Server error code connected to the inaccessibility + root cause. Required. + :vartype inaccessibility_reason_error_code: str + :ivar inaccessibility_reason_description: Root cause explanation and mitigation action. + Required. + :vartype inaccessibility_reason_description: str + :ivar inaccessibility_reason_kind: Root cause kind. Allowed values are + “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”. Required. Known values are: + "Unknown", "TransparentDataEncryption", and "DatabaseReplication". + :vartype inaccessibility_reason_kind: str or ~azure.mgmt.sql.models.InaccessibilityReason + :ivar inaccessibility_reason_tde_key_uri: For the root cause kind “TransparentDataEncryption”, + the CMK URI. + :vartype inaccessibility_reason_tde_key_uri: str + """ + + inaccessibility_reason_error_code: str = rest_field(name="inaccessibilityReasonErrorCode", visibility=["read"]) + """SQL Server error code connected to the inaccessibility root cause. Required.""" + inaccessibility_reason_description: str = rest_field(name="inaccessibilityReasonDescription", visibility=["read"]) + """Root cause explanation and mitigation action. Required.""" + inaccessibility_reason_kind: Union[str, "_models.InaccessibilityReason"] = rest_field( + name="inaccessibilityReasonKind", visibility=["read"] + ) + """Root cause kind. Allowed values are “TransparentDataEncryption”, “DatabaseReplication”, and + “Unknown”. Required. Known values are: \"Unknown\", \"TransparentDataEncryption\", and + \"DatabaseReplication\".""" + inaccessibility_reason_tde_key_uri: Optional[str] = rest_field( + name="inaccessibilityReasonTdeKeyUri", visibility=["read"] + ) + """For the root cause kind “TransparentDataEncryption”, the CMK URI.""" + + +class ManagedDatabaseMoveDefinition(_Model): + """Contains the information necessary to perform a managed database move. + + :ivar destination_managed_database_id: The destination managed database ID. Required. + :vartype destination_managed_database_id: str + """ + + destination_managed_database_id: str = rest_field( + name="destinationManagedDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination managed database ID. Required.""" + + @overload + def __init__( + self, + *, + destination_managed_database_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedDatabaseMoveOperationResult(ProxyResource): + """A managed database move operation. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResultProperties + """ + + properties: Optional["_models.ManagedDatabaseMoveOperationResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "operation", + "operation_friendly_name", + "start_time", + "state", + "operation_mode", + "source_managed_instance_name", + "target_managed_instance_name", + "source_managed_instance_id", + "target_managed_instance_id", + "source_database_name", + "target_database_name", + "is_cancellable", + "error_code", + "error_description", + "error_severity", + "is_user_error", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedDatabaseMoveOperationResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedDatabaseMoveOperationResultProperties(_Model): # pylint: disable=name-too-long + """Contains the operation result properties for managed database move operation. + + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar operation_mode: Operation mode. Known values are: "Move" and "Copy". + :vartype operation_mode: str or ~azure.mgmt.sql.models.MoveOperationMode + :ivar source_managed_instance_name: Source Managed Instance name. + :vartype source_managed_instance_name: str + :ivar target_managed_instance_name: Target Managed Instance name. + :vartype target_managed_instance_name: str + :ivar source_managed_instance_id: Source Managed Instance resource id. + :vartype source_managed_instance_id: str + :ivar target_managed_instance_id: Target Managed instance resource id. + :vartype target_managed_instance_id: str + :ivar source_database_name: Source database name. + :vartype source_database_name: str + :ivar target_database_name: Target database name. + :vartype target_database_name: str + :ivar is_cancellable: Is move operation cancellable. + :vartype is_cancellable: bool + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + """ + + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[Union[str, "_models.ManagementOperationState"]] = rest_field(visibility=["read"]) + """The operation state. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", + \"CancelInProgress\", and \"Cancelled\".""" + operation_mode: Optional[Union[str, "_models.MoveOperationMode"]] = rest_field( + name="operationMode", visibility=["read"] + ) + """Operation mode. Known values are: \"Move\" and \"Copy\".""" + source_managed_instance_name: Optional[str] = rest_field(name="sourceManagedInstanceName", visibility=["read"]) + """Source Managed Instance name.""" + target_managed_instance_name: Optional[str] = rest_field(name="targetManagedInstanceName", visibility=["read"]) + """Target Managed Instance name.""" + source_managed_instance_id: Optional[str] = rest_field(name="sourceManagedInstanceId", visibility=["read"]) + """Source Managed Instance resource id.""" + target_managed_instance_id: Optional[str] = rest_field(name="targetManagedInstanceId", visibility=["read"]) + """Target Managed instance resource id.""" + source_database_name: Optional[str] = rest_field(name="sourceDatabaseName", visibility=["read"]) + """Source database name.""" + target_database_name: Optional[str] = rest_field(name="targetDatabaseName", visibility=["read"]) + """Target database name.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Is move operation cancellable.""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + is_user_error: Optional[bool] = rest_field(name="isUserError", visibility=["read"]) + """Whether or not the error is a user error.""" + + +class ManagedDatabaseProperties(_Model): + """The managed database's properties. + + :ivar collation: Collation of the managed database. + :vartype collation: str + :ivar status: Status of the database. Known values are: "Online", "Offline", "Shutdown", + "Creating", "Inaccessible", "Restoring", "Updating", "Stopping", "Stopped", "Starting", + "DbMoving", and "DbCopying". + :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus + :ivar creation_date: Creation date of the database. + :vartype creation_date: ~datetime.datetime + :ivar earliest_restore_point: Earliest restore point in time for point in time restore. + :vartype earliest_restore_point: ~datetime.datetime + :ivar restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is + required. Specifies the point in time (ISO8601 format) of the source database that will be + restored to create the new database. + :vartype restore_point_in_time: ~datetime.datetime + :ivar default_secondary_location: Geo paired region. + :vartype default_secondary_location: str + :ivar catalog_collation: Collation of the metadata catalog. Known values are: + "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". + :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType + :ivar create_mode: Managed database create mode. PointInTimeRestore: Create a database by + restoring a point in time backup of an existing database. SourceDatabaseName, + SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a + database by restoring from external backup files. Collation, StorageContainerUri and + StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a + geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database + resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a + long term retention backup (longTermRetentionBackupResourceId required). Known values are: + "Default", "RestoreExternalBackup", "PointInTimeRestore", "Recovery", and + "RestoreLongTermRetentionBackup". + :vartype create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode + :ivar storage_container_uri: Conditional. If createMode is RestoreExternalBackup, this value is + required. Specifies the uri of the storage container where backups for this restore are stored. + :vartype storage_container_uri: str + :ivar source_database_id: The resource identifier of the source database associated with create + operation of this database. + :vartype source_database_id: str + :ivar cross_subscription_source_database_id: The resource identifier of the cross-subscription + source database associated with create operation of this database. + :vartype cross_subscription_source_database_id: str + :ivar restorable_dropped_database_id: The restorable dropped database resource id to restore + when creating this database. + :vartype restorable_dropped_database_id: str + :ivar cross_subscription_restorable_dropped_database_id: The restorable cross-subscription + dropped database resource id to restore when creating this database. + :vartype cross_subscription_restorable_dropped_database_id: str + :ivar storage_container_identity: Conditional. If createMode is RestoreExternalBackup, this + value is used. Specifies the identity used for storage container authentication. Can be + 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is + assumed. + :vartype storage_container_identity: str + :ivar storage_container_sas_token: Conditional. If createMode is RestoreExternalBackup and + storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage + container sas token. + :vartype storage_container_sas_token: str + :ivar failover_group_id: Instance Failover Group resource identifier that this managed database + belongs to. + :vartype failover_group_id: str + :ivar recoverable_database_id: The resource identifier of the recoverable database associated + with create operation of this database. + :vartype recoverable_database_id: str + :ivar long_term_retention_backup_resource_id: The name of the Long Term Retention backup to be + used for restore of this managed database. + :vartype long_term_retention_backup_resource_id: str + :ivar auto_complete_restore: Whether to auto complete restore of this managed database. + :vartype auto_complete_restore: bool + :ivar last_backup_name: Last backup file name for restore of this managed database. + :vartype last_backup_name: str + :ivar cross_subscription_target_managed_instance_id: Target managed instance id used in + cross-subscription restore. + :vartype cross_subscription_target_managed_instance_id: str + :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables + in the database are ledger tables. Note: the value of this property cannot be changed after the + database has been created. + :vartype is_ledger_on: bool + :ivar extended_accessibility_info: Additional observability and troubleshooting information for + databases in ‘Inaccessible’ state. + :vartype extended_accessibility_info: + ~azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo + """ + + collation: Optional[str] = rest_field(visibility=["read", "create"]) + """Collation of the managed database.""" + status: Optional[Union[str, "_models.ManagedDatabaseStatus"]] = rest_field(visibility=["read"]) + """Status of the database. Known values are: \"Online\", \"Offline\", \"Shutdown\", \"Creating\", + \"Inaccessible\", \"Restoring\", \"Updating\", \"Stopping\", \"Stopped\", \"Starting\", + \"DbMoving\", and \"DbCopying\".""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """Creation date of the database.""" + earliest_restore_point: Optional[datetime.datetime] = rest_field( + name="earliestRestorePoint", visibility=["read"], format="rfc3339" + ) + """Earliest restore point in time for point in time restore.""" + restore_point_in_time: Optional[datetime.datetime] = rest_field( + name="restorePointInTime", visibility=["create"], format="rfc3339" + ) + """Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point + in time (ISO8601 format) of the source database that will be restored to create the new + database.""" + default_secondary_location: Optional[str] = rest_field(name="defaultSecondaryLocation", visibility=["read"]) + """Geo paired region.""" + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = rest_field( + name="catalogCollation", visibility=["read", "create"] + ) + """Collation of the metadata catalog. Known values are: \"DATABASE_DEFAULT\" and + \"SQL_Latin1_General_CP1_CI_AS\".""" + create_mode: Optional[Union[str, "_models.ManagedDatabaseCreateMode"]] = rest_field( + name="createMode", visibility=["create"] + ) + """Managed database create mode. PointInTimeRestore: Create a database by restoring a point in + time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and + PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from + external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be + specified. Recovery: Creates a database by restoring a geo-replicated backup. + RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. + RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention + backup (longTermRetentionBackupResourceId required). Known values are: \"Default\", + \"RestoreExternalBackup\", \"PointInTimeRestore\", \"Recovery\", and + \"RestoreLongTermRetentionBackup\".""" + storage_container_uri: Optional[str] = rest_field(name="storageContainerUri", visibility=["create"]) + """Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri + of the storage container where backups for this restore are stored.""" + source_database_id: Optional[str] = rest_field(name="sourceDatabaseId", visibility=["create"]) + """The resource identifier of the source database associated with create operation of this + database.""" + cross_subscription_source_database_id: Optional[str] = rest_field( + name="crossSubscriptionSourceDatabaseId", visibility=["create"] + ) + """The resource identifier of the cross-subscription source database associated with create + operation of this database.""" + restorable_dropped_database_id: Optional[str] = rest_field( + name="restorableDroppedDatabaseId", visibility=["create"] + ) + """The restorable dropped database resource id to restore when creating this database.""" + cross_subscription_restorable_dropped_database_id: Optional[str] = rest_field( + name="crossSubscriptionRestorableDroppedDatabaseId", visibility=["create"] + ) + """The restorable cross-subscription dropped database resource id to restore when creating this + database.""" + storage_container_identity: Optional[str] = rest_field(name="storageContainerIdentity", visibility=["create"]) + """Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity + used for storage container authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; + if not specified 'SharedAccessSignature' is assumed.""" + storage_container_sas_token: Optional[str] = rest_field(name="storageContainerSasToken", visibility=["create"]) + """Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not + ManagedIdentity, this value is required. Specifies the storage container sas token.""" + failover_group_id: Optional[str] = rest_field(name="failoverGroupId", visibility=["read"]) + """Instance Failover Group resource identifier that this managed database belongs to.""" + recoverable_database_id: Optional[str] = rest_field(name="recoverableDatabaseId", visibility=["create"]) + """The resource identifier of the recoverable database associated with create operation of this + database.""" + long_term_retention_backup_resource_id: Optional[str] = rest_field( + name="longTermRetentionBackupResourceId", visibility=["create"] + ) + """The name of the Long Term Retention backup to be used for restore of this managed database.""" + auto_complete_restore: Optional[bool] = rest_field(name="autoCompleteRestore", visibility=["create"]) + """Whether to auto complete restore of this managed database.""" + last_backup_name: Optional[str] = rest_field(name="lastBackupName", visibility=["create"]) + """Last backup file name for restore of this managed database.""" + cross_subscription_target_managed_instance_id: Optional[str] = rest_field( + name="crossSubscriptionTargetManagedInstanceId", visibility=["create"] + ) + """Target managed instance id used in cross-subscription restore.""" + is_ledger_on: Optional[bool] = rest_field(name="isLedgerOn", visibility=["read", "create"]) + """Whether or not this database is a ledger database, which means all tables in the database are + ledger tables. Note: the value of this property cannot be changed after the database has been + created.""" + extended_accessibility_info: Optional["_models.ManagedDatabaseExtendedAccessibilityInfo"] = rest_field( + name="extendedAccessibilityInfo", visibility=["read"] + ) + """Additional observability and troubleshooting information for databases in ‘Inaccessible’ state.""" + + @overload + def __init__( + self, + *, + collation: Optional[str] = None, + restore_point_in_time: Optional[datetime.datetime] = None, + catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, + create_mode: Optional[Union[str, "_models.ManagedDatabaseCreateMode"]] = None, + storage_container_uri: Optional[str] = None, + source_database_id: Optional[str] = None, + cross_subscription_source_database_id: Optional[str] = None, + restorable_dropped_database_id: Optional[str] = None, + cross_subscription_restorable_dropped_database_id: Optional[str] = None, + storage_container_identity: Optional[str] = None, + storage_container_sas_token: Optional[str] = None, + recoverable_database_id: Optional[str] = None, + long_term_retention_backup_resource_id: Optional[str] = None, + auto_complete_restore: Optional[bool] = None, + last_backup_name: Optional[str] = None, + cross_subscription_target_managed_instance_id: Optional[str] = None, + is_ledger_on: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedDatabaseRestoreDetailsBackupSetProperties(_Model): # pylint: disable=name-too-long + """The managed database's restore details backup set properties. + + :ivar status: Backup set status. + :vartype status: str + :ivar first_stripe_name: First stripe name. + :vartype first_stripe_name: str + :ivar number_of_stripes: Number of stripes. + :vartype number_of_stripes: int + :ivar backup_size_mb: Backup size. + :vartype backup_size_mb: int + :ivar restore_started_timestamp_utc: Last restored file time. + :vartype restore_started_timestamp_utc: ~datetime.datetime + :ivar restore_finished_timestamp_utc: Last restored file time. + :vartype restore_finished_timestamp_utc: ~datetime.datetime + """ + + status: Optional[str] = rest_field(visibility=["read"]) + """Backup set status.""" + first_stripe_name: Optional[str] = rest_field(name="firstStripeName", visibility=["read"]) + """First stripe name.""" + number_of_stripes: Optional[int] = rest_field(name="numberOfStripes", visibility=["read"]) + """Number of stripes.""" + backup_size_mb: Optional[int] = rest_field(name="backupSizeMB", visibility=["read"]) + """Backup size.""" + restore_started_timestamp_utc: Optional[datetime.datetime] = rest_field( + name="restoreStartedTimestampUtc", visibility=["read"], format="rfc3339" + ) + """Last restored file time.""" + restore_finished_timestamp_utc: Optional[datetime.datetime] = rest_field( + name="restoreFinishedTimestampUtc", visibility=["read"], format="rfc3339" + ) + """Last restored file time.""" + + +class ManagedDatabaseRestoreDetailsProperties(_Model): + """The managed database's restore details properties. + + :ivar type: Restore type. + :vartype type: str + :ivar status: Restore status. + :vartype status: str + :ivar block_reason: The reason why restore is in Blocked state. + :vartype block_reason: str + :ivar last_uploaded_file_name: Last uploaded file name. + :vartype last_uploaded_file_name: str + :ivar last_uploaded_file_time: Last uploaded file time. + :vartype last_uploaded_file_time: ~datetime.datetime + :ivar last_restored_file_name: Last restored file name. + :vartype last_restored_file_name: str + :ivar last_restored_file_time: Last restored file time. + :vartype last_restored_file_time: ~datetime.datetime + :ivar percent_completed: Percent completed. + :vartype percent_completed: int + :ivar current_restored_size_mb: Current restored size MB. + :vartype current_restored_size_mb: int + :ivar current_restore_plan_size_mb: Current restore plan size MB. + :vartype current_restore_plan_size_mb: int + :ivar current_backup_type: Current backup type. + :vartype current_backup_type: str + :ivar current_restoring_file_name: Current restoring file name. + :vartype current_restoring_file_name: str + :ivar number_of_files_detected: Number of files detected. + :vartype number_of_files_detected: int + :ivar number_of_files_queued: Number of files queued. + :vartype number_of_files_queued: int + :ivar number_of_files_skipped: Number of files skipped. + :vartype number_of_files_skipped: int + :ivar number_of_files_restoring: Number of files restoring. + :vartype number_of_files_restoring: int + :ivar number_of_files_restored: Number of files restored. + :vartype number_of_files_restored: int + :ivar number_of_files_unrestorable: Number of files unrestorable. + :vartype number_of_files_unrestorable: int + :ivar full_backup_sets: Full backup sets. + :vartype full_backup_sets: + list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] + :ivar diff_backup_sets: Diff backup sets. + :vartype diff_backup_sets: + list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] + :ivar log_backup_sets: Log backup sets. + :vartype log_backup_sets: + list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] + :ivar unrestorable_files: Unrestorable files. + :vartype unrestorable_files: + list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties] + """ + + type: Optional[str] = rest_field(visibility=["read"]) + """Restore type.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Restore status.""" + block_reason: Optional[str] = rest_field(name="blockReason", visibility=["read"]) + """The reason why restore is in Blocked state.""" + last_uploaded_file_name: Optional[str] = rest_field(name="lastUploadedFileName", visibility=["read"]) + """Last uploaded file name.""" + last_uploaded_file_time: Optional[datetime.datetime] = rest_field( + name="lastUploadedFileTime", visibility=["read"], format="rfc3339" + ) + """Last uploaded file time.""" + last_restored_file_name: Optional[str] = rest_field(name="lastRestoredFileName", visibility=["read"]) + """Last restored file name.""" + last_restored_file_time: Optional[datetime.datetime] = rest_field( + name="lastRestoredFileTime", visibility=["read"], format="rfc3339" + ) + """Last restored file time.""" + percent_completed: Optional[int] = rest_field(name="percentCompleted", visibility=["read"]) + """Percent completed.""" + current_restored_size_mb: Optional[int] = rest_field(name="currentRestoredSizeMB", visibility=["read"]) + """Current restored size MB.""" + current_restore_plan_size_mb: Optional[int] = rest_field(name="currentRestorePlanSizeMB", visibility=["read"]) + """Current restore plan size MB.""" + current_backup_type: Optional[str] = rest_field(name="currentBackupType", visibility=["read"]) + """Current backup type.""" + current_restoring_file_name: Optional[str] = rest_field(name="currentRestoringFileName", visibility=["read"]) + """Current restoring file name.""" + number_of_files_detected: Optional[int] = rest_field(name="numberOfFilesDetected", visibility=["read"]) + """Number of files detected.""" + number_of_files_queued: Optional[int] = rest_field(name="numberOfFilesQueued", visibility=["read"]) + """Number of files queued.""" + number_of_files_skipped: Optional[int] = rest_field(name="numberOfFilesSkipped", visibility=["read"]) + """Number of files skipped.""" + number_of_files_restoring: Optional[int] = rest_field(name="numberOfFilesRestoring", visibility=["read"]) + """Number of files restoring.""" + number_of_files_restored: Optional[int] = rest_field(name="numberOfFilesRestored", visibility=["read"]) + """Number of files restored.""" + number_of_files_unrestorable: Optional[int] = rest_field(name="numberOfFilesUnrestorable", visibility=["read"]) + """Number of files unrestorable.""" + full_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = rest_field( + name="fullBackupSets", visibility=["read"] + ) + """Full backup sets.""" + diff_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = rest_field( + name="diffBackupSets", visibility=["read"] + ) + """Diff backup sets.""" + log_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = rest_field( + name="logBackupSets", visibility=["read"] + ) + """Log backup sets.""" + unrestorable_files: Optional[list["_models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties"]] = rest_field( + name="unrestorableFiles", visibility=["read"] + ) + """Unrestorable files.""" + + +class ManagedDatabaseRestoreDetailsResult(ProxyResource): + """A managed database restore details. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsProperties + """ + + properties: Optional["_models.ManagedDatabaseRestoreDetailsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "type", + "status", + "block_reason", + "last_uploaded_file_name", + "last_uploaded_file_time", + "last_restored_file_name", + "last_restored_file_time", + "percent_completed", + "current_restored_size_mb", + "current_restore_plan_size_mb", + "current_backup_type", + "current_restoring_file_name", + "number_of_files_detected", + "number_of_files_queued", + "number_of_files_skipped", + "number_of_files_restoring", + "number_of_files_restored", + "number_of_files_unrestorable", + "full_backup_sets", + "diff_backup_sets", + "log_backup_sets", + "unrestorable_files", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedDatabaseRestoreDetailsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedDatabaseRestoreDetailsUnrestorableFileProperties(_Model): # pylint: disable=name-too-long + """The managed database's restore details unrestorable file properties. + + :ivar name: File name. + :vartype name: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """File name.""" + + +class ManagedDatabaseSecurityAlertPolicy(ProxyResource): + """A managed database security alert policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SecurityAlertPolicyProperties + """ + + properties: Optional["_models.SecurityAlertPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "state", + "disabled_alerts", + "email_addresses", + "email_account_admins", + "storage_endpoint", + "storage_account_access_key", + "retention_days", + "creation_time", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityAlertPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedDatabaseStartMoveDefinition(_Model): + """Contains the information necessary to start a managed database move. + + :ivar destination_managed_database_id: The destination managed database ID. Required. + :vartype destination_managed_database_id: str + :ivar operation_mode: The move operation mode. Known values are: "Move" and "Copy". + :vartype operation_mode: str or ~azure.mgmt.sql.models.MoveOperationMode + """ + + destination_managed_database_id: str = rest_field( + name="destinationManagedDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """The destination managed database ID. Required.""" + operation_mode: Optional[Union[str, "_models.MoveOperationMode"]] = rest_field( + name="operationMode", visibility=["read", "create", "update", "delete", "query"] + ) + """The move operation mode. Known values are: \"Move\" and \"Copy\".""" + + @overload + def __init__( + self, + *, + destination_managed_database_id: str, + operation_mode: Optional[Union[str, "_models.MoveOperationMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedDatabaseUpdate(_Model): + """An managed database update. + + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedDatabaseProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.ManagedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = [ + "collation", + "status", + "creation_date", + "earliest_restore_point", + "restore_point_in_time", + "default_secondary_location", + "catalog_collation", + "create_mode", + "storage_container_uri", + "source_database_id", + "cross_subscription_source_database_id", + "restorable_dropped_database_id", + "cross_subscription_restorable_dropped_database_id", + "storage_container_identity", + "storage_container_sas_token", + "failover_group_id", + "recoverable_database_id", + "long_term_retention_backup_resource_id", + "auto_complete_restore", + "last_backup_name", + "cross_subscription_target_managed_instance_id", + "is_ledger_on", + "extended_accessibility_info", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedDatabaseProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstance(TrackedResource): + """An Azure SQL managed instance. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceProperties + :ivar identity: The Azure Active Directory identity of the managed instance. + :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity + :ivar sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, + Standard-series); GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, + Premium-series memory optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM + (Business Critical, Premium-series); BC_G8IH (Business Critical, Premium-series memory + optimized). + :vartype sku: ~azure.mgmt.sql.models.Sku + """ + + properties: Optional["_models.ManagedInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + identity: Optional["_models.ResourceIdentity"] = rest_field(visibility=["read", "create"]) + """The Azure Active Directory identity of the managed instance.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, Standard-series); + GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, Premium-series memory + optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM (Business Critical, + Premium-series); BC_G8IH (Business Critical, Premium-series memory optimized).""" + + __flattened_items = [ + "provisioning_state", + "managed_instance_create_mode", + "fully_qualified_domain_name", + "is_general_purpose_v2", + "administrator_login", + "administrator_login_password", + "subnet_id", + "state", + "license_type", + "hybrid_secondary_usage", + "hybrid_secondary_usage_detected", + "v_cores", + "storage_size_in_gb", + "storage_i_ops", + "storage_throughput_m_bps", + "memory_size_in_gb", + "collation", + "dns_zone", + "dns_zone_partner", + "public_data_endpoint_enabled", + "source_managed_instance_id", + "restore_point_in_time", + "proxy_override", + "timezone_id", + "instance_pool_id", + "maintenance_configuration_id", + "private_endpoint_connections", + "minimal_tls_version", + "current_backup_storage_redundancy", + "requested_backup_storage_redundancy", + "zone_redundant", + "primary_user_assigned_identity_id", + "key_id", + "administrators", + "service_principal", + "virtual_cluster_id", + "external_governance_status", + "pricing_model", + "create_time", + "authentication_metadata", + "database_format", + "requested_logical_availability_zone", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ManagedInstanceProperties"] = None, + identity: Optional["_models.ResourceIdentity"] = None, + sku: Optional["_models.Sku"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceAdministrator(ProxyResource): + """An Azure SQL managed instance administrator. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceAdministratorProperties + """ + + properties: Optional["_models.ManagedInstanceAdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["administrator_type", "login", "sid", "tenant_id"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceAdministratorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceAdministratorProperties(_Model): + """The properties of a managed instance administrator. + + :ivar administrator_type: Type of the managed instance administrator. Required. + "ActiveDirectory" + :vartype administrator_type: str or ~azure.mgmt.sql.models.ManagedInstanceAdministratorType + :ivar login: Login name of the managed instance administrator. Required. + :vartype login: str + :ivar sid: SID (object ID) of the managed instance administrator. Required. + :vartype sid: str + :ivar tenant_id: Tenant ID of the managed instance administrator. + :vartype tenant_id: str + """ + + administrator_type: Union[str, "_models.ManagedInstanceAdministratorType"] = rest_field( + name="administratorType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the managed instance administrator. Required. \"ActiveDirectory\"""" + login: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Login name of the managed instance administrator. Required.""" + sid: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SID (object ID) of the managed instance administrator. Required.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the managed instance administrator.""" + + @overload + def __init__( + self, + *, + administrator_type: Union[str, "_models.ManagedInstanceAdministratorType"], + login: str, + sid: str, + tenant_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceAdvancedThreatProtection(ProxyResource): + """A managed instance Advanced Threat Protection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdvancedThreatProtectionProperties + """ + + properties: Optional["_models.AdvancedThreatProtectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state", "creation_time"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdvancedThreatProtectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceAzureADOnlyAuthentication(ProxyResource): + """Azure Active Directory only authentication. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthProperties + """ + + properties: Optional["_models.ManagedInstanceAzureADOnlyAuthProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["azure_ad_only_authentication"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceAzureADOnlyAuthProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceAzureADOnlyAuthProperties(_Model): + """Properties of a active directory only authentication for Managed Instance. + + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. + Required. + :vartype azure_ad_only_authentication: bool + """ + + azure_ad_only_authentication: bool = rest_field( + name="azureADOnlyAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Active Directory only Authentication enabled. Required.""" + + @overload + def __init__( + self, + *, + azure_ad_only_authentication: bool, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceDtc(ProxyResource): + """SQL Managed Instance DTC. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceDtcProperties + """ + + properties: Optional["_models.ManagedInstanceDtcProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "dtc_enabled", + "security_settings", + "external_dns_suffix_search_list", + "dtc_host_name_dns_suffix", + "fqdn_enabled", + "provisioning_state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceDtcProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceDtcProperties(_Model): + """The properties of managed instance DTC. + + :ivar dtc_enabled: Active status of managed instance DTC. + :vartype dtc_enabled: bool + :ivar security_settings: Security settings of managed instance DTC. + :vartype security_settings: ~azure.mgmt.sql.models.ManagedInstanceDtcSecuritySettings + :ivar external_dns_suffix_search_list: External dns suffix search list of managed instance DTC. + :vartype external_dns_suffix_search_list: list[str] + :ivar dtc_host_name_dns_suffix: Host name dns suffix of managed instance DTC. + :vartype dtc_host_name_dns_suffix: str + :ivar fqdn_enabled: Status of FQDN of managed instance DTC. Toggling this setting might trigger + a restart of the managed instance. + :vartype fqdn_enabled: bool + :ivar provisioning_state: Provisioning state of managed instance DTC. Known values are: + "Created", "InProgress", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState + """ + + dtc_enabled: Optional[bool] = rest_field( + name="dtcEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Active status of managed instance DTC.""" + security_settings: Optional["_models.ManagedInstanceDtcSecuritySettings"] = rest_field( + name="securitySettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Security settings of managed instance DTC.""" + external_dns_suffix_search_list: Optional[list[str]] = rest_field( + name="externalDnsSuffixSearchList", visibility=["read", "create", "update", "delete", "query"] + ) + """External dns suffix search list of managed instance DTC.""" + dtc_host_name_dns_suffix: Optional[str] = rest_field(name="dtcHostNameDnsSuffix", visibility=["read"]) + """Host name dns suffix of managed instance DTC.""" + fqdn_enabled: Optional[bool] = rest_field( + name="fqdnEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Status of FQDN of managed instance DTC. Toggling this setting might trigger a restart of the + managed instance.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of managed instance DTC. Known values are: \"Created\", \"InProgress\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + dtc_enabled: Optional[bool] = None, + security_settings: Optional["_models.ManagedInstanceDtcSecuritySettings"] = None, + external_dns_suffix_search_list: Optional[list[str]] = None, + fqdn_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceDtcSecuritySettings(_Model): + """The Security Settings of managed instance DTC. + + :ivar transaction_manager_communication_settings: Transaction Manager communication settings of + managed instance DTC. + :vartype transaction_manager_communication_settings: + ~azure.mgmt.sql.models.ManagedInstanceDtcTransactionManagerCommunicationSettings + :ivar xa_transactions_enabled: Allow XA Transactions to managed instance DTC. + :vartype xa_transactions_enabled: bool + :ivar sna_lu6_point2_transactions_enabled: Allow SNA LU 6.2 Transactions to managed instance + DTC. + :vartype sna_lu6_point2_transactions_enabled: bool + :ivar xa_transactions_default_timeout: Default timeout for XA Transactions (in seconds). + :vartype xa_transactions_default_timeout: int + :ivar xa_transactions_maximum_timeout: Maximum timeout for XA Transactions (in seconds). + :vartype xa_transactions_maximum_timeout: int + """ + + transaction_manager_communication_settings: Optional[ + "_models.ManagedInstanceDtcTransactionManagerCommunicationSettings" + ] = rest_field( + name="transactionManagerCommunicationSettings", visibility=["read", "create", "update", "delete", "query"] + ) + """Transaction Manager communication settings of managed instance DTC.""" + xa_transactions_enabled: Optional[bool] = rest_field( + name="xaTransactionsEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Allow XA Transactions to managed instance DTC.""" + sna_lu6_point2_transactions_enabled: Optional[bool] = rest_field( + name="snaLu6point2TransactionsEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Allow SNA LU 6.2 Transactions to managed instance DTC.""" + xa_transactions_default_timeout: Optional[int] = rest_field( + name="xaTransactionsDefaultTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """Default timeout for XA Transactions (in seconds).""" + xa_transactions_maximum_timeout: Optional[int] = rest_field( + name="xaTransactionsMaximumTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """Maximum timeout for XA Transactions (in seconds).""" + + @overload + def __init__( + self, + *, + transaction_manager_communication_settings: Optional[ + "_models.ManagedInstanceDtcTransactionManagerCommunicationSettings" + ] = None, + xa_transactions_enabled: Optional[bool] = None, + sna_lu6_point2_transactions_enabled: Optional[bool] = None, + xa_transactions_default_timeout: Optional[int] = None, + xa_transactions_maximum_timeout: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceDtcTransactionManagerCommunicationSettings(_Model): # pylint: disable=name-too-long + """The Transaction Manager Communication Settings of managed instance DTC. + + :ivar allow_inbound_enabled: Allow Inbound traffic to managed instance DTC. + :vartype allow_inbound_enabled: bool + :ivar allow_outbound_enabled: Allow Outbound traffic of managed instance DTC. + :vartype allow_outbound_enabled: bool + :ivar authentication: Authentication type of managed instance DTC. + :vartype authentication: str + """ + + allow_inbound_enabled: Optional[bool] = rest_field( + name="allowInboundEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Allow Inbound traffic to managed instance DTC.""" + allow_outbound_enabled: Optional[bool] = rest_field( + name="allowOutboundEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Allow Outbound traffic of managed instance DTC.""" + authentication: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Authentication type of managed instance DTC.""" + + @overload + def __init__( + self, + *, + allow_inbound_enabled: Optional[bool] = None, + allow_outbound_enabled: Optional[bool] = None, + authentication: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceEditionCapability(_Model): + """The managed server capability. + + :ivar name: The managed server version name. + :vartype 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 supported_families: The supported families. + :vartype supported_families: list[~azure.mgmt.sql.models.ManagedInstanceFamilyCapability] + :ivar supported_storage_capabilities: The list of supported storage capabilities for this + edition. + :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The managed server version name.""" + is_general_purpose_v2: Optional[bool] = rest_field(name="isGeneralPurposeV2", visibility=["read"]) + """Whether or not this is a GPv2 variant of General Purpose edition.""" + supported_families: Optional[list["_models.ManagedInstanceFamilyCapability"]] = rest_field( + name="supportedFamilies", visibility=["read"] + ) + """The supported families.""" + supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = rest_field( + name="supportedStorageCapabilities", visibility=["read"] + ) + """The list of supported storage capabilities for this edition.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceEncryptionProtector(ProxyResource): + """The managed instance encryption protector. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtectorProperties + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal + experience. + :vartype kind: str + """ + + properties: Optional["_models.ManagedInstanceEncryptionProtectorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of encryption protector. This is metadata used for the Azure portal experience.""" + + __flattened_items = ["server_key_name", "server_key_type", "uri", "thumbprint", "auto_rotation_enabled"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceEncryptionProtectorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceEncryptionProtectorProperties(_Model): # pylint: disable=name-too-long + """Properties for an encryption protector execution. + + :ivar server_key_name: The name of the managed instance key. + :vartype server_key_name: str + :ivar server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. + Required. Known values are: "ServiceManaged" and "AzureKeyVault". + :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the server key. + :vartype uri: str + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. + :vartype auto_rotation_enabled: bool + """ + + server_key_name: Optional[str] = rest_field( + name="serverKeyName", visibility=["read", "create", "update", "delete", "query"] + ) + """The name of the managed instance key.""" + server_key_type: Union[str, "_models.ServerKeyType"] = rest_field( + name="serverKeyType", visibility=["read", "create", "update", "delete", "query"] + ) + """The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. Required. Known values + are: \"ServiceManaged\" and \"AzureKeyVault\".""" + uri: Optional[str] = rest_field(visibility=["read"]) + """The URI of the server key.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the server key.""" + auto_rotation_enabled: Optional[bool] = rest_field( + name="autoRotationEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Key auto rotation opt-in flag. Either true or false.""" + + @overload + def __init__( + self, + *, + server_key_type: Union[str, "_models.ServerKeyType"], + server_key_name: Optional[str] = None, + auto_rotation_enabled: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceExternalAdministrator(_Model): + """Properties of a active directory administrator. + + :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" + :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :ivar principal_type: Principal Type of the sever administrator. Known values are: "User", + "Group", and "Application". + :vartype principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :ivar login: Login name of the server administrator. + :vartype login: str + :ivar sid: SID (object ID) of the server administrator. + :vartype sid: str + :ivar tenant_id: Tenant ID of the administrator. + :vartype tenant_id: str + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. + :vartype azure_ad_only_authentication: bool + """ + + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = rest_field( + name="administratorType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the sever administrator. \"ActiveDirectory\"""" + principal_type: Optional[Union[str, "_models.PrincipalType"]] = rest_field( + name="principalType", visibility=["read", "create", "update", "delete", "query"] + ) + """Principal Type of the sever administrator. Known values are: \"User\", \"Group\", and + \"Application\".""" + login: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Login name of the server administrator.""" + sid: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SID (object ID) of the server administrator.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the administrator.""" + azure_ad_only_authentication: Optional[bool] = rest_field( + name="azureADOnlyAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Active Directory only Authentication enabled.""" + + @overload + def __init__( + self, + *, + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, + principal_type: Optional[Union[str, "_models.PrincipalType"]] = None, + login: Optional[str] = None, + sid: Optional[str] = None, + tenant_id: Optional[str] = None, + azure_ad_only_authentication: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceFamilyCapability(_Model): + """The managed server family capability. + + :ivar name: Family name. + :vartype name: str + :ivar sku: SKU name. + :vartype sku: str + :ivar zone_redundant: Whether or not zone redundancy is supported for the family. + :vartype zone_redundant: bool + :ivar supported_license_types: List of supported license types. + :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] + :ivar supported_vcores_values: List of supported virtual cores values. + :vartype supported_vcores_values: list[~azure.mgmt.sql.models.ManagedInstanceVcoresCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Family name.""" + sku: Optional[str] = rest_field(visibility=["read"]) + """SKU name.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the family.""" + supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = rest_field( + name="supportedLicenseTypes", visibility=["read"] + ) + """List of supported license types.""" + supported_vcores_values: Optional[list["_models.ManagedInstanceVcoresCapability"]] = rest_field( + name="supportedVcoresValues", visibility=["read"] + ) + """List of supported virtual cores values.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceKey(ProxyResource): + """A managed instance key. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceKeyProperties + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal + experience. + :vartype kind: str + """ + + properties: Optional["_models.ManagedInstanceKeyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of encryption protector. This is metadata used for the Azure portal experience.""" + + __flattened_items = ["server_key_type", "uri", "thumbprint", "creation_date", "auto_rotation_enabled"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceKeyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceKeyProperties(_Model): + """Properties for a key execution. + + :ivar server_key_type: The key type like 'ServiceManaged', 'AzureKeyVault'. Required. Known + values are: "ServiceManaged" and "AzureKeyVault". + :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required. + :vartype uri: str + :ivar thumbprint: Thumbprint of the key. + :vartype thumbprint: str + :ivar creation_date: The key creation date. + :vartype creation_date: ~datetime.datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. + :vartype auto_rotation_enabled: bool + """ + + server_key_type: Union[str, "_models.ServerKeyType"] = rest_field(name="serverKeyType", visibility=["create"]) + """The key type like 'ServiceManaged', 'AzureKeyVault'. Required. Known values are: + \"ServiceManaged\" and \"AzureKeyVault\".""" + uri: Optional[str] = rest_field(visibility=["create"]) + """The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the key.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The key creation date.""" + auto_rotation_enabled: Optional[bool] = rest_field(name="autoRotationEnabled", visibility=["read"]) + """Key auto rotation opt-in flag. Either true or false.""" + + @overload + def __init__( + self, + *, + server_key_type: Union[str, "_models.ServerKeyType"], + uri: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceLongTermRetentionBackup(ProxyResource): + """A long term retention backup for a managed database. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackupProperties + """ + + properties: Optional["_models.ManagedInstanceLongTermRetentionBackupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "managed_instance_name", + "managed_instance_create_time", + "database_name", + "database_deletion_time", + "backup_time", + "backup_expiration_time", + "backup_storage_redundancy", + "backup_storage_access_tier", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceLongTermRetentionBackupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceLongTermRetentionBackupProperties(_Model): # pylint: disable=name-too-long + """Properties of a long term retention backup. + + :ivar managed_instance_name: The managed instance that the backup database belongs to. + :vartype managed_instance_name: str + :ivar managed_instance_create_time: The create time of the instance. + :vartype managed_instance_create_time: ~datetime.datetime + :ivar database_name: The name of the database the backup belong to. + :vartype database_name: str + :ivar database_deletion_time: The delete time of the database. + :vartype database_deletion_time: ~datetime.datetime + :ivar backup_time: The time the backup was taken. + :vartype backup_time: ~datetime.datetime + :ivar backup_expiration_time: The time the long term retention backup will expire. + :vartype backup_expiration_time: ~datetime.datetime + :ivar backup_storage_redundancy: The storage redundancy type of the backup. Known values are: + "Geo", "Local", "Zone", and "GeoZone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backup. Known values + are: "Hot" and "Archive". + :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier + """ + + managed_instance_name: Optional[str] = rest_field(name="managedInstanceName", visibility=["read"]) + """The managed instance that the backup database belongs to.""" + managed_instance_create_time: Optional[datetime.datetime] = rest_field( + name="managedInstanceCreateTime", visibility=["read"], format="rfc3339" + ) + """The create time of the instance.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database the backup belong to.""" + database_deletion_time: Optional[datetime.datetime] = rest_field( + name="databaseDeletionTime", visibility=["read"], format="rfc3339" + ) + """The delete time of the database.""" + backup_time: Optional[datetime.datetime] = rest_field(name="backupTime", visibility=["read"], format="rfc3339") + """The time the backup was taken.""" + backup_expiration_time: Optional[datetime.datetime] = rest_field( + name="backupExpirationTime", visibility=["read"], format="rfc3339" + ) + """The time the long term retention backup will expire.""" + backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="backupStorageRedundancy", visibility=["read"] + ) + """The storage redundancy type of the backup. Known values are: \"Geo\", \"Local\", \"Zone\", and + \"GeoZone\".""" + backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = rest_field( + name="backupStorageAccessTier", visibility=["read"] + ) + """The BackupStorageAccessTier for the LTR backup. Known values are: \"Hot\" and \"Archive\".""" + + +class ManagedInstanceLongTermRetentionPolicy(ProxyResource): + """A long term retention policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyProperties + """ + + properties: Optional["_models.ManagedInstanceLongTermRetentionPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "backup_storage_access_tier", + "weekly_retention", + "monthly_retention", + "yearly_retention", + "week_of_year", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceLongTermRetentionPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceLongTermRetentionPolicyProperties(_Model): # pylint: disable=name-too-long + """Properties of a long term retention policy. + + :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backups. Known values + are: "Hot" and "Archive". + :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier + :ivar weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. + :vartype weekly_retention: str + :ivar monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 format. + :vartype monthly_retention: str + :ivar yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. + :vartype yearly_retention: str + :ivar week_of_year: The week of year to take the yearly backup in an ISO 8601 format. + :vartype week_of_year: int + """ + + backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = rest_field( + name="backupStorageAccessTier", visibility=["read", "create", "update", "delete", "query"] + ) + """The BackupStorageAccessTier for the LTR backups. Known values are: \"Hot\" and \"Archive\".""" + weekly_retention: Optional[str] = rest_field( + name="weeklyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The weekly retention policy for an LTR backup in an ISO 8601 format.""" + monthly_retention: Optional[str] = rest_field( + name="monthlyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The monthly retention policy for an LTR backup in an ISO 8601 format.""" + yearly_retention: Optional[str] = rest_field( + name="yearlyRetention", visibility=["read", "create", "update", "delete", "query"] + ) + """The yearly retention policy for an LTR backup in an ISO 8601 format.""" + week_of_year: Optional[int] = rest_field( + name="weekOfYear", visibility=["read", "create", "update", "delete", "query"] + ) + """The week of year to take the yearly backup in an ISO 8601 format.""" + + @overload + def __init__( + self, + *, + backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None, + weekly_retention: Optional[str] = None, + monthly_retention: Optional[str] = None, + yearly_retention: Optional[str] = None, + week_of_year: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceMaintenanceConfigurationCapability(_Model): # pylint: disable=name-too-long + """The maintenance configuration capability. + + :ivar name: Maintenance configuration name. + :vartype name: str + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Maintenance configuration name.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceOperation(ProxyResource): + """A managed instance operation. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceOperationProperties + """ + + properties: Optional["_models.ManagedInstanceOperationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "managed_instance_name", + "operation", + "operation_friendly_name", + "percent_complete", + "start_time", + "state", + "error_code", + "error_description", + "error_severity", + "is_user_error", + "estimated_completion_time", + "description", + "is_cancellable", + "operation_parameters", + "operation_steps", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceOperationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceOperationParametersPair(_Model): + """The parameters of a managed instance operation. + + :ivar current_parameters: The current parameters. + :vartype current_parameters: ~azure.mgmt.sql.models.UpsertManagedServerOperationParameters + :ivar requested_parameters: The requested parameters. + :vartype requested_parameters: ~azure.mgmt.sql.models.UpsertManagedServerOperationParameters + """ + + current_parameters: Optional["_models.UpsertManagedServerOperationParameters"] = rest_field( + name="currentParameters", visibility=["read"] + ) + """The current parameters.""" + requested_parameters: Optional["_models.UpsertManagedServerOperationParameters"] = rest_field( + name="requestedParameters", visibility=["read"] + ) + """The requested parameters.""" + + +class ManagedInstanceOperationProperties(_Model): + """The properties of a managed instance operation. + + :ivar managed_instance_name: The name of the managed instance the operation is being performed + on. + :vartype managed_instance_name: str + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + :ivar operation_parameters: The operation parameters. + :vartype operation_parameters: ~azure.mgmt.sql.models.ManagedInstanceOperationParametersPair + :ivar operation_steps: The operation steps. + :vartype operation_steps: ~azure.mgmt.sql.models.ManagedInstanceOperationSteps + """ + + managed_instance_name: Optional[str] = rest_field(name="managedInstanceName", visibility=["read"]) + """The name of the managed instance the operation is being performed on.""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the operation completed.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[Union[str, "_models.ManagementOperationState"]] = rest_field(visibility=["read"]) + """The operation state. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", + \"CancelInProgress\", and \"Cancelled\".""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + is_user_error: Optional[bool] = rest_field(name="isUserError", visibility=["read"]) + """Whether or not the error is a user error.""" + estimated_completion_time: Optional[datetime.datetime] = rest_field( + name="estimatedCompletionTime", visibility=["read"], format="rfc3339" + ) + """The estimated completion time of the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The operation description.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Whether the operation can be cancelled.""" + operation_parameters: Optional["_models.ManagedInstanceOperationParametersPair"] = rest_field( + name="operationParameters", visibility=["read"] + ) + """The operation parameters.""" + operation_steps: Optional["_models.ManagedInstanceOperationSteps"] = rest_field( + name="operationSteps", visibility=["read"] + ) + """The operation steps.""" + + +class ManagedInstanceOperationSteps(_Model): + """The steps of a managed instance operation. + + :ivar total_steps: The total number of operation steps. + :vartype total_steps: str + :ivar current_step: The number of current operation steps. + :vartype current_step: int + :ivar steps_list: The operation steps list. + :vartype steps_list: + list[~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration] + """ + + total_steps: Optional[str] = rest_field(name="totalSteps", visibility=["read"]) + """The total number of operation steps.""" + current_step: Optional[int] = rest_field(name="currentStep", visibility=["read"]) + """The number of current operation steps.""" + steps_list: Optional[list["_models.UpsertManagedServerOperationStepWithEstimatesAndDuration"]] = rest_field( + name="stepsList", visibility=["read"] + ) + """The operation steps list.""" + + +class ManagedInstancePairInfo(_Model): + """Pairs of Managed Instances in the failover group. + + :ivar primary_managed_instance_id: Id of Primary Managed Instance in pair. + :vartype primary_managed_instance_id: str + :ivar partner_managed_instance_id: Id of Partner Managed Instance in pair. + :vartype partner_managed_instance_id: str + """ + + primary_managed_instance_id: Optional[str] = rest_field( + name="primaryManagedInstanceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Id of Primary Managed Instance in pair.""" + partner_managed_instance_id: Optional[str] = rest_field( + name="partnerManagedInstanceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Id of Partner Managed Instance in pair.""" + + @overload + def __init__( + self, + *, + primary_managed_instance_id: Optional[str] = None, + partner_managed_instance_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstancePecProperty(_Model): + """A private endpoint connection under a managed instance. + + :ivar id: Resource ID. + :vartype id: str + :ivar properties: Private endpoint connection properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionProperties + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Resource ID.""" + properties: Optional["_models.ManagedInstancePrivateEndpointConnectionProperties"] = rest_field(visibility=["read"]) + """Private endpoint connection properties.""" + + +class ManagedInstancePrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionProperties + """ + + properties: Optional["_models.ManagedInstancePrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["private_endpoint", "private_link_service_connection_state", "provisioning_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstancePrivateEndpointConnectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstancePrivateEndpointConnectionProperties(_Model): # pylint: disable=name-too-long + """Properties of a private endpoint connection. + + :ivar private_endpoint: Private endpoint which the connection belongs to. + :vartype private_endpoint: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty + :ivar private_link_service_connection_state: Connection State of the Private Endpoint + Connection. + :vartype private_link_service_connection_state: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the Private Endpoint Connection. + :vartype provisioning_state: str + """ + + private_endpoint: Optional["_models.ManagedInstancePrivateEndpointProperty"] = rest_field( + name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Private endpoint which the connection belongs to.""" + private_link_service_connection_state: Optional[ + "_models.ManagedInstancePrivateLinkServiceConnectionStateProperty" + ] = rest_field(name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"]) + """Connection State of the Private Endpoint Connection.""" + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """State of the Private Endpoint Connection.""" + + @overload + def __init__( + self, + *, + private_endpoint: Optional["_models.ManagedInstancePrivateEndpointProperty"] = None, + private_link_service_connection_state: Optional[ + "_models.ManagedInstancePrivateLinkServiceConnectionStateProperty" + ] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstancePrivateEndpointProperty(_Model): + """ManagedInstancePrivateEndpointProperty. + + :ivar id: Resource id of the private endpoint. + :vartype id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource id of the private endpoint.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstancePrivateLink(ProxyResource): + """A private link resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: The private link resource group id. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties + """ + + properties: Optional["_models.ManagedInstancePrivateLinkProperties"] = rest_field(visibility=["read"]) + """The private link resource group id.""" + + +class ManagedInstancePrivateLinkProperties(_Model): + """Properties of a private link resource. + + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] + """ + + group_id: Optional[str] = rest_field(name="groupId", visibility=["read"]) + """The private link resource group id.""" + required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"]) + """The private link resource required member names.""" + required_zone_names: Optional[list[str]] = rest_field(name="requiredZoneNames", visibility=["read"]) + """The private link resource required zone names.""" + + +class ManagedInstancePrivateLinkServiceConnectionStateProperty(_Model): # pylint: disable=name-too-long + """ManagedInstancePrivateLinkServiceConnectionStateProperty. + + :ivar status: The private link service connection status. Required. + :vartype status: str + :ivar description: The private link service connection description. Required. + :vartype description: str + :ivar actions_required: The private link service connection description. + :vartype actions_required: str + """ + + status: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The private link service connection status. Required.""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The private link service connection description. Required.""" + actions_required: Optional[str] = rest_field(name="actionsRequired", visibility=["read"]) + """The private link service connection description.""" + + @overload + def __init__( + self, + *, + status: str, + description: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceProperties(_Model): + """The properties of a managed instance. + + :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 managed_instance_create_mode: Specifies the mode of database creation. + + Default: Regular instance creation. + + Restore: Creates an instance by restoring a set of backups to specific point in time. + RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: "Default" + and "PointInTimeRestore". + :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 + :ivar administrator_login_password: The administrator login password (required for managed + instance creation). + :vartype administrator_login_password: str + :ivar subnet_id: Subnet resource ID for the managed instance. + :vartype subnet_id: str + :ivar state: The state of the managed instance. + :vartype state: str + :ivar license_type: 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). 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: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, + 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service tier. + :vartype v_cores: int + :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. + 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 memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and + maximum value depend on the number of vCores and service tier. Read more about resource limits: + `https://aka.ms/mi-resource-limits-api `_. + :vartype memory_size_in_gb: int + :ivar collation: Collation of the managed instance. + :vartype collation: str + :ivar dns_zone: The Dns Zone that the managed instance is in. + :vartype dns_zone: str + :ivar dns_zone_partner: The resource id of another managed instance whose DNS zone this managed + instance will share after creation. + :vartype dns_zone_partner: str + :ivar public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. + :vartype public_data_endpoint_enabled: bool + :ivar source_managed_instance_id: The resource identifier of the source managed instance + associated with create operation of this instance. + :vartype source_managed_instance_id: str + :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source + database that will be restored to create the new database. + :vartype restore_point_in_time: ~datetime.datetime + :ivar proxy_override: Connection type used for connecting to the instance. Known values are: + "Proxy", "Redirect", and "Default". + :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. 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 PowerShell. An example of valid timezone id is + "Pacific Standard Time" or "W. Europe Standard Time". + :vartype timezone_id: str + :ivar instance_pool_id: The Id of the instance pool this managed server belongs to. + :vartype instance_pool_id: str + :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this + managed instance. + :vartype maintenance_configuration_id: str + :ivar private_endpoint_connections: List of private endpoint connections on a managed instance. + :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] + :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. + :vartype minimal_tls_version: str + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), + Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known values are: "Geo", + "Local", "Zone", and "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups + for this instance. The options are Local (LocallyRedundantStorage), Zone + (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known + values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar zone_redundant: Whether or not the zone-redundancy is enabled. + :vartype zone_redundant: bool + :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used + by default. + :vartype primary_user_assigned_identity_id: str + :ivar key_id: A CMK URI of the key to use for encryption. + :vartype key_id: str + :ivar administrators: The Azure Active Directory administrator can be utilized during instance + creation and for instance updates, except for the azureADOnlyAuthentication property. To update + the azureADOnlyAuthentication property, individual API must be used. + :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: Pricing model of Managed Instance. Known values are: "Regular" and + "Freemium". + :vartype pricing_model: str or ~azure.mgmt.sql.models.PricingModel + :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", "SQLServer2022", and "SQLServer2025". + :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat + :ivar requested_logical_availability_zone: Specifies the logical availability zone Managed + Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". + :vartype requested_logical_availability_zone: str or + ~azure.mgmt.sql.models.AvailabilityZoneType + """ + + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of managed instance. Known values are: \"Created\", \"InProgress\", + \"Succeeded\", \"Failed\", and \"Canceled\".""" + managed_instance_create_mode: Optional[Union[str, "_models.ManagedServerCreateMode"]] = rest_field( + name="managedInstanceCreateMode", visibility=["create"] + ) + """Specifies the mode of database creation. + + Default: Regular instance creation. + + Restore: Creates an instance by restoring a set of backups to specific point in time. + RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: \"Default\" + and \"PointInTimeRestore\".""" + fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) + """The fully qualified domain name of the managed instance.""" + is_general_purpose_v2: Optional[bool] = rest_field( + name="isGeneralPurposeV2", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not this is a GPv2 variant of General Purpose edition.""" + administrator_login: Optional[str] = rest_field(name="administratorLogin", visibility=["read", "create"]) + """Administrator username for the managed instance. Can only be specified when the managed + instance is being created (and is required for creation).""" + administrator_login_password: Optional[str] = rest_field( + name="administratorLoginPassword", visibility=["create", "update"] + ) + """The administrator login password (required for managed instance creation).""" + subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read", "create", "update", "delete", "query"]) + """Subnet resource ID for the managed instance.""" + state: Optional[str] = rest_field(visibility=["read"]) + """The state of the managed instance.""" + license_type: Optional[Union[str, "_models.ManagedInstanceLicenseType"]] = rest_field( + name="licenseType", visibility=["read", "create", "update", "delete", "query"] + ) + """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). Known + values are: \"LicenseIncluded\" and \"BasePrice\".""" + hybrid_secondary_usage: Optional[Union[str, "_models.HybridSecondaryUsage"]] = rest_field( + name="hybridSecondaryUsage", visibility=["read", "create", "update", "delete", "query"] + ) + """Hybrid secondary usage. Possible values are 'Active' (default value) and 'Passive' (customer + uses the secondary as Passive DR). Known values are: \"Active\" and \"Passive\".""" + hybrid_secondary_usage_detected: Optional[Union[str, "_models.HybridSecondaryUsageDetected"]] = rest_field( + name="hybridSecondaryUsageDetected", visibility=["read"] + ) + """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\".""" + v_cores: Optional[int] = rest_field(name="vCores", visibility=["read", "create", "update", "delete", "query"]) + """The number of vCores. Allowed values: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 56, 64, 80, 96, + 128. Supported vCores depends on the selected hardware family and service tier.""" + storage_size_in_gb: Optional[int] = rest_field( + name="storageSizeInGB", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage size in GB. Minimum value: 32. Maximum value: 32768. Increments of 32 GB allowed only. + Maximum value depends on the selected hardware family and number of vCores.""" + storage_i_ops: Optional[int] = rest_field( + name="storageIOps", visibility=["read", "create", "update", "delete", "query"] + ) + """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.""" + storage_throughput_m_bps: Optional[int] = rest_field( + name="storageThroughputMBps", visibility=["read", "create", "update", "delete", "query"] + ) + """Storage throughput MBps parameter is not supported in the instance create/update operation.""" + memory_size_in_gb: Optional[int] = rest_field( + name="memorySizeInGB", visibility=["read", "create", "update", "delete", "query"] + ) + """Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and maximum value depend on + the number of vCores and service tier. Read more about resource limits: + `https://aka.ms/mi-resource-limits-api `_.""" + collation: Optional[str] = rest_field(visibility=["read", "create"]) + """Collation of the managed instance.""" + dns_zone: Optional[str] = rest_field(name="dnsZone", visibility=["read"]) + """The Dns Zone that the managed instance is in.""" + dns_zone_partner: Optional[str] = rest_field(name="dnsZonePartner", visibility=["create"]) + """The resource id of another managed instance whose DNS zone this managed instance will share + after creation.""" + public_data_endpoint_enabled: Optional[bool] = rest_field( + name="publicDataEndpointEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the public data endpoint is enabled.""" + source_managed_instance_id: Optional[str] = rest_field(name="sourceManagedInstanceId", visibility=["create"]) + """The resource identifier of the source managed instance associated with create operation of this + instance.""" + restore_point_in_time: Optional[datetime.datetime] = rest_field( + name="restorePointInTime", visibility=["create"], format="rfc3339" + ) + """Specifies the point in time (ISO8601 format) of the source database that will be restored to + create the new database.""" + proxy_override: Optional[Union[str, "_models.ManagedInstanceProxyOverride"]] = rest_field( + name="proxyOverride", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection type used for connecting to the instance. Known values are: \"Proxy\", \"Redirect\", + and \"Default\".""" + timezone_id: Optional[str] = rest_field(name="timezoneId", visibility=["read", "create"]) + """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. 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 + PowerShell. An example of valid timezone id is \"Pacific Standard Time\" or \"W. Europe + Standard Time\".""" + instance_pool_id: Optional[str] = rest_field( + name="instancePoolId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Id of the instance pool this managed server belongs to.""" + maintenance_configuration_id: Optional[str] = rest_field( + name="maintenanceConfigurationId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies maintenance configuration id to apply to this managed instance.""" + private_endpoint_connections: Optional[list["_models.ManagedInstancePecProperty"]] = rest_field( + name="privateEndpointConnections", visibility=["read"] + ) + """List of private endpoint connections on a managed instance.""" + minimal_tls_version: Optional[str] = rest_field( + name="minimalTlsVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'.""" + current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="currentBackupStorageRedundancy", visibility=["read"] + ) + """The storage account type used to store backups for this instance. The options are Local + (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and + GeoZone(GeoZoneRedundantStorage). Known values are: \"Geo\", \"Local\", \"Zone\", and + \"GeoZone\".""" + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="requestedBackupStorageRedundancy", visibility=["read", "create", "update", "delete", "query"] + ) + """The storage account type to be used to store backups for this instance. The options are Local + (LocallyRedundantStorage), Zone (ZoneRedundantStorage), Geo (GeoRedundantStorage) and + GeoZone(GeoZoneRedundantStorage). Known values are: \"Geo\", \"Local\", \"Zone\", and + \"GeoZone\".""" + zone_redundant: Optional[bool] = rest_field( + name="zoneRedundant", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not the zone-redundancy is enabled.""" + primary_user_assigned_identity_id: Optional[str] = rest_field( + name="primaryUserAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource id of a user assigned identity to be used by default.""" + key_id: Optional[str] = rest_field(name="keyId", visibility=["read", "create"]) + """A CMK URI of the key to use for encryption.""" + administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = rest_field(visibility=["read", "create"]) + """The Azure Active Directory administrator can be utilized during instance creation and for + instance updates, except for the azureADOnlyAuthentication property. To update the + azureADOnlyAuthentication property, individual API must be used.""" + service_principal: Optional["_models.ServicePrincipal"] = rest_field( + name="servicePrincipal", visibility=["read", "create", "update", "delete", "query"] + ) + """The managed instance's service principal.""" + virtual_cluster_id: Optional[str] = rest_field(name="virtualClusterId", visibility=["read"]) + """Virtual cluster resource id for the Managed Instance.""" + external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = rest_field( + name="externalGovernanceStatus", visibility=["read"] + ) + """Status of external governance. Known values are: \"Enabled\" and \"Disabled\".""" + pricing_model: Optional[Union[str, "_models.PricingModel"]] = rest_field( + name="pricingModel", visibility=["read", "create", "update", "delete", "query"] + ) + """Pricing model of Managed Instance. Known values are: \"Regular\" and \"Freemium\".""" + create_time: Optional[datetime.datetime] = rest_field(name="createTime", visibility=["read"], format="rfc3339") + """Specifies the point in time (ISO8601 format) of the Managed Instance creation.""" + authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = rest_field( + name="authenticationMetadata", visibility=["read", "create", "update", "delete", "query"] + ) + """The managed instance's authentication metadata lookup mode. Known values are: \"AzureAD\", + \"Paired\", and \"Windows\".""" + database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = rest_field( + name="databaseFormat", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the internal format of instance databases specific to the SQL engine version. Known + values are: \"AlwaysUpToDate\", \"SQLServer2022\", and \"SQLServer2025\".""" + requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = rest_field( + name="requestedLogicalAvailabilityZone", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the logical availability zone Managed Instance is pinned to. Known values are: + \"NoPreference\", \"1\", \"2\", and \"3\".""" + + @overload + def __init__( # pylint: disable=too-many-locals + self, + *, + 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, + memory_size_in_gb: Optional[int] = None, + collation: Optional[str] = None, + dns_zone_partner: Optional[str] = None, + public_data_endpoint_enabled: Optional[bool] = None, + source_managed_instance_id: Optional[str] = None, + restore_point_in_time: Optional[datetime.datetime] = None, + proxy_override: Optional[Union[str, "_models.ManagedInstanceProxyOverride"]] = None, + timezone_id: Optional[str] = None, + instance_pool_id: Optional[str] = None, + maintenance_configuration_id: Optional[str] = None, + minimal_tls_version: Optional[str] = None, + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + zone_redundant: Optional[bool] = None, + primary_user_assigned_identity_id: Optional[str] = None, + key_id: Optional[str] = None, + administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = None, + service_principal: Optional["_models.ServicePrincipal"] = None, + pricing_model: Optional[Union[str, "_models.PricingModel"]] = None, + authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, + database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, + requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceQuery(ProxyResource): + """Database query. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.QueryProperties + """ + + properties: Optional["_models.QueryProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["query_text"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.QueryProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceUpdate(_Model): + """An update request for an Azure SQL Database managed instance. + + :ivar sku: Managed instance sku. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar identity: Managed instance identity. + :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Managed instance sku.""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Managed instance identity.""" + properties: Optional["_models.ManagedInstanceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = [ + "provisioning_state", + "managed_instance_create_mode", + "fully_qualified_domain_name", + "is_general_purpose_v2", + "administrator_login", + "administrator_login_password", + "subnet_id", + "state", + "license_type", + "hybrid_secondary_usage", + "hybrid_secondary_usage_detected", + "v_cores", + "storage_size_in_gb", + "storage_i_ops", + "storage_throughput_m_bps", + "memory_size_in_gb", + "collation", + "dns_zone", + "dns_zone_partner", + "public_data_endpoint_enabled", + "source_managed_instance_id", + "restore_point_in_time", + "proxy_override", + "timezone_id", + "instance_pool_id", + "maintenance_configuration_id", + "private_endpoint_connections", + "minimal_tls_version", + "current_backup_storage_redundancy", + "requested_backup_storage_redundancy", + "zone_redundant", + "primary_user_assigned_identity_id", + "key_id", + "administrators", + "service_principal", + "virtual_cluster_id", + "external_governance_status", + "pricing_model", + "create_time", + "authentication_metadata", + "database_format", + "requested_logical_availability_zone", + ] + + @overload + def __init__( + self, + *, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.ResourceIdentity"] = None, + properties: Optional["_models.ManagedInstanceProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest(_Model): # pylint: disable=name-too-long + """Validate azure key vault encryption key. + + :ivar tde_key_uri: The URI of the key. Required. + :vartype tde_key_uri: str + """ + + tde_key_uri: str = rest_field(name="tdeKeyUri", visibility=["create", "update"]) + """The URI of the key. Required.""" + + @overload + def __init__( + self, + *, + tde_key_uri: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceVcoresCapability(_Model): + """The managed instance virtual cores capability. + + :ivar name: The virtual cores identifier. + :vartype name: str + :ivar value: The virtual cores value. + :vartype value: int + :ivar supported_memory_sizes_in_gb: Supported memory sizes in GB. + :vartype supported_memory_sizes_in_gb: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar supported_memory_limits_mb: Memory limit MB ranges. + :vartype supported_memory_limits_mb: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar included_max_size: Included size. + :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar supported_storage_sizes: Storage size ranges. + :vartype supported_storage_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] + :ivar included_storage_i_ops: Included storage IOps. + :vartype included_storage_i_ops: int + :ivar supported_storage_i_ops: Storage IOps ranges. + :vartype supported_storage_i_ops: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar iops_min_value_override_factor_per_selected_storage_gb: Min IOps override factor per + selected storage GB. + :vartype iops_min_value_override_factor_per_selected_storage_gb: float + :ivar iops_included_value_override_factor_per_selected_storage_gb: Included IOps override + factor per selected storage GB. + :vartype iops_included_value_override_factor_per_selected_storage_gb: float + :ivar included_storage_throughput_m_bps: Included storage throughput MBps. + :vartype included_storage_throughput_m_bps: int + :ivar supported_storage_throughput_m_bps: Storage throughput MBps ranges. + :vartype supported_storage_throughput_m_bps: ~azure.mgmt.sql.models.MaxLimitRangeCapability + :ivar throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Min throughput MBps + override factor per selected storage GB. + :vartype throughput_m_bps_min_value_override_factor_per_selected_storage_gb: float + :ivar throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Included + throughput MBps override factor per selected storage GB. + :vartype throughput_m_bps_included_value_override_factor_per_selected_storage_gb: float + :ivar instance_pool_supported: True if this service objective is supported for managed + instances in an instance pool. + :vartype instance_pool_supported: bool + :ivar standalone_supported: True if this service objective is supported for standalone managed + instances. + :vartype standalone_supported: bool + :ivar supported_maintenance_configurations: List of supported maintenance configurations. + :vartype supported_maintenance_configurations: + list[~azure.mgmt.sql.models.ManagedInstanceMaintenanceConfigurationCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The virtual cores identifier.""" + value: Optional[int] = rest_field(visibility=["read"]) + """The virtual cores value.""" + supported_memory_sizes_in_gb: Optional["_models.MaxLimitRangeCapability"] = rest_field( + name="supportedMemorySizesInGB", visibility=["read"] + ) + """Supported memory sizes in GB.""" + supported_memory_limits_mb: Optional["_models.MaxLimitRangeCapability"] = rest_field( + name="supportedMemoryLimitsMB", visibility=["read"] + ) + """Memory limit MB ranges.""" + included_max_size: Optional["_models.MaxSizeCapability"] = rest_field(name="includedMaxSize", visibility=["read"]) + """Included size.""" + supported_storage_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = rest_field( + name="supportedStorageSizes", visibility=["read"] + ) + """Storage size ranges.""" + included_storage_i_ops: Optional[int] = rest_field(name="includedStorageIOps", visibility=["read"]) + """Included storage IOps.""" + supported_storage_i_ops: Optional["_models.MaxLimitRangeCapability"] = rest_field( + name="supportedStorageIOps", visibility=["read"] + ) + """Storage IOps ranges.""" + iops_min_value_override_factor_per_selected_storage_gb: Optional[float] = rest_field( + name="iopsMinValueOverrideFactorPerSelectedStorageGB", visibility=["read"] + ) + """Min IOps override factor per selected storage GB.""" + iops_included_value_override_factor_per_selected_storage_gb: Optional[float] = rest_field( + name="iopsIncludedValueOverrideFactorPerSelectedStorageGB", visibility=["read"] + ) + """Included IOps override factor per selected storage GB.""" + included_storage_throughput_m_bps: Optional[int] = rest_field( + name="includedStorageThroughputMBps", visibility=["read"] + ) + """Included storage throughput MBps.""" + supported_storage_throughput_m_bps: Optional["_models.MaxLimitRangeCapability"] = rest_field( + name="supportedStorageThroughputMBps", visibility=["read"] + ) + """Storage throughput MBps ranges.""" + throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Optional[float] = rest_field( + name="throughputMBpsMinValueOverrideFactorPerSelectedStorageGB", visibility=["read"] + ) + """Min throughput MBps override factor per selected storage GB.""" + throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Optional[float] = rest_field( + name="throughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB", visibility=["read"] + ) + """Included throughput MBps override factor per selected storage GB.""" + instance_pool_supported: Optional[bool] = rest_field(name="instancePoolSupported", visibility=["read"]) + """True if this service objective is supported for managed instances in an instance pool.""" + standalone_supported: Optional[bool] = rest_field(name="standaloneSupported", visibility=["read"]) + """True if this service objective is supported for standalone managed instances.""" + supported_maintenance_configurations: Optional[ + list["_models.ManagedInstanceMaintenanceConfigurationCapability"] + ] = rest_field(name="supportedMaintenanceConfigurations", visibility=["read"]) + """List of supported maintenance configurations.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceVersionCapability(_Model): + """The managed instance capability. + + :ivar name: The server version name. + :vartype name: str + :ivar supported_editions: The list of supported managed instance editions. + :vartype supported_editions: list[~azure.mgmt.sql.models.ManagedInstanceEditionCapability] + :ivar supported_instance_pool_editions: The list of supported instance pool editions. + :vartype supported_instance_pool_editions: + list[~azure.mgmt.sql.models.InstancePoolEditionCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The server version name.""" + supported_editions: Optional[list["_models.ManagedInstanceEditionCapability"]] = rest_field( + name="supportedEditions", visibility=["read"] + ) + """The list of supported managed instance editions.""" + supported_instance_pool_editions: Optional[list["_models.InstancePoolEditionCapability"]] = rest_field( + name="supportedInstancePoolEditions", visibility=["read"] + ) + """The list of supported instance pool editions.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedInstanceVulnerabilityAssessment(ProxyResource): + """A managed instance vulnerability assessment. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessmentProperties + """ + + properties: Optional["_models.ManagedInstanceVulnerabilityAssessmentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "storage_container_path", + "storage_container_sas_key", + "storage_account_access_key", + "recurring_scans", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedInstanceVulnerabilityAssessmentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedInstanceVulnerabilityAssessmentProperties(_Model): # pylint: disable=name-too-long + """Properties of a managed instance vulnerability assessment. + + :ivar storage_container_path: A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). Required. + :vartype storage_container_path: str + :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to + the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' + isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not + behind a Vnet or a firewall. + :vartype storage_container_sas_key: str + :ivar storage_account_access_key: Specifies the identifier key of the storage account for + vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet + or a firewall. + :vartype storage_account_access_key: str + :ivar recurring_scans: The recurring scans settings. + :vartype recurring_scans: + ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties + """ + + storage_container_path: str = rest_field(name="storageContainerPath", visibility=["create", "update"]) + """A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). Required.""" + storage_container_sas_key: Optional[str] = rest_field( + name="storageContainerSasKey", visibility=["create", "update"] + ) + """A shared access signature (SAS Key) that has write access to the blob container specified in + 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. Applies only if the storage account is not behind a Vnet or + a firewall.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the storage account for vulnerability assessment scan results. + If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. Applies only + if the storage account is not behind a Vnet or a firewall.""" + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = rest_field( + name="recurringScans", visibility=["read", "create", "update", "delete", "query"] + ) + """The recurring scans settings.""" + + @overload + def __init__( + self, + *, + storage_container_path: str, + storage_container_sas_key: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedLedgerDigestUploads(ProxyResource): + """Azure SQL Database ledger digest upload settings. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsProperties + """ + + properties: Optional["_models.ManagedLedgerDigestUploadsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["digest_storage_endpoint", "state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedLedgerDigestUploadsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedLedgerDigestUploadsProperties(_Model): + """The properties of a database ledger digest upload settings. + + :ivar digest_storage_endpoint: The digest storage endpoint, which must be either an Azure blob + storage endpoint or an URI for Azure Confidential Ledger. + :vartype digest_storage_endpoint: str + :ivar state: Specifies the state of ledger digest upload. Known values are: "Enabled" and + "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsState + """ + + digest_storage_endpoint: Optional[str] = rest_field( + name="digestStorageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for + Azure Confidential Ledger.""" + state: Optional[Union[str, "_models.ManagedLedgerDigestUploadsState"]] = rest_field(visibility=["read"]) + """Specifies the state of ledger digest upload. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + digest_storage_endpoint: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServerDnsAlias(ProxyResource): + """A managed server DNS alias. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedServerDnsAliasProperties + """ + + properties: Optional["_models.ManagedServerDnsAliasProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["azure_dns_record", "public_azure_dns_record"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedServerDnsAliasProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedServerDnsAliasAcquisition(_Model): + """A managed server DNS alias acquisition request. + + :ivar old_managed_server_dns_alias_resource_id: The resource ID of the managed server DNS alias + that will be acquired to point to this managed server instead. Required. + :vartype old_managed_server_dns_alias_resource_id: str + """ + + old_managed_server_dns_alias_resource_id: str = rest_field( + name="oldManagedServerDnsAliasResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ID of the managed server DNS alias that will be acquired to point to this managed + server instead. Required.""" + + @overload + def __init__( + self, + *, + old_managed_server_dns_alias_resource_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServerDnsAliasCreation(_Model): + """A managed server dns alias creation request. + + :ivar create_dns_record: Whether or not DNS record should be created for this alias. + :vartype create_dns_record: bool + """ + + create_dns_record: Optional[bool] = rest_field( + name="createDnsRecord", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not DNS record should be created for this alias.""" + + @overload + def __init__( + self, + *, + create_dns_record: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ManagedServerDnsAliasProperties(_Model): + """Properties of a managed server DNS alias. + + :ivar azure_dns_record: The fully qualified DNS record for managed server alias. + :vartype azure_dns_record: str + :ivar public_azure_dns_record: The fully qualified public DNS record for managed server alias. + :vartype public_azure_dns_record: str + """ + + azure_dns_record: Optional[str] = rest_field(name="azureDnsRecord", visibility=["read"]) + """The fully qualified DNS record for managed server alias.""" + public_azure_dns_record: Optional[str] = rest_field(name="publicAzureDnsRecord", visibility=["read"]) + """The fully qualified public DNS record for managed server alias.""" + + +class ManagedServerSecurityAlertPolicy(ProxyResource): + """A managed server security alert policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SecurityAlertsPolicyProperties + """ + + properties: Optional["_models.SecurityAlertsPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "state", + "disabled_alerts", + "email_addresses", + "email_account_admins", + "storage_endpoint", + "storage_account_access_key", + "retention_days", + "creation_time", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityAlertsPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedTransparentDataEncryption(ProxyResource): + """A managed database transparent data encryption state. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ManagedTransparentDataEncryptionProperties + """ + + properties: Optional["_models.ManagedTransparentDataEncryptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ManagedTransparentDataEncryptionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ManagedTransparentDataEncryptionProperties(_Model): # pylint: disable=name-too-long + """Properties of a transparent data encryption. + + :ivar state: Specifies the state of the transparent data encryption. Required. Known values + are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + """ + + state: Union[str, "_models.TransparentDataEncryptionState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the transparent data encryption. Required. Known values are: \"Enabled\" + and \"Disabled\".""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.TransparentDataEncryptionState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaxLimitRangeCapability(_Model): + """The maximum limit range capability. + + :ivar min_value: Minimum value. + :vartype min_value: int + :ivar max_value: Maximum value. + :vartype max_value: int + :ivar scale_size: Scale/step size for discrete values between the minimum value and the maximum + value. + :vartype scale_size: int + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + min_value: Optional[int] = rest_field(name="minValue", visibility=["read"]) + """Minimum value.""" + max_value: Optional[int] = rest_field(name="maxValue", visibility=["read"]) + """Maximum value.""" + scale_size: Optional[int] = rest_field(name="scaleSize", visibility=["read"]) + """Scale/step size for discrete values between the minimum value and the maximum value.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MaxSizeCapability(_Model): + """The maximum size capability. + + :ivar limit: The maximum size limit (see 'unit' for the units). + :vartype limit: int + :ivar unit: The units that the limit is expressed in. Known values are: "Megabytes", + "Gigabytes", "Terabytes", and "Petabytes". + :vartype unit: str or ~azure.mgmt.sql.models.MaxSizeUnit + """ + + limit: Optional[int] = rest_field(visibility=["read"]) + """The maximum size limit (see 'unit' for the units).""" + unit: Optional[Union[str, "_models.MaxSizeUnit"]] = rest_field(visibility=["read"]) + """The units that the limit is expressed in. Known values are: \"Megabytes\", \"Gigabytes\", + \"Terabytes\", and \"Petabytes\".""" + + +class MaxSizeRangeCapability(_Model): + """The maximum size range capability. + + :ivar min_value: Minimum value. + :vartype min_value: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar max_value: Maximum value. + :vartype max_value: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar scale_size: Scale/step size for discrete values between the minimum value and the maximum + value. + :vartype scale_size: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar log_size: Size of transaction log. + :vartype log_size: ~azure.mgmt.sql.models.LogSizeCapability + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + min_value: Optional["_models.MaxSizeCapability"] = rest_field(name="minValue", visibility=["read"]) + """Minimum value.""" + max_value: Optional["_models.MaxSizeCapability"] = rest_field(name="maxValue", visibility=["read"]) + """Maximum value.""" + scale_size: Optional["_models.MaxSizeCapability"] = rest_field(name="scaleSize", visibility=["read"]) + """Scale/step size for discrete values between the minimum value and the maximum value.""" + log_size: Optional["_models.LogSizeCapability"] = rest_field(name="logSize", visibility=["read"]) + """Size of transaction log.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class MinCapacityCapability(_Model): + """The min capacity capability. + + :ivar value: Min capacity value. + :vartype value: float + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + value: Optional[float] = rest_field(visibility=["read"]) + """Min capacity value.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Name(_Model): + """ARM Usage Name. + + :ivar value: Usage name value. + :vartype value: str + :ivar localized_value: Usage name localized value. + :vartype localized_value: str + """ + + value: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Usage name value.""" + localized_value: Optional[str] = rest_field( + name="localizedValue", visibility=["read", "create", "update", "delete", "query"] + ) + """Usage name localized value.""" + + @overload + def __init__( + self, + *, + value: Optional[str] = None, + localized_value: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkIsolationSettings(_Model): + """Contains the ARM resources for which to create private endpoint connection. + + :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC + file. If set, private endpoint connection will be created for the storage account. Must match + storage account used for StorageUri parameter. + :vartype storage_account_resource_id: str + :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this + request. If set, private endpoint connection will be created for the SQL server. Must match + server which is target of the operation. + :vartype sql_server_resource_id: str + """ + + storage_account_resource_id: Optional[str] = rest_field(name="storageAccountResourceId", visibility=["create"]) + """The resource id for the storage account used to store BACPAC file. If set, private endpoint + connection will be created for the storage account. Must match storage account used for + StorageUri parameter.""" + sql_server_resource_id: Optional[str] = rest_field(name="sqlServerResourceId", visibility=["create"]) + """The resource id for the SQL server which is the target of this request. If set, private + endpoint connection will be created for the SQL server. Must match server which is target of + the operation.""" + + @overload + def __init__( + self, + *, + storage_account_resource_id: Optional[str] = None, + sql_server_resource_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NetworkSecurityPerimeterConfiguration(ProxyResource): + """NSP Configuration for a server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfigurationProperties + """ + + properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "provisioning_state", + "network_security_perimeter", + "resource_association", + "profile", + "provisioning_issues", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class NetworkSecurityPerimeterConfigurationProperties(_Model): # pylint: disable=name-too-long + """The properties of an NSP config. + + :ivar provisioning_state: + :vartype provisioning_state: str + :ivar network_security_perimeter: + :vartype network_security_perimeter: ~azure.mgmt.sql.models.NSPConfigPerimeter + :ivar resource_association: + :vartype resource_association: ~azure.mgmt.sql.models.NSPConfigAssociation + :ivar profile: + :vartype profile: ~azure.mgmt.sql.models.NSPConfigProfile + :ivar provisioning_issues: + :vartype provisioning_issues: list[~azure.mgmt.sql.models.NSPProvisioningIssue] + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + network_security_perimeter: Optional["_models.NSPConfigPerimeter"] = rest_field( + name="networkSecurityPerimeter", visibility=["read", "create", "update", "delete", "query"] + ) + resource_association: Optional["_models.NSPConfigAssociation"] = rest_field( + name="resourceAssociation", visibility=["read", "create", "update", "delete", "query"] + ) + profile: Optional["_models.NSPConfigProfile"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + provisioning_issues: Optional[list["_models.NSPProvisioningIssue"]] = rest_field( + name="provisioningIssues", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + network_security_perimeter: Optional["_models.NSPConfigPerimeter"] = None, + resource_association: Optional["_models.NSPConfigAssociation"] = None, + profile: Optional["_models.NSPConfigProfile"] = None, + provisioning_issues: Optional[list["_models.NSPProvisioningIssue"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigAccessRule(_Model): + """NSPConfigAccessRule. + + :ivar name: + :vartype name: str + :ivar properties: + :vartype properties: ~azure.mgmt.sql.models.NSPConfigAccessRuleProperties + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + properties: Optional["_models.NSPConfigAccessRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.NSPConfigAccessRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigAccessRuleProperties(_Model): + """NSPConfigAccessRuleProperties. + + :ivar direction: + :vartype direction: str + :ivar address_prefixes: + :vartype address_prefixes: list[str] + :ivar fully_qualified_domain_names: + :vartype fully_qualified_domain_names: list[str] + :ivar subscriptions: + :vartype subscriptions: list[str] + :ivar network_security_perimeters: + :vartype network_security_perimeters: + list[~azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule] + :ivar service_tags: + :vartype service_tags: list[str] + """ + + direction: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + address_prefixes: Optional[list[str]] = rest_field( + name="addressPrefixes", visibility=["read", "create", "update", "delete", "query"] + ) + fully_qualified_domain_names: Optional[list[str]] = rest_field( + name="fullyQualifiedDomainNames", visibility=["read", "create", "update", "delete", "query"] + ) + subscriptions: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + network_security_perimeters: Optional[list["_models.NSPConfigNetworkSecurityPerimeterRule"]] = rest_field( + name="networkSecurityPerimeters", visibility=["read", "create", "update", "delete", "query"] + ) + service_tags: Optional[list[str]] = rest_field( + name="serviceTags", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + direction: Optional[str] = None, + address_prefixes: Optional[list[str]] = None, + fully_qualified_domain_names: Optional[list[str]] = None, + subscriptions: Optional[list[str]] = None, + network_security_perimeters: Optional[list["_models.NSPConfigNetworkSecurityPerimeterRule"]] = None, + service_tags: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigAssociation(_Model): + """NSPConfigAssociation. + + :ivar name: + :vartype name: str + :ivar access_mode: + :vartype access_mode: str + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + access_mode: Optional[str] = rest_field( + name="accessMode", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + access_mode: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigNetworkSecurityPerimeterRule(_Model): + """NSPConfigNetworkSecurityPerimeterRule. + + :ivar id: + :vartype id: str + :ivar perimeter_guid: + :vartype perimeter_guid: str + :ivar location: + :vartype location: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + perimeter_guid: Optional[str] = rest_field( + name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"] + ) + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + perimeter_guid: Optional[str] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigPerimeter(_Model): + """NSPConfigPerimeter. + + :ivar id: + :vartype id: str + :ivar perimeter_guid: + :vartype perimeter_guid: str + :ivar location: + :vartype location: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + perimeter_guid: Optional[str] = rest_field( + name="perimeterGuid", visibility=["read", "create", "update", "delete", "query"] + ) + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + perimeter_guid: Optional[str] = None, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPConfigProfile(_Model): + """NSPConfigProfile. + + :ivar name: + :vartype name: str + :ivar access_rules_version: + :vartype access_rules_version: str + :ivar access_rules: + :vartype access_rules: list[~azure.mgmt.sql.models.NSPConfigAccessRule] + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + access_rules_version: Optional[str] = rest_field( + name="accessRulesVersion", visibility=["read", "create", "update", "delete", "query"] + ) + access_rules: Optional[list["_models.NSPConfigAccessRule"]] = rest_field( + name="accessRules", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + access_rules_version: Optional[str] = None, + access_rules: Optional[list["_models.NSPConfigAccessRule"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPProvisioningIssue(_Model): + """NSPProvisioningIssue. + + :ivar name: + :vartype name: str + :ivar properties: + :vartype properties: ~azure.mgmt.sql.models.NSPProvisioningIssueProperties + """ + + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + properties: Optional["_models.NSPProvisioningIssueProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + name: Optional[str] = None, + properties: Optional["_models.NSPProvisioningIssueProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class NSPProvisioningIssueProperties(_Model): + """NSPProvisioningIssueProperties. + + :ivar issue_type: + :vartype issue_type: str + :ivar severity: + :vartype severity: str + :ivar description: + :vartype description: str + :ivar suggested_resource_ids: + :vartype suggested_resource_ids: list[str] + :ivar suggested_access_rules: + :vartype suggested_access_rules: list[str] + """ + + issue_type: Optional[str] = rest_field(name="issueType", visibility=["read", "create", "update", "delete", "query"]) + severity: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + suggested_resource_ids: Optional[list[str]] = rest_field( + name="suggestedResourceIds", visibility=["read", "create", "update", "delete", "query"] + ) + suggested_access_rules: Optional[list[str]] = rest_field( + name="suggestedAccessRules", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + issue_type: Optional[str] = None, + severity: Optional[str] = None, + description: Optional[str] = None, + suggested_resource_ids: Optional[list[str]] = None, + suggested_access_rules: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Operation(_Model): + """SQL REST API operation definition. + + :ivar name: The name of the operation being performed on this particular object. + :vartype name: str + :ivar display: The localized display information for this particular operation / action. + :vartype display: ~azure.mgmt.sql.models.OperationDisplay + :ivar origin: The intended executor of the operation. Known values are: "user" and "system". + :vartype origin: str or ~azure.mgmt.sql.models.OperationOrigin + :ivar properties: Additional descriptions for the operation. + :vartype properties: dict[str, any] + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name of the operation being performed on this particular object.""" + display: Optional["_models.OperationDisplay"] = rest_field(visibility=["read"]) + """The localized display information for this particular operation / action.""" + origin: Optional[Union[str, "_models.OperationOrigin"]] = rest_field(visibility=["read"]) + """The intended executor of the operation. Known values are: \"user\" and \"system\".""" + properties: Optional[dict[str, Any]] = rest_field(visibility=["read"]) + """Additional descriptions for the operation.""" + + +class OperationDisplay(_Model): + """Display metadata associated with the operation. + + :ivar provider: The localized friendly form of the resource provider name. + :vartype provider: str + :ivar resource: The localized friendly form of the resource type related to this + action/operation. + :vartype resource: str + :ivar operation: The localized friendly name for the operation. + :vartype operation: str + :ivar description: The localized friendly description for the operation. + :vartype description: str + """ + + provider: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource provider name.""" + resource: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly form of the resource type related to this action/operation.""" + operation: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly name for the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The localized friendly description for the operation.""" + + +class OutboundEnvironmentEndpoint(_Model): + """An endpoint that the managed instance service requires outbound network access to. + + :ivar category: The type of service accessed by the managed instance service, e.g., Azure + Storage, Azure Active Directory, etc. + :vartype category: str + :ivar endpoints: The endpoints that the managed instance service communicates with in order to + function correctly. + :vartype endpoints: list[~azure.mgmt.sql.models.EndpointDependency] + """ + + category: Optional[str] = rest_field(visibility=["read"]) + """The type of service accessed by the managed instance service, e.g., Azure Storage, Azure Active + Directory, etc.""" + endpoints: Optional[list["_models.EndpointDependency"]] = rest_field(visibility=["read"]) + """The endpoints that the managed instance service communicates with in order to function + correctly.""" + + +class OutboundFirewallRule(ProxyResource): + """An Azure SQL DB Server Outbound Firewall Rule. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.OutboundFirewallRuleProperties + """ + + properties: Optional["_models.OutboundFirewallRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["provisioning_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.OutboundFirewallRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class OutboundFirewallRuleProperties(_Model): + """The properties of an outbound firewall rule. + + :ivar provisioning_state: The state of the outbound rule. + :vartype provisioning_state: str + """ + + provisioning_state: Optional[str] = rest_field(name="provisioningState", visibility=["read"]) + """The state of the outbound rule.""" + + +class PartnerInfo(_Model): + """Partner server information for the failover group. + + :ivar id: Resource identifier of the partner server. Required. + :vartype id: str + :ivar location: Geo location of the partner server. + :vartype location: str + :ivar replication_role: Replication role of the partner server. Known values are: "Primary" and + "Secondary". + :vartype replication_role: str or ~azure.mgmt.sql.models.FailoverGroupReplicationRole + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource identifier of the partner server. Required.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Geo location of the partner server.""" + replication_role: Optional[Union[str, "_models.FailoverGroupReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """Replication role of the partner server. Known values are: \"Primary\" and \"Secondary\".""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PartnerRegionInfo(_Model): + """Partner region information for the failover group. + + :ivar location: Geo location of the partner managed instances. + :vartype location: str + :ivar replication_role: Replication role of the partner managed instances. Known values are: + "Primary" and "Secondary". + :vartype replication_role: str or ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + """ + + location: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Geo location of the partner managed instances.""" + replication_role: Optional[Union[str, "_models.InstanceFailoverGroupReplicationRole"]] = rest_field( + name="replicationRole", visibility=["read"] + ) + """Replication role of the partner managed instances. Known values are: \"Primary\" and + \"Secondary\".""" + + @overload + def __init__( + self, + *, + location: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PerDatabaseAutoPauseDelayTimeRange(_Model): + """Supported auto pause delay time range. + + :ivar min_value: Minimum value. + :vartype min_value: int + :ivar max_value: Maximum value. + :vartype max_value: int + :ivar step_size: Step value for discrete values between the minimum value and the maximum + value. + :vartype step_size: int + :ivar default: Default value if no value is provided. + :vartype default: int + :ivar unit: Unit of time that delay is expressed in. "Minutes" + :vartype unit: str or ~azure.mgmt.sql.models.PauseDelayTimeUnit + :ivar do_not_pause_value: Value that is used to not pause (infinite delay before pause). + :vartype do_not_pause_value: int + """ + + min_value: Optional[int] = rest_field(name="minValue", visibility=["read"]) + """Minimum value.""" + max_value: Optional[int] = rest_field(name="maxValue", visibility=["read"]) + """Maximum value.""" + step_size: Optional[int] = rest_field(name="stepSize", visibility=["read"]) + """Step value for discrete values between the minimum value and the maximum value.""" + default: Optional[int] = rest_field(visibility=["read"]) + """Default value if no value is provided.""" + unit: Optional[Union[str, "_models.PauseDelayTimeUnit"]] = rest_field(visibility=["read"]) + """Unit of time that delay is expressed in. \"Minutes\"""" + do_not_pause_value: Optional[int] = rest_field(name="doNotPauseValue", visibility=["read"]) + """Value that is used to not pause (infinite delay before pause).""" + + +class PerformanceLevelCapability(_Model): + """The performance level capability. + + :ivar value: Performance level value. + :vartype value: float + :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". + :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit + """ + + value: Optional[float] = rest_field(visibility=["read"]) + """Performance level value.""" + unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = rest_field(visibility=["read"]) + """Unit type used to measure performance level. Known values are: \"DTU\" and \"VCores\".""" + + +class PhaseDetails(_Model): + """The phase details properties of a database operation. + + :ivar phase: The operation phase. Known values are: "LogTransitionInProgress", "Copying", + "BuildingHyperscaleComponents", "Catchup", "WaitingForCutover", and "CutoverInProgress". + :vartype phase: str or ~azure.mgmt.sql.models.Phase + :ivar phase_information: The operation phase information. + :vartype phase_information: dict[str, str] + """ + + phase: Optional[Union[str, "_models.Phase"]] = rest_field(visibility=["read"]) + """The operation phase. Known values are: \"LogTransitionInProgress\", \"Copying\", + \"BuildingHyperscaleComponents\", \"Catchup\", \"WaitingForCutover\", and + \"CutoverInProgress\".""" + phase_information: Optional[dict[str, str]] = rest_field(name="phaseInformation", visibility=["read"]) + """The operation phase information.""" + + +class PrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.PrivateEndpointConnectionProperties + """ + + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["private_endpoint", "group_ids", "private_link_service_connection_state", "provisioning_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.PrivateEndpointConnectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class PrivateEndpointConnectionProperties(_Model): + """Properties of a private endpoint connection. + + :ivar private_endpoint: Private endpoint which the connection belongs to. + :vartype private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty + :ivar group_ids: Group IDs. + :vartype group_ids: list[str] + :ivar private_link_service_connection_state: Connection state of the private endpoint + connection. + :vartype private_link_service_connection_state: + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the private endpoint connection. Known values are: + "Approving", "Ready", "Dropping", "Failed", and "Rejecting". + :vartype provisioning_state: str or ~azure.mgmt.sql.models.PrivateEndpointProvisioningState + """ + + private_endpoint: Optional["_models.PrivateEndpointProperty"] = rest_field( + name="privateEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Private endpoint which the connection belongs to.""" + group_ids: Optional[list[str]] = rest_field(name="groupIds", visibility=["read"]) + """Group IDs.""" + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = rest_field( + name="privateLinkServiceConnectionState", visibility=["read", "create", "update", "delete", "query"] + ) + """Connection state of the private endpoint connection.""" + provisioning_state: Optional[Union[str, "_models.PrivateEndpointProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """State of the private endpoint connection. Known values are: \"Approving\", \"Ready\", + \"Dropping\", \"Failed\", and \"Rejecting\".""" + + @overload + def __init__( + self, + *, + private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, + private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateEndpointConnectionRequestStatus(_Model): + """Contains the private endpoint connection requests status. + + :ivar private_link_service_id: Resource id for which the private endpoint is created. + :vartype private_link_service_id: str + :ivar private_endpoint_connection_name: The connection name for the private endpoint. + :vartype private_endpoint_connection_name: str + :ivar status: Status of this private endpoint connection. + :vartype status: str + """ + + private_link_service_id: Optional[str] = rest_field(name="privateLinkServiceId", visibility=["read"]) + """Resource id for which the private endpoint is created.""" + private_endpoint_connection_name: Optional[str] = rest_field( + name="privateEndpointConnectionName", visibility=["read"] + ) + """The connection name for the private endpoint.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Status of this private endpoint connection.""" + + +class PrivateEndpointProperty(_Model): + """PrivateEndpointProperty. + + :ivar id: Resource id of the private endpoint. + :vartype id: str + """ + + id: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource id of the private endpoint.""" + + @overload + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class PrivateLinkResource(ProxyResource): + """A private link resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: The private link resource group id. + :vartype properties: ~azure.mgmt.sql.models.PrivateLinkResourceProperties + """ + + properties: Optional["_models.PrivateLinkResourceProperties"] = rest_field(visibility=["read"]) + """The private link resource group id.""" + + +class PrivateLinkResourceProperties(_Model): + """Properties of a private link resource. + + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] + """ + + group_id: Optional[str] = rest_field(name="groupId", visibility=["read"]) + """The private link resource group id.""" + required_members: Optional[list[str]] = rest_field(name="requiredMembers", visibility=["read"]) + """The private link resource required member names.""" + required_zone_names: Optional[list[str]] = rest_field(name="requiredZoneNames", visibility=["read"]) + """The private link resource required zone names.""" + + +class PrivateLinkServiceConnectionStateProperty(_Model): # pylint: disable=name-too-long + """PrivateLinkServiceConnectionStateProperty. + + :ivar status: The private link service connection status. Required. Known values are: + "Approved", "Pending", "Rejected", and "Disconnected". + :vartype status: str or ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus + :ivar description: The private link service connection description. Required. + :vartype description: str + :ivar actions_required: The actions required for private link service connection. "None" + :vartype actions_required: str or + ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire + """ + + status: Union[str, "_models.PrivateLinkServiceConnectionStateStatus"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The private link service connection status. Required. Known values are: \"Approved\", + \"Pending\", \"Rejected\", and \"Disconnected\".""" + description: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The private link service connection description. Required.""" + actions_required: Optional[Union[str, "_models.PrivateLinkServiceConnectionStateActionsRequire"]] = rest_field( + name="actionsRequired", visibility=["read"] + ) + """The actions required for private link service connection. \"None\"""" + + @overload + def __init__( + self, + *, + status: Union[str, "_models.PrivateLinkServiceConnectionStateStatus"], + description: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QueryCheck(_Model): + """SQL Vulnerability Assessment query check object. + + :ivar query: SQL Vulnerability Assessment rule query. + :vartype query: str + :ivar expected_result: SQL Vulnerability Assessment query expected result. + :vartype expected_result: list[list[str]] + :ivar column_names: SQL Vulnerability Assessment column names of query expected result. + :vartype column_names: list[str] + """ + + query: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule query.""" + expected_result: Optional[list[list[str]]] = rest_field(name="expectedResult", visibility=["read"]) + """SQL Vulnerability Assessment query expected result.""" + column_names: Optional[list[str]] = rest_field(name="columnNames", visibility=["read"]) + """SQL Vulnerability Assessment column names of query expected result.""" + + +class QueryMetricInterval(_Model): + """Properties of a query metrics interval. + + :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] + """ + + interval_start_time: Optional[str] = rest_field(name="intervalStartTime", visibility=["read"]) + """The start time for the metric interval (ISO-8601 format).""" + interval_type: Optional[Union[str, "_models.QueryTimeGrainType"]] = rest_field( + name="intervalType", visibility=["read"] + ) + """Interval type (length). Known values are: \"PT1H\" and \"P1D\".""" + execution_count: Optional[int] = rest_field(name="executionCount", visibility=["read"]) + """Execution count of a query in this interval.""" + metrics: Optional[list["_models.QueryMetricProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of metric objects for this interval.""" + + @overload + def __init__( + self, + *, + metrics: Optional[list["_models.QueryMetricProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QueryMetricProperties(_Model): + """Properties of a topquery metric in one interval. + + :ivar name: The name information for the metric. + :vartype name: str + :ivar display_name: The UI appropriate name for the metric. + :vartype display_name: str + :ivar unit: The unit of the metric. Known values are: "percentage", "KB", "microseconds", and + "count". + :vartype unit: str or ~azure.mgmt.sql.models.QueryMetricUnitType + :ivar value: The value of the metric. + :vartype value: float + :ivar min: Metric value when min() aggregate function is used over the interval. + :vartype min: float + :ivar max: Metric value when max() aggregate function is used over the interval. + :vartype max: float + :ivar avg: Metric value when avg() aggregate function is used over the interval. + :vartype avg: float + :ivar sum: Metric value when sum() aggregate function is used over the interval. + :vartype sum: float + :ivar stdev: Metric value when stdev aggregate function is used over the interval. + :vartype stdev: float + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The name information for the metric.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """The UI appropriate name for the metric.""" + unit: Optional[Union[str, "_models.QueryMetricUnitType"]] = rest_field(visibility=["read"]) + """The unit of the metric. Known values are: \"percentage\", \"KB\", \"microseconds\", and + \"count\".""" + value: Optional[float] = rest_field(visibility=["read"]) + """The value of the metric.""" + min: Optional[float] = rest_field(visibility=["read"]) + """Metric value when min() aggregate function is used over the interval.""" + max: Optional[float] = rest_field(visibility=["read"]) + """Metric value when max() aggregate function is used over the interval.""" + avg: Optional[float] = rest_field(visibility=["read"]) + """Metric value when avg() aggregate function is used over the interval.""" + sum: Optional[float] = rest_field(visibility=["read"]) + """Metric value when sum() aggregate function is used over the interval.""" + stdev: Optional[float] = rest_field(visibility=["read"]) + """Metric value when stdev aggregate function is used over the interval.""" + + +class QueryProperties(_Model): + """Properties of a database query. + + :ivar query_text: Query text. + :vartype query_text: str + """ + + query_text: Optional[str] = rest_field(name="queryText", visibility=["read", "create", "update", "delete", "query"]) + """Query text.""" + + @overload + def __init__( + self, + *, + query_text: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class QueryStatistics(ProxyResourceAutoGenerated): + """QueryStatistics. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.QueryStatisticsProperties + """ + + properties: Optional["_models.QueryStatisticsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["database_name", "query_id", "start_time", "end_time", "intervals"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.QueryStatisticsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class QueryStatisticsProperties(_Model): + """Properties of a query execution statistics. + + :ivar database_name: Database name of the database in which this query was executed. + :vartype database_name: str + :ivar query_id: Unique query id (unique within one database). + :vartype query_id: str + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: str + :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.QueryMetricInterval] + """ + + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """Database name of the database in which this query was executed.""" + query_id: Optional[str] = rest_field(name="queryId", visibility=["read"]) + """Unique query id (unique within one database).""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read"]) + """The start time for the metric (ISO-8601 format).""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read"]) + """The end time for the metric (ISO-8601 format).""" + intervals: Optional[list["_models.QueryMetricInterval"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of intervals with appropriate metric data.""" + + @overload + def __init__( + self, + *, + intervals: Optional[list["_models.QueryMetricInterval"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReadScaleCapability(_Model): + """The read scale capability. + + :ivar max_number_of_replicas: The maximum number of read scale replicas. + :vartype max_number_of_replicas: int + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + max_number_of_replicas: Optional[int] = rest_field(name="maxNumberOfReplicas", visibility=["read"]) + """The maximum number of read scale replicas.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecommendedAction(ProxyResource): + """Database, Server or Elastic Pool Recommended Action. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RecommendedActionProperties + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.RecommendedActionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Resource kind.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "recommendation_reason", + "valid_since", + "last_refresh", + "state", + "is_executable_action", + "is_revertable_action", + "is_archived_action", + "execute_action_start_time", + "execute_action_duration", + "revert_action_start_time", + "revert_action_duration", + "execute_action_initiated_by", + "execute_action_initiated_time", + "revert_action_initiated_by", + "revert_action_initiated_time", + "score", + "implementation_details", + "error_details", + "estimated_impact", + "observed_impact", + "time_series", + "linked_objects", + "details", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RecommendedActionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RecommendedActionErrorInfo(_Model): + """Contains error information for an Azure SQL Database, Server or Elastic Pool Recommended + Action. + + :ivar error_code: Gets the reason why the recommended action was put to error state. e.g., + DatabaseHasQdsOff, IndexAlreadyExists. + :vartype error_code: str + :ivar is_retryable: Gets whether the error could be ignored and recommended action could be + retried. Possible values are: Yes/No. Known values are: "Yes" and "No". + :vartype is_retryable: str or ~azure.mgmt.sql.models.IsRetryable + """ + + error_code: Optional[str] = rest_field(name="errorCode", visibility=["read"]) + """Gets the reason why the recommended action was put to error state. e.g., DatabaseHasQdsOff, + IndexAlreadyExists.""" + is_retryable: Optional[Union[str, "_models.IsRetryable"]] = rest_field(name="isRetryable", visibility=["read"]) + """Gets whether the error could be ignored and recommended action could be retried. Possible + values are: Yes/No. Known values are: \"Yes\" and \"No\".""" + + +class RecommendedActionImpactRecord(_Model): + """Contains information of estimated or observed impact on various metrics for an Azure SQL + Database, Server or Elastic Pool Recommended Action. + + :ivar dimension_name: Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, + NumberOfQueriesAffected. + :vartype dimension_name: str + :ivar unit: Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, + NumberOfQueriesAffected. + :vartype unit: str + :ivar absolute_value: Gets the absolute value of this dimension if applicable. e.g., Number of + Queries affected. + :vartype absolute_value: float + :ivar change_value_absolute: Gets the absolute change in the value of this dimension. e.g., + Absolute Disk space change in Megabytes. + :vartype change_value_absolute: float + :ivar change_value_relative: Gets the relative change in the value of this dimension. e.g., + Relative Disk space change in Percentage. + :vartype change_value_relative: float + """ + + dimension_name: Optional[str] = rest_field(name="dimensionName", visibility=["read"]) + """Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, + NumberOfQueriesAffected.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, + NumberOfQueriesAffected.""" + absolute_value: Optional[float] = rest_field(name="absoluteValue", visibility=["read"]) + """Gets the absolute value of this dimension if applicable. e.g., Number of Queries affected.""" + change_value_absolute: Optional[float] = rest_field(name="changeValueAbsolute", visibility=["read"]) + """Gets the absolute change in the value of this dimension. e.g., Absolute Disk space change in + Megabytes.""" + change_value_relative: Optional[float] = rest_field(name="changeValueRelative", visibility=["read"]) + """Gets the relative change in the value of this dimension. e.g., Relative Disk space change in + Percentage.""" + + +class RecommendedActionImplementationInfo(_Model): + """Contains information for manual implementation for an Azure SQL Database, Server or Elastic + Pool Recommended Action. + + :ivar method: Gets the method in which this recommended action can be manually implemented. + e.g., TSql, AzurePowerShell. Known values are: "TSql" and "AzurePowerShell". + :vartype method: str or ~azure.mgmt.sql.models.ImplementationMethod + :ivar script: Gets the manual implementation script. e.g., T-SQL script that could be executed + on the database. + :vartype script: str + """ + + method: Optional[Union[str, "_models.ImplementationMethod"]] = rest_field(visibility=["read"]) + """Gets the method in which this recommended action can be manually implemented. e.g., TSql, + AzurePowerShell. Known values are: \"TSql\" and \"AzurePowerShell\".""" + script: Optional[str] = rest_field(visibility=["read"]) + """Gets the manual implementation script. e.g., T-SQL script that could be executed on the + database.""" + + +class RecommendedActionMetricInfo(_Model): + """Contains time series of various impacted metrics for an Azure SQL Database, Server or Elastic + Pool Recommended Action. + + :ivar metric_name: Gets the name of the metric. e.g., CPU, Number of Queries. + :vartype metric_name: str + :ivar unit: Gets the unit in which metric is measured. e.g., DTU, Frequency. + :vartype unit: str + :ivar time_grain: Gets the duration of time interval for the value given by this MetricInfo. + e.g., PT1H (1 hour). + :vartype time_grain: str + :ivar start_time: Gets the start time of time interval given by this MetricInfo. + :vartype start_time: ~datetime.datetime + :ivar value: Gets the value of the metric in the time interval given by this MetricInfo. + :vartype value: float + """ + + metric_name: Optional[str] = rest_field(name="metricName", visibility=["read"]) + """Gets the name of the metric. e.g., CPU, Number of Queries.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Gets the unit in which metric is measured. e.g., DTU, Frequency.""" + time_grain: Optional[str] = rest_field(name="timeGrain", visibility=["read"]) + """Gets the duration of time interval for the value given by this MetricInfo. e.g., PT1H (1 hour).""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Gets the start time of time interval given by this MetricInfo.""" + value: Optional[float] = rest_field(visibility=["read"]) + """Gets the value of the metric in the time interval given by this MetricInfo.""" + + +class RecommendedActionProperties(_Model): + """Properties for a Database, Server or Elastic Pool Recommended Action. + + :ivar recommendation_reason: Gets the reason for recommending this action. e.g., + DuplicateIndex. + :vartype recommendation_reason: str + :ivar valid_since: Gets the time since when this recommended action is valid. + :vartype valid_since: ~datetime.datetime + :ivar last_refresh: Gets time when this recommended action was last refreshed. + :vartype last_refresh: ~datetime.datetime + :ivar state: Gets the info of the current state the recommended action is in. Required. + :vartype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo + :ivar is_executable_action: Gets if this recommended action is actionable by user. + :vartype is_executable_action: bool + :ivar is_revertable_action: Gets if changes applied by this recommended action can be reverted + by user. + :vartype is_revertable_action: bool + :ivar is_archived_action: Gets if this recommended action was suggested some time ago but user + chose to ignore this and system added a new recommended action again. + :vartype is_archived_action: bool + :ivar execute_action_start_time: Gets the time when system started applying this recommended + action on the user resource. e.g., index creation start time. + :vartype execute_action_start_time: ~datetime.datetime + :ivar execute_action_duration: Gets the time taken for applying this recommended action on user + resource. e.g., time taken for index creation. + :vartype execute_action_duration: ~datetime.timedelta + :ivar revert_action_start_time: Gets the time when system started reverting changes of this + recommended action on user resource. e.g., time when index drop is executed. + :vartype revert_action_start_time: ~datetime.datetime + :ivar revert_action_duration: Gets the time taken for reverting changes of this recommended + action on user resource. e.g., time taken for dropping the created index. + :vartype revert_action_duration: ~datetime.timedelta + :ivar execute_action_initiated_by: Gets if approval for applying this recommended action was + given by user/system. Known values are: "User" and "System". + :vartype execute_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar execute_action_initiated_time: Gets the time when this recommended action was approved + for execution. + :vartype execute_action_initiated_time: ~datetime.datetime + :ivar revert_action_initiated_by: Gets if approval for reverting this recommended action was + given by user/system. Known values are: "User" and "System". + :vartype revert_action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar revert_action_initiated_time: Gets the time when this recommended action was approved for + revert. + :vartype revert_action_initiated_time: ~datetime.datetime + :ivar score: Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 + - Medium Impact and 3 - High Impact. + :vartype score: int + :ivar implementation_details: Gets the implementation details of this recommended action for + user to apply it manually. + :vartype implementation_details: ~azure.mgmt.sql.models.RecommendedActionImplementationInfo + :ivar error_details: Gets the error details if and why this recommended action is put to error + state. + :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo + :ivar estimated_impact: Gets the estimated impact info for this recommended action e.g., + Estimated CPU gain, Estimated Disk Space change. + :vartype estimated_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar observed_impact: Gets the observed/actual impact info for this recommended action e.g., + Actual CPU gain, Actual Disk Space change. + :vartype observed_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar time_series: Gets the time series info of metrics for this recommended action e.g., CPU + consumption time series. + :vartype time_series: list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] + :ivar linked_objects: Gets the linked objects, if any. + :vartype linked_objects: list[str] + :ivar details: Gets additional details specific to this recommended action. + :vartype details: dict[str, str] + """ + + recommendation_reason: Optional[str] = rest_field(name="recommendationReason", visibility=["read"]) + """Gets the reason for recommending this action. e.g., DuplicateIndex.""" + valid_since: Optional[datetime.datetime] = rest_field(name="validSince", visibility=["read"], format="rfc3339") + """Gets the time since when this recommended action is valid.""" + last_refresh: Optional[datetime.datetime] = rest_field(name="lastRefresh", visibility=["read"], format="rfc3339") + """Gets time when this recommended action was last refreshed.""" + state: "_models.RecommendedActionStateInfo" = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Gets the info of the current state the recommended action is in. Required.""" + is_executable_action: Optional[bool] = rest_field(name="isExecutableAction", visibility=["read"]) + """Gets if this recommended action is actionable by user.""" + is_revertable_action: Optional[bool] = rest_field(name="isRevertableAction", visibility=["read"]) + """Gets if changes applied by this recommended action can be reverted by user.""" + is_archived_action: Optional[bool] = rest_field(name="isArchivedAction", visibility=["read"]) + """Gets if this recommended action was suggested some time ago but user chose to ignore this and + system added a new recommended action again.""" + execute_action_start_time: Optional[datetime.datetime] = rest_field( + name="executeActionStartTime", visibility=["read"], format="rfc3339" + ) + """Gets the time when system started applying this recommended action on the user resource. e.g., + index creation start time.""" + execute_action_duration: Optional[datetime.timedelta] = rest_field( + name="executeActionDuration", visibility=["read"] + ) + """Gets the time taken for applying this recommended action on user resource. e.g., time taken for + index creation.""" + revert_action_start_time: Optional[datetime.datetime] = rest_field( + name="revertActionStartTime", visibility=["read"], format="rfc3339" + ) + """Gets the time when system started reverting changes of this recommended action on user + resource. e.g., time when index drop is executed.""" + revert_action_duration: Optional[datetime.timedelta] = rest_field(name="revertActionDuration", visibility=["read"]) + """Gets the time taken for reverting changes of this recommended action on user resource. e.g., + time taken for dropping the created index.""" + execute_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = rest_field( + name="executeActionInitiatedBy", visibility=["read"] + ) + """Gets if approval for applying this recommended action was given by user/system. Known values + are: \"User\" and \"System\".""" + execute_action_initiated_time: Optional[datetime.datetime] = rest_field( + name="executeActionInitiatedTime", visibility=["read"], format="rfc3339" + ) + """Gets the time when this recommended action was approved for execution.""" + revert_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = rest_field( + name="revertActionInitiatedBy", visibility=["read"] + ) + """Gets if approval for reverting this recommended action was given by user/system. Known values + are: \"User\" and \"System\".""" + revert_action_initiated_time: Optional[datetime.datetime] = rest_field( + name="revertActionInitiatedTime", visibility=["read"], format="rfc3339" + ) + """Gets the time when this recommended action was approved for revert.""" + score: Optional[int] = rest_field(visibility=["read"]) + """Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - Medium + Impact and 3 - High Impact.""" + implementation_details: Optional["_models.RecommendedActionImplementationInfo"] = rest_field( + name="implementationDetails", visibility=["read"] + ) + """Gets the implementation details of this recommended action for user to apply it manually.""" + error_details: Optional["_models.RecommendedActionErrorInfo"] = rest_field(name="errorDetails", visibility=["read"]) + """Gets the error details if and why this recommended action is put to error state.""" + estimated_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = rest_field( + name="estimatedImpact", visibility=["read"] + ) + """Gets the estimated impact info for this recommended action e.g., Estimated CPU gain, Estimated + Disk Space change.""" + observed_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = rest_field( + name="observedImpact", visibility=["read"] + ) + """Gets the observed/actual impact info for this recommended action e.g., Actual CPU gain, Actual + Disk Space change.""" + time_series: Optional[list["_models.RecommendedActionMetricInfo"]] = rest_field( + name="timeSeries", visibility=["read"] + ) + """Gets the time series info of metrics for this recommended action e.g., CPU consumption time + series.""" + linked_objects: Optional[list[str]] = rest_field(name="linkedObjects", visibility=["read"]) + """Gets the linked objects, if any.""" + details: Optional[dict[str, str]] = rest_field(visibility=["read"]) + """Gets additional details specific to this recommended action.""" + + @overload + def __init__( + self, + *, + state: "_models.RecommendedActionStateInfo", + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecommendedActionStateInfo(_Model): + """Contains information of current state for an Azure SQL Database, Server or Elastic Pool + Recommended Action. + + :ivar current_value: Current state the recommended action is in. Some commonly used states are: + Active -> recommended action is active and no action has been taken yet. Pending -> + recommended action is approved for and is awaiting execution. Executing -> recommended action + is being applied on the user database. Verifying -> recommended action was applied and is + being verified of its usefulness by the system. Success -> recommended action was applied + and improvement found during verification. Pending Revert -> verification found little or no + improvement so recommended action is queued for revert or user has manually reverted. Reverting + -> changes made while applying recommended action are being reverted on the user database. + Reverted -> successfully reverted the changes made by recommended action on user database. + Ignored -> user explicitly ignored/discarded the recommended action. Required. Known values + are: "Active", "Pending", "Executing", "Verifying", "PendingRevert", "RevertCancelled", + "Reverting", "Reverted", "Ignored", "Expired", "Monitoring", "Resolved", "Success", and + "Error". + :vartype current_value: str or ~azure.mgmt.sql.models.RecommendedActionCurrentState + :ivar action_initiated_by: Gets who initiated the execution of this recommended action. + Possible Value are: User -> When user explicity notified system to apply the recommended + action. System -> When auto-execute status of this advisor was set to 'Enabled', in which case + the system applied it. Known values are: "User" and "System". + :vartype action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar last_modified: Gets the time when the state was last modified. + :vartype last_modified: ~datetime.datetime + """ + + current_value: Union[str, "_models.RecommendedActionCurrentState"] = rest_field( + name="currentValue", visibility=["read", "create", "update", "delete", "query"] + ) + """Current state the recommended action is in. Some commonly used states are: Active -> + recommended action is active and no action has been taken yet. Pending -> recommended + action is approved for and is awaiting execution. Executing -> recommended action is being + applied on the user database. Verifying -> recommended action was applied and is being + verified of its usefulness by the system. Success -> recommended action was applied and + improvement found during verification. Pending Revert -> verification found little or no + improvement so recommended action is queued for revert or user has manually reverted. Reverting + -> changes made while applying recommended action are being reverted on the user database. + Reverted -> successfully reverted the changes made by recommended action on user database. + Ignored -> user explicitly ignored/discarded the recommended action. Required. Known values + are: \"Active\", \"Pending\", \"Executing\", \"Verifying\", \"PendingRevert\", + \"RevertCancelled\", \"Reverting\", \"Reverted\", \"Ignored\", \"Expired\", \"Monitoring\", + \"Resolved\", \"Success\", and \"Error\".""" + action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = rest_field( + name="actionInitiatedBy", visibility=["read"] + ) + """Gets who initiated the execution of this recommended action. Possible Value are: User -> + When user explicity notified system to apply the recommended action. System -> When + auto-execute status of this advisor was set to 'Enabled', in which case the system applied it. + Known values are: \"User\" and \"System\".""" + last_modified: Optional[datetime.datetime] = rest_field(name="lastModified", visibility=["read"], format="rfc3339") + """Gets the time when the state was last modified.""" + + @overload + def __init__( + self, + *, + current_value: Union[str, "_models.RecommendedActionCurrentState"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecommendedSensitivityLabelUpdate(ProxyResourceAutoGenerated): + """A recommended sensitivity label update operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateProperties + """ + + properties: Optional["_models.RecommendedSensitivityLabelUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["op", "schema", "table", "column"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RecommendedSensitivityLabelUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RecommendedSensitivityLabelUpdateList(_Model): + """A list of recommended sensitivity label update operations. + + :ivar operations: + :vartype operations: list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] + """ + + operations: Optional[list["_models.RecommendedSensitivityLabelUpdate"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + operations: Optional[list["_models.RecommendedSensitivityLabelUpdate"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecommendedSensitivityLabelUpdateProperties(_Model): # pylint: disable=name-too-long + """Properties of an operation executed on a recommended sensitivity label. + + :ivar op: Required. Known values are: "enable" and "disable". + :vartype op: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind + :ivar schema: Schema name of the column to update. Required. + :vartype schema: str + :ivar table: Table name of the column to update. Required. + :vartype table: str + :ivar column: Column name to update. Required. + :vartype column: str + """ + + op: Union[str, "_models.RecommendedSensitivityLabelUpdateKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"enable\" and \"disable\".""" + schema: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schema name of the column to update. Required.""" + table: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Table name of the column to update. Required.""" + column: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Column name to update. Required.""" + + @overload + def __init__( + self, + *, + op: Union[str, "_models.RecommendedSensitivityLabelUpdateKind"], + schema: str, + table: str, + column: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecoverableDatabase(ProxyResource): + """A recoverable database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RecoverableDatabaseProperties + """ + + properties: Optional["_models.RecoverableDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "edition", + "service_level_objective", + "elastic_pool_name", + "last_available_backup_date", + "keys_property", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RecoverableDatabaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RecoverableDatabaseProperties(_Model): + """The recoverable database's properties. + + :ivar edition: The edition of the database. + :vartype edition: str + :ivar service_level_objective: The service level objective name of the database. + :vartype service_level_objective: str + :ivar elastic_pool_name: The elastic pool name of the database. + :vartype elastic_pool_name: str + :ivar last_available_backup_date: The last available backup date. + :vartype last_available_backup_date: ~datetime.datetime + :ivar keys_property: The resource ids of the user assigned identities to use. + :vartype keys_property: dict[str, ~azure.mgmt.sql.models.DatabaseKey] + """ + + edition: Optional[str] = rest_field(visibility=["read"]) + """The edition of the database.""" + service_level_objective: Optional[str] = rest_field(name="serviceLevelObjective", visibility=["read"]) + """The service level objective name of the database.""" + elastic_pool_name: Optional[str] = rest_field(name="elasticPoolName", visibility=["read"]) + """The elastic pool name of the database.""" + last_available_backup_date: Optional[datetime.datetime] = rest_field( + name="lastAvailableBackupDate", visibility=["read"], format="rfc3339" + ) + """The last available backup date.""" + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """The resource ids of the user assigned identities to use.""" + + @overload + def __init__( + self, + *, + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RecoverableManagedDatabase(ProxyResource): + """A recoverable managed database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RecoverableManagedDatabaseProperties + """ + + properties: Optional["_models.RecoverableManagedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["last_available_backup_date"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RecoverableManagedDatabaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RecoverableManagedDatabaseProperties(_Model): + """The recoverable managed database's properties. + + :ivar last_available_backup_date: The last available backup date. + :vartype last_available_backup_date: str + """ + + last_available_backup_date: Optional[str] = rest_field(name="lastAvailableBackupDate", visibility=["read"]) + """The last available backup date.""" + + +class RefreshExternalGovernanceStatusOperationResult(ProxyResourceAutoGenerated): # pylint: disable=name-too-long + """An RefreshExternalGovernanceStatus operation result resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultProperties + """ + + properties: Optional["_models.RefreshExternalGovernanceStatusOperationResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["request_id", "request_type", "queued_time", "server_name", "status", "error_message"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RefreshExternalGovernanceStatusOperationResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RefreshExternalGovernanceStatusOperationResultMI(ProxyResourceAutoGenerated): # pylint: disable=name-too-long + """An RefreshExternalGovernanceStatus operation result resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: + ~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultPropertiesMI + """ + + properties: Optional["_models.RefreshExternalGovernanceStatusOperationResultPropertiesMI"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "request_id", + "request_type", + "queued_time", + "managed_instance_name", + "status", + "error_message", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RefreshExternalGovernanceStatusOperationResultPropertiesMI"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RefreshExternalGovernanceStatusOperationResultProperties(_Model): # pylint: disable=name-too-long + """Contains the operation result properties for refresh external governance status operation. + + :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 server_name: Server name. + :vartype server_name: str + :ivar status: Operation status. + :vartype status: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + request_id: Optional[str] = rest_field(name="requestId", visibility=["read"]) + """Request Id.""" + request_type: Optional[str] = rest_field(name="requestType", visibility=["read"]) + """Request type.""" + queued_time: Optional[str] = rest_field(name="queuedTime", visibility=["read"]) + """Queued time.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """Server name.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Operation status.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """Error message.""" + + +class RefreshExternalGovernanceStatusOperationResultPropertiesMI(_Model): # pylint: disable=name-too-long + """Contains the operation result properties for refresh external governance status operation. + + :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 + """ + + request_id: Optional[str] = rest_field(name="requestId", visibility=["read"]) + """Request Id.""" + request_type: Optional[str] = rest_field(name="requestType", visibility=["read"]) + """Request type.""" + queued_time: Optional[str] = rest_field(name="queuedTime", visibility=["read"]) + """Queued time.""" + managed_instance_name: Optional[str] = rest_field(name="managedInstanceName", visibility=["read"]) + """Managed instance name.""" + status: Optional[str] = rest_field(visibility=["read"]) + """Operation status.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """Error message.""" + + +class Remediation(_Model): + """SQL Vulnerability Assessment remediation Details. + + :ivar description: SQL Vulnerability Assessment remediation description. + :vartype description: str + :ivar scripts: SQL Vulnerability Assessment remediation script. + :vartype scripts: list[str] + :ivar automated: SQL Vulnerability Assessment is remediation automated. + :vartype automated: bool + :ivar portal_link: SQL Vulnerability Assessment optional link to remediate in Azure Portal. + :vartype portal_link: str + """ + + description: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment remediation description.""" + scripts: Optional[list[str]] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment remediation script.""" + automated: Optional[bool] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment is remediation automated.""" + portal_link: Optional[str] = rest_field(name="portalLink", visibility=["read"]) + """SQL Vulnerability Assessment optional link to remediate in Azure Portal.""" + + +class ReplicationLink(ProxyResource): + """A replication link. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ReplicationLinkProperties + """ + + properties: Optional["_models.ReplicationLinkProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "partner_server", + "partner_database", + "partner_database_id", + "partner_location", + "role", + "partner_role", + "replication_mode", + "start_time", + "percent_complete", + "replication_state", + "is_termination_allowed", + "link_type", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ReplicationLinkProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ReplicationLinkProperties(_Model): + """Properties of a replication link. + + :ivar partner_server: Resource partner server. + :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", + "NonReadableSecondary", "Source", and "Copy". + :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole + :ivar partner_role: Partner replication role. Known values are: "Primary", "Secondary", + "NonReadableSecondary", "Source", and "Copy". + :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole + :ivar replication_mode: Replication mode. + :vartype replication_mode: str + :ivar start_time: Time at which the link was created. + :vartype start_time: ~datetime.datetime + :ivar percent_complete: Seeding completion percentage for the link. + :vartype percent_complete: int + :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values + are: "PENDING", "SEEDING", "CATCH_UP", and "SUSPENDED". + :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). Update operation does not support NAMED. + Known values are: "GEO", "NAMED", and "STANDBY". + :vartype link_type: str or ~azure.mgmt.sql.models.ReplicationLinkType + """ + + partner_server: Optional[str] = rest_field(name="partnerServer", visibility=["read"]) + """Resource partner server.""" + partner_database: Optional[str] = rest_field(name="partnerDatabase", visibility=["read"]) + """Resource partner database.""" + partner_database_id: Optional[str] = rest_field(name="partnerDatabaseId", visibility=["read"]) + """Resource partner database Id.""" + partner_location: Optional[str] = rest_field(name="partnerLocation", visibility=["read"]) + """Resource partner location.""" + role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field(visibility=["read"]) + """Local replication role. Known values are: \"Primary\", \"Secondary\", \"NonReadableSecondary\", + \"Source\", and \"Copy\".""" + partner_role: Optional[Union[str, "_models.ReplicationRole"]] = rest_field(name="partnerRole", visibility=["read"]) + """Partner replication role. Known values are: \"Primary\", \"Secondary\", + \"NonReadableSecondary\", \"Source\", and \"Copy\".""" + replication_mode: Optional[str] = rest_field(name="replicationMode", visibility=["read"]) + """Replication mode.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """Time at which the link was created.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """Seeding completion percentage for the link.""" + replication_state: Optional[Union[str, "_models.ReplicationState"]] = rest_field( + name="replicationState", visibility=["read"] + ) + """Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values are: \"PENDING\", + \"SEEDING\", \"CATCH_UP\", and \"SUSPENDED\".""" + is_termination_allowed: Optional[bool] = rest_field(name="isTerminationAllowed", visibility=["read"]) + """Whether the user is currently allowed to terminate the link.""" + link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = rest_field( + name="linkType", visibility=["read", "create", "update", "delete", "query"] + ) + """Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. Known values are: + \"GEO\", \"NAMED\", and \"STANDBY\".""" + + @overload + def __init__( + self, + *, + link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ReplicationLinkUpdate(ProxyResourceAutoGenerated): + """A replication link update request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ReplicationLinkUpdateProperties + """ + + properties: Optional["_models.ReplicationLinkUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["link_type"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ReplicationLinkUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ReplicationLinkUpdateProperties(_Model): + """Properties of a replication link update. + + :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 + """ + + link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = rest_field( + name="linkType", visibility=["read", "create", "update", "delete", "query"] + ) + """Link type (GEO, NAMED, STANDBY). Update operation does not support NAMED. Known values are: + \"GEO\", \"NAMED\", and \"STANDBY\".""" + + @overload + def __init__( + self, + *, + link_type: Optional[Union[str, "_models.ReplicationLinkType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar user_assigned_identities: The resource ids of the user assigned identities to use. + :vartype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.UserIdentity] + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar type: The identity type. Set this to 'SystemAssigned' in order to automatically create + and assign an Azure Active Directory principal for the resource. Known values are: "None", + "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". + :vartype type: str or ~azure.mgmt.sql.models.IdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + """ + + user_assigned_identities: Optional[dict[str, "_models.UserIdentity"]] = rest_field( + name="userAssignedIdentities", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource ids of the user assigned identities to use.""" + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory principal id.""" + type: Optional[Union[str, "_models.IdentityType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an + Azure Active Directory principal for the resource. Known values are: \"None\", + \"SystemAssigned\", \"UserAssigned\", and \"SystemAssigned,UserAssigned\".""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The Azure Active Directory tenant id.""" + + @overload + def __init__( + self, + *, + user_assigned_identities: Optional[dict[str, "_models.UserIdentity"]] = None, + type: Optional[Union[str, "_models.IdentityType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ResourceMoveDefinition(_Model): + """Contains the information necessary to perform a resource move (rename). + + :ivar id: The target ID for the resource. Required. + :vartype id: str + """ + + id: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The target ID for the resource. Required.""" + + @overload + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RestorableDroppedDatabase(Resource): + """A restorable dropped database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RestorableDroppedDatabaseProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: Resource location. + :vartype location: str + :ivar sku: The name and tier of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + """ + + properties: Optional["_models.RestorableDroppedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + location: Optional[str] = rest_field(visibility=["read", "create"]) + """Resource location.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and tier of the SKU.""" + + __flattened_items = [ + "database_name", + "max_size_bytes", + "creation_date", + "deletion_date", + "earliest_restore_date", + "backup_storage_redundancy", + "keys_property", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RestorableDroppedDatabaseProperties"] = None, + tags: Optional[dict[str, str]] = None, + location: Optional[str] = None, + sku: Optional["_models.Sku"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RestorableDroppedDatabaseProperties(_Model): + """The restorable dropped database's properties. + + :ivar database_name: The name of the database. + :vartype database_name: str + :ivar max_size_bytes: The max size of the database expressed in bytes. + :vartype max_size_bytes: int + :ivar creation_date: The creation date of the database (ISO8601 format). + :vartype creation_date: ~datetime.datetime + :ivar deletion_date: The deletion date of the database (ISO8601 format). + :vartype deletion_date: ~datetime.datetime + :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). + :vartype earliest_restore_date: ~datetime.datetime + :ivar backup_storage_redundancy: The storage account type used to store backups for this + database. Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar keys_property: The resource ids of the user assigned identities to use. + :vartype keys_property: dict[str, ~azure.mgmt.sql.models.DatabaseKey] + """ + + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database.""" + max_size_bytes: Optional[int] = rest_field(name="maxSizeBytes", visibility=["read"]) + """The max size of the database expressed in bytes.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the database (ISO8601 format).""" + deletion_date: Optional[datetime.datetime] = rest_field(name="deletionDate", visibility=["read"], format="rfc3339") + """The deletion date of the database (ISO8601 format).""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """The earliest restore date of the database (ISO8601 format).""" + backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="backupStorageRedundancy", visibility=["read"] + ) + """The storage account type used to store backups for this database. Known values are: \"Geo\", + \"Local\", \"Zone\", and \"GeoZone\".""" + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = rest_field( + name="keys", visibility=["read", "create", "update", "delete", "query"], original_tsp_name="keys" + ) + """The resource ids of the user assigned identities to use.""" + + @overload + def __init__( + self, + *, + keys_property: Optional[dict[str, "_models.DatabaseKey"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class RestorableDroppedManagedDatabase(TrackedResource): + """A restorable dropped managed database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabaseProperties + """ + + properties: Optional["_models.RestorableDroppedManagedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["database_name", "creation_date", "deletion_date", "earliest_restore_date"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.RestorableDroppedManagedDatabaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RestorableDroppedManagedDatabaseProperties(_Model): # pylint: disable=name-too-long + """The restorable dropped managed database's properties. + + :ivar database_name: The name of the database. + :vartype database_name: str + :ivar creation_date: The creation date of the database (ISO8601 format). + :vartype creation_date: ~datetime.datetime + :ivar deletion_date: The deletion date of the database (ISO8601 format). + :vartype deletion_date: ~datetime.datetime + :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). + :vartype earliest_restore_date: ~datetime.datetime + """ + + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """The name of the database.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The creation date of the database (ISO8601 format).""" + deletion_date: Optional[datetime.datetime] = rest_field(name="deletionDate", visibility=["read"], format="rfc3339") + """The deletion date of the database (ISO8601 format).""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """The earliest restore date of the database (ISO8601 format).""" + + +class RestorePoint(ProxyResource): + """Database restore points. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.RestorePointProperties + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.RestorePointProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "restore_point_type", + "earliest_restore_date", + "restore_point_creation_date", + "restore_point_label", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.RestorePointProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class RestorePointProperties(_Model): + """Properties of a database restore point. + + :ivar restore_point_type: The type of restore point. Known values are: "CONTINUOUS" and + "DISCRETE". + :vartype restore_point_type: str or ~azure.mgmt.sql.models.RestorePointType + :ivar earliest_restore_date: The earliest time to which this database can be restored. + :vartype earliest_restore_date: ~datetime.datetime + :ivar restore_point_creation_date: The time the backup was taken. + :vartype restore_point_creation_date: ~datetime.datetime + :ivar restore_point_label: The label of restore point for backup request by user. + :vartype restore_point_label: str + """ + + restore_point_type: Optional[Union[str, "_models.RestorePointType"]] = rest_field( + name="restorePointType", visibility=["read"] + ) + """The type of restore point. Known values are: \"CONTINUOUS\" and \"DISCRETE\".""" + earliest_restore_date: Optional[datetime.datetime] = rest_field( + name="earliestRestoreDate", visibility=["read"], format="rfc3339" + ) + """The earliest time to which this database can be restored.""" + restore_point_creation_date: Optional[datetime.datetime] = rest_field( + name="restorePointCreationDate", visibility=["read"], format="rfc3339" + ) + """The time the backup was taken.""" + restore_point_label: Optional[str] = rest_field(name="restorePointLabel", visibility=["read"]) + """The label of restore point for backup request by user.""" + + +class ScheduleItem(_Model): + """Schedule info describing when the server should be started or stopped. + + :ivar start_day: Start day. Required. Known values are: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", and "Saturday". + :vartype start_day: str or ~azure.mgmt.sql.models.DayOfWeek + :ivar start_time: Start time. Required. + :vartype start_time: str + :ivar stop_day: Stop day. Required. Known values are: "Sunday", "Monday", "Tuesday", + "Wednesday", "Thursday", "Friday", and "Saturday". + :vartype stop_day: str or ~azure.mgmt.sql.models.DayOfWeek + :ivar stop_time: Stop time. Required. + :vartype stop_time: str + """ + + start_day: Union[str, "_models.DayOfWeek"] = rest_field( + name="startDay", visibility=["read", "create", "update", "delete", "query"] + ) + """Start day. Required. Known values are: \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", + \"Thursday\", \"Friday\", and \"Saturday\".""" + start_time: str = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """Start time. Required.""" + stop_day: Union[str, "_models.DayOfWeek"] = rest_field( + name="stopDay", visibility=["read", "create", "update", "delete", "query"] + ) + """Stop day. Required. Known values are: \"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", + \"Thursday\", \"Friday\", and \"Saturday\".""" + stop_time: str = rest_field(name="stopTime", visibility=["read", "create", "update", "delete", "query"]) + """Stop time. Required.""" + + @overload + def __init__( + self, + *, + start_day: Union[str, "_models.DayOfWeek"], + start_time: str, + stop_day: Union[str, "_models.DayOfWeek"], + stop_time: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityAlertPolicyProperties(_Model): + """Properties of a security alert policy. + + :ivar state: Specifies the state of the policy, whether it is enabled or disabled or a policy + has not been applied yet on the specific database. Required. Known values are: "New", + "Enabled", and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState + :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: + Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, + Brute_Force. + :vartype disabled_alerts: list[str] + :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. + :vartype email_addresses: list[str] + :ivar email_account_admins: Specifies that the alert is sent to the account administrators. + :vartype email_account_admins: bool + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). This + blob storage will hold all Threat Detection audit logs. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit + storage account. + :vartype storage_account_access_key: str + :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. + :vartype retention_days: int + :ivar creation_time: Specifies the UTC creation time of the policy. + :vartype creation_time: ~datetime.datetime + """ + + state: Union[str, "_models.SecurityAlertPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the policy, whether it is enabled or disabled or a policy has not been + applied yet on the specific database. Required. Known values are: \"New\", \"Enabled\", and + \"Disabled\".""" + disabled_alerts: Optional[list[str]] = rest_field( + name="disabledAlerts", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force.""" + email_addresses: Optional[list[str]] = rest_field( + name="emailAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies an array of e-mail addresses to which the alert is sent.""" + email_account_admins: Optional[bool] = rest_field( + name="emailAccountAdmins", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies that the alert is sent to the account administrators.""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). This blob storage will hold all Threat Detection + audit logs.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the identifier key of the Threat Detection audit storage account.""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the Threat Detection audit logs.""" + creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339") + """Specifies the UTC creation time of the policy.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.SecurityAlertPolicyState"], + disabled_alerts: Optional[list[str]] = None, + email_addresses: Optional[list[str]] = None, + email_account_admins: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + retention_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityAlertsPolicyProperties(_Model): + """Properties of a security alert policy. + + :ivar state: Specifies the state of the policy, whether it is enabled or disabled or a policy + has not been applied yet on the specific database. Required. Known values are: "Enabled" and + "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState + :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: + Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, + Brute_Force. + :vartype disabled_alerts: list[str] + :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. + :vartype email_addresses: list[str] + :ivar email_account_admins: Specifies that the alert is sent to the account administrators. + :vartype email_account_admins: bool + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). This + blob storage will hold all Threat Detection audit logs. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit + storage account. + :vartype storage_account_access_key: str + :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. + :vartype retention_days: int + :ivar creation_time: Specifies the UTC creation time of the policy. + :vartype creation_time: ~datetime.datetime + """ + + state: Union[str, "_models.SecurityAlertsPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the policy, whether it is enabled or disabled or a policy has not been + applied yet on the specific database. Required. Known values are: \"Enabled\" and \"Disabled\".""" + disabled_alerts: Optional[list[str]] = rest_field( + name="disabledAlerts", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, + Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force.""" + email_addresses: Optional[list[str]] = rest_field( + name="emailAddresses", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies an array of e-mail addresses to which the alert is sent.""" + email_account_admins: Optional[bool] = rest_field( + name="emailAccountAdmins", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies that the alert is sent to the account administrators.""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). This blob storage will hold all Threat Detection + audit logs.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the identifier key of the Threat Detection audit storage account.""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the Threat Detection audit logs.""" + creation_time: Optional[datetime.datetime] = rest_field(name="creationTime", visibility=["read"], format="rfc3339") + """Specifies the UTC creation time of the policy.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.SecurityAlertsPolicyState"], + disabled_alerts: Optional[list[str]] = None, + email_addresses: Optional[list[str]] = None, + email_account_admins: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + retention_days: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SecurityEvent(ProxyResourceAutoGenerated): + """A security event. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SecurityEventProperties + """ + + properties: Optional["_models.SecurityEventProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "event_time", + "security_event_type", + "subscription", + "server", + "database", + "client_ip", + "application_name", + "principal_name", + "security_event_sql_injection_additional_properties", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityEventProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SecurityEventProperties(_Model): + """The properties of a security event. + + :ivar event_time: The time when the security event occurred. + :vartype event_time: ~datetime.datetime + :ivar security_event_type: The type of the security event. Known values are: "Undefined", + "SqlInjectionVulnerability", and "SqlInjectionExploit". + :vartype security_event_type: str or ~azure.mgmt.sql.models.SecurityEventType + :ivar subscription: The subscription name. + :vartype subscription: str + :ivar server: The server name. + :vartype server: str + :ivar database: The database name. + :vartype database: str + :ivar client_ip: The IP address of the client who executed the statement. + :vartype client_ip: str + :ivar application_name: The application used to execute the statement. + :vartype application_name: str + :ivar principal_name: The principal user who executed the statement. + :vartype principal_name: str + :ivar security_event_sql_injection_additional_properties: The sql injection additional + properties, populated only if the type of the security event is sql injection. + :vartype security_event_sql_injection_additional_properties: + ~azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties + """ + + event_time: Optional[datetime.datetime] = rest_field(name="eventTime", visibility=["read"], format="rfc3339") + """The time when the security event occurred.""" + security_event_type: Optional[Union[str, "_models.SecurityEventType"]] = rest_field( + name="securityEventType", visibility=["read"] + ) + """The type of the security event. Known values are: \"Undefined\", \"SqlInjectionVulnerability\", + and \"SqlInjectionExploit\".""" + subscription: Optional[str] = rest_field(visibility=["read"]) + """The subscription name.""" + server: Optional[str] = rest_field(visibility=["read"]) + """The server name.""" + database: Optional[str] = rest_field(visibility=["read"]) + """The database name.""" + client_ip: Optional[str] = rest_field(name="clientIp", visibility=["read"]) + """The IP address of the client who executed the statement.""" + application_name: Optional[str] = rest_field(name="applicationName", visibility=["read"]) + """The application used to execute the statement.""" + principal_name: Optional[str] = rest_field(name="principalName", visibility=["read"]) + """The principal user who executed the statement.""" + security_event_sql_injection_additional_properties: Optional[ + "_models.SecurityEventSqlInjectionAdditionalProperties" + ] = rest_field(name="securityEventSqlInjectionAdditionalProperties", visibility=["read"]) + """The sql injection additional properties, populated only if the type of the security event is + sql injection.""" + + +class SecurityEventSqlInjectionAdditionalProperties(_Model): # pylint: disable=name-too-long + """The properties of a security event sql injection additional properties. + + :ivar threat_id: The threat ID. + :vartype threat_id: str + :ivar statement: The statement. + :vartype statement: str + :ivar statement_highlight_offset: The statement highlight offset. + :vartype statement_highlight_offset: int + :ivar statement_highlight_length: The statement highlight length. + :vartype statement_highlight_length: int + :ivar error_code: The sql error code. + :vartype error_code: int + :ivar error_severity: The sql error severity. + :vartype error_severity: int + :ivar error_message: The sql error message. + :vartype error_message: str + """ + + threat_id: Optional[str] = rest_field(name="threatId", visibility=["read"]) + """The threat ID.""" + statement: Optional[str] = rest_field(visibility=["read"]) + """The statement.""" + statement_highlight_offset: Optional[int] = rest_field(name="statementHighlightOffset", visibility=["read"]) + """The statement highlight offset.""" + statement_highlight_length: Optional[int] = rest_field(name="statementHighlightLength", visibility=["read"]) + """The statement highlight length.""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The sql error code.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The sql error severity.""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """The sql error message.""" + + +class SensitivityLabel(ProxyResource): + """A sensitivity label. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SensitivityLabelProperties + :ivar managed_by: Resource that manages the sensitivity label. + :vartype managed_by: str + """ + + properties: Optional["_models.SensitivityLabelProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + managed_by: Optional[str] = rest_field(name="managedBy", visibility=["read"]) + """Resource that manages the sensitivity label.""" + + __flattened_items = [ + "schema_name", + "table_name", + "column_name", + "label_name", + "label_id", + "information_type", + "information_type_id", + "is_disabled", + "rank", + "client_classification_source", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SensitivityLabelProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SensitivityLabelProperties(_Model): + """Properties of a sensitivity label. + + :ivar schema_name: The schema name. + :vartype schema_name: str + :ivar table_name: The table name. + :vartype table_name: str + :ivar column_name: The column name. + :vartype column_name: str + :ivar label_name: The label name. + :vartype label_name: str + :ivar label_id: The label ID. + :vartype label_id: str + :ivar information_type: The information type. + :vartype information_type: str + :ivar information_type_id: The information type ID. + :vartype information_type_id: str + :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for recommended + sensitivity label only. Specifies whether the sensitivity recommendation on this column is + disabled (dismissed) or not. + :vartype is_disabled: bool + :ivar rank: Known values are: "None", "Low", "Medium", "High", and "Critical". + :vartype rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank + :ivar client_classification_source: Known values are: "None", "Native", "Recommended", and + "MIP". + :vartype client_classification_source: str or ~azure.mgmt.sql.models.ClientClassificationSource + """ + + schema_name: Optional[str] = rest_field(name="schemaName", visibility=["read"]) + """The schema name.""" + table_name: Optional[str] = rest_field(name="tableName", visibility=["read"]) + """The table name.""" + column_name: Optional[str] = rest_field(name="columnName", visibility=["read"]) + """The column name.""" + label_name: Optional[str] = rest_field(name="labelName", visibility=["read", "create", "update", "delete", "query"]) + """The label name.""" + label_id: Optional[str] = rest_field(name="labelId", visibility=["read", "create", "update", "delete", "query"]) + """The label ID.""" + information_type: Optional[str] = rest_field( + name="informationType", visibility=["read", "create", "update", "delete", "query"] + ) + """The information type.""" + information_type_id: Optional[str] = rest_field( + name="informationTypeId", visibility=["read", "create", "update", "delete", "query"] + ) + """The information type ID.""" + is_disabled: Optional[bool] = rest_field(name="isDisabled", visibility=["read"]) + """Is sensitivity recommendation disabled. Applicable for recommended sensitivity label only. + Specifies whether the sensitivity recommendation on this column is disabled (dismissed) or not.""" + rank: Optional[Union[str, "_models.SensitivityLabelRank"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"None\", \"Low\", \"Medium\", \"High\", and \"Critical\".""" + client_classification_source: Optional[Union[str, "_models.ClientClassificationSource"]] = rest_field( + name="clientClassificationSource", visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"None\", \"Native\", \"Recommended\", and \"MIP\".""" + + @overload + def __init__( + self, + *, + label_name: Optional[str] = None, + label_id: Optional[str] = None, + information_type: Optional[str] = None, + information_type_id: Optional[str] = None, + rank: Optional[Union[str, "_models.SensitivityLabelRank"]] = None, + client_classification_source: Optional[Union[str, "_models.ClientClassificationSource"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SensitivityLabelUpdate(ProxyResourceAutoGenerated): + """A sensitivity label update operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SensitivityLabelUpdateProperties + """ + + properties: Optional["_models.SensitivityLabelUpdateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["op", "schema", "table", "column", "sensitivity_label"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SensitivityLabelUpdateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SensitivityLabelUpdateList(_Model): + """A list of sensitivity label update operations. + + :ivar operations: + :vartype operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] + """ + + operations: Optional[list["_models.SensitivityLabelUpdate"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + operations: Optional[list["_models.SensitivityLabelUpdate"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SensitivityLabelUpdateProperties(_Model): + """Properties of an operation executed on a sensitivity label. + + :ivar op: Required. Known values are: "set" and "remove". + :vartype op: str or ~azure.mgmt.sql.models.SensitivityLabelUpdateKind + :ivar schema: Schema name of the column to update. Required. + :vartype schema: str + :ivar table: Table name of the column to update. Required. + :vartype table: str + :ivar column: Column name to update. Required. + :vartype column: str + :ivar sensitivity_label: The sensitivity label information to apply on a column. + :vartype sensitivity_label: ~azure.mgmt.sql.models.SensitivityLabel + """ + + op: Union[str, "_models.SensitivityLabelUpdateKind"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Required. Known values are: \"set\" and \"remove\".""" + schema: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Schema name of the column to update. Required.""" + table: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Table name of the column to update. Required.""" + column: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Column name to update. Required.""" + sensitivity_label: Optional["_models.SensitivityLabel"] = rest_field( + name="sensitivityLabel", visibility=["read", "create", "update", "delete", "query"] + ) + """The sensitivity label information to apply on a column.""" + + @overload + def __init__( + self, + *, + op: Union[str, "_models.SensitivityLabelUpdateKind"], + schema: str, + table: str, + column: str, + sensitivity_label: Optional["_models.SensitivityLabel"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Server(TrackedResource): + """An Azure SQL Database server. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerProperties + :ivar identity: The Azure Active Directory identity of the server. + :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity + :ivar kind: Kind of sql server. This is metadata used for the Azure portal experience. + :vartype kind: str + """ + + properties: Optional["_models.ServerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The Azure Active Directory identity of the server.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of sql server. This is metadata used for the Azure portal experience.""" + + __flattened_items = [ + "administrator_login", + "administrator_login_password", + "version", + "state", + "fully_qualified_domain_name", + "private_endpoint_connections", + "minimal_tls_version", + "public_network_access", + "workspace_feature", + "primary_user_assigned_identity_id", + "federated_client_id", + "key_id", + "administrators", + "restrict_outbound_network_access", + "is_i_pv6_enabled", + "external_governance_status", + "retention_days", + "create_mode", + ] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.ServerProperties"] = None, + identity: Optional["_models.ResourceIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerAdvancedThreatProtection(ProxyResource): + """A server Advanced Threat Protection. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdvancedThreatProtectionProperties + """ + + properties: Optional["_models.AdvancedThreatProtectionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state", "creation_time"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdvancedThreatProtectionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerAutomaticTuning(ProxyResource): + """Server-level Automatic Tuning. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AutomaticTuningServerProperties + """ + + properties: Optional["_models.AutomaticTuningServerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["desired_state", "actual_state", "options"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AutomaticTuningServerProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerAzureADAdministrator(ProxyResource): + """Azure Active Directory administrator. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AdministratorProperties + """ + + properties: Optional["_models.AdministratorProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["administrator_type", "login", "sid", "tenant_id", "azure_ad_only_authentication"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AdministratorProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerAzureADOnlyAuthentication(ProxyResource): + """Azure Active Directory only authentication. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.AzureADOnlyAuthProperties + """ + + properties: Optional["_models.AzureADOnlyAuthProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["azure_ad_only_authentication"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.AzureADOnlyAuthProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerBlobAuditingPolicy(ProxyResource): + """A server blob auditing policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerBlobAuditingPolicyProperties + """ + + properties: Optional["_models.ServerBlobAuditingPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "is_devops_audit_enabled", + "retention_days", + "audit_actions_and_groups", + "is_storage_secondary_key_in_use", + "is_azure_monitor_target_enabled", + "queue_delay_ms", + "is_managed_identity_in_use", + "state", + "storage_endpoint", + "storage_account_access_key", + "storage_account_subscription_id", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerBlobAuditingPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerBlobAuditingPolicyProperties(_Model): + """Properties of a server blob auditing policy. + + :ivar is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, devops + logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled', + 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + + When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should also be created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_devops_audit_enabled: bool + :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage + account. + :vartype retention_days: int + :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_. + :vartype audit_actions_and_groups: list[str] + :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the + storage's secondary key. + :vartype is_storage_secondary_key_in_use: bool + :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_azure_monitor_target_enabled: bool + :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit + actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum + is 2,147,483,647. + :vartype queue_delay_ms: int + :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob + storage. + :vartype is_managed_identity_in_use: bool + :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). If state + is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + :vartype storage_account_access_key: str + :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. + :vartype storage_account_subscription_id: str + """ + + is_devops_audit_enabled: Optional[bool] = rest_field( + name="isDevopsAuditEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled', + 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + + When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should also be created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the number of days to keep in the audit logs in the storage account.""" + audit_actions_and_groups: Optional[list[str]] = rest_field( + name="auditActionsAndGroups", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the Actions-Groups and Actions to audit. + + The recommended set of action groups to use is the following combination - this will audit all + the queries and stored procedures executed against the database, as well as successful and + failed logins: + + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + + This above combination is also the set that is configured by default when enabling auditing + from the Azure portal. + + The supported action groups to audit are (note: choose only specific groups that cover your + auditing needs. Using unnecessary groups could lead to very large quantities of audit records): + + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP + + These are groups that cover all sql statements and stored procedures executed against the + database, and should not be used in combination with other groups as this will result in + duplicate audit logs. + + For more information, see `Database-Level Audit Action Groups + `_. + + For Database auditing policy, specific Actions can also be specified (note that Actions cannot + be specified for Server auditing policy). The supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + + Note that in the above format can refer to an object like a table, view, or stored + procedure, or an entire database or schema. For the latter cases, the forms DATABASE::{db_name} + and SCHEMA::{schema_name} are used, respectively. + + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + + For more information, see `Database-Level Audit Actions + `_.""" + is_storage_secondary_key_in_use: Optional[bool] = rest_field( + name="isStorageSecondaryKeyInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether storageAccountAccessKey value is the storage's secondary key.""" + is_azure_monitor_target_enabled: Optional[bool] = rest_field( + name="isAzureMonitorTargetEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' + diagnostic logs category on the database should be also created. + Note that for server level audit you should use the 'master' database as {databaseName}. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + queue_delay_ms: Optional[int] = rest_field( + name="queueDelayMs", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the amount of time in milliseconds that can elapse before audit actions are forced to + be processed. The default minimum value is 1000 (1 second). The maximum is 2,147,483,647.""" + is_managed_identity_in_use: Optional[bool] = rest_field( + name="isManagedIdentityInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether Managed Identity is used to access blob storage.""" + state: Union[str, "_models.BlobAuditingPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled is required.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355).""" + storage_account_subscription_id: Optional[str] = rest_field( + name="storageAccountSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage subscription Id.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.BlobAuditingPolicyState"], + is_devops_audit_enabled: Optional[bool] = None, + retention_days: Optional[int] = None, + audit_actions_and_groups: Optional[list[str]] = None, + is_storage_secondary_key_in_use: Optional[bool] = None, + is_azure_monitor_target_enabled: Optional[bool] = None, + queue_delay_ms: Optional[int] = None, + is_managed_identity_in_use: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + storage_account_subscription_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerConfigurationOption(ProxyResource): + """A server configuration option. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerConfigurationOptionProperties + """ + + properties: Optional["_models.ServerConfigurationOptionProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["server_configuration_option_value", "provisioning_state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerConfigurationOptionProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerConfigurationOptionProperties(_Model): + """The properties of server configuration option. + + :ivar server_configuration_option_value: Value of the server configuration option. Required. + :vartype server_configuration_option_value: int + :ivar provisioning_state: Provisioning state of server configuration option. Known values are: + "Created", "InProgress", "Succeeded", "Failed", and "Canceled". + :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState + """ + + server_configuration_option_value: int = rest_field( + name="serverConfigurationOptionValue", visibility=["read", "update"] + ) + """Value of the server configuration option. Required.""" + provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = rest_field( + name="provisioningState", visibility=["read"] + ) + """Provisioning state of server configuration option. Known values are: \"Created\", + \"InProgress\", \"Succeeded\", \"Failed\", and \"Canceled\".""" + + @overload + def __init__( + self, + *, + server_configuration_option_value: int, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerConnectionPolicy(ProxyResource): + """A server connection policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerConnectionPolicyProperties + :ivar location: Resource location. + :vartype location: str + :ivar kind: Metadata used for the Azure portal experience. + :vartype kind: str + """ + + properties: Optional["_models.ServerConnectionPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Metadata used for the Azure portal experience.""" + + __flattened_items = ["connection_type"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerConnectionPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerConnectionPolicyProperties(_Model): + """The properties of a server connection policy. + + :ivar connection_type: The server connection type. Required. Known values are: "Default", + "Redirect", and "Proxy". + :vartype connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType + """ + + connection_type: Union[str, "_models.ServerConnectionType"] = rest_field( + name="connectionType", visibility=["read", "create", "update", "delete", "query"] + ) + """The server connection type. Required. Known values are: \"Default\", \"Redirect\", and + \"Proxy\".""" + + @overload + def __init__( + self, + *, + connection_type: Union[str, "_models.ServerConnectionType"], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerDevOpsAuditingSettings(ProxyResource): + """A server DevOps auditing settings. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerDevOpsAuditSettingsProperties + """ + + properties: Optional["_models.ServerDevOpsAuditSettingsProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "is_azure_monitor_target_enabled", + "is_managed_identity_in_use", + "state", + "storage_endpoint", + "storage_account_access_key", + "storage_account_subscription_id", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerDevOpsAuditSettingsProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerDevOpsAuditSettingsProperties(_Model): + """Properties of a server DevOps audit settings. + + :ivar is_azure_monitor_target_enabled: Specifies whether DevOps audit events are sent to Azure + Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should be also created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_. + :vartype is_azure_monitor_target_enabled: bool + :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob + storage. + :vartype is_managed_identity_in_use: bool + :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. + `https://MyAccount.blob.core.windows.net `_). If state + is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. + :vartype storage_endpoint: str + :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355). + :vartype storage_account_access_key: str + :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. + :vartype storage_account_subscription_id: str + """ + + is_azure_monitor_target_enabled: Optional[bool] = rest_field( + name="isAzureMonitorTargetEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether DevOps audit events are sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and + 'IsAzureMonitorTargetEnabled' as true. + + When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' + diagnostic logs category on the master database should be also created. + + Diagnostic Settings URI format: + PUT + `https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + `_ + + For more information, see `Diagnostic Settings REST API + `_ + or `Diagnostic Settings PowerShell `_.""" + is_managed_identity_in_use: Optional[bool] = rest_field( + name="isManagedIdentityInUse", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies whether Managed Identity is used to access blob storage.""" + state: Union[str, "_models.BlobAuditingPolicyState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the audit. If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled are required. Required. Known values are: \"Enabled\" and + \"Disabled\".""" + storage_endpoint: Optional[str] = rest_field( + name="storageEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage endpoint (e.g. `https://MyAccount.blob.core.windows.net + `_). If state is Enabled, storageEndpoint or + isAzureMonitorTargetEnabled is required.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed identity to access the + storage. + Prerequisites for using managed identity authentication: + + 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data + Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355).""" + storage_account_subscription_id: Optional[str] = rest_field( + name="storageAccountSubscriptionId", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the blob storage subscription Id.""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.BlobAuditingPolicyState"], + is_azure_monitor_target_enabled: Optional[bool] = None, + is_managed_identity_in_use: Optional[bool] = None, + storage_endpoint: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + storage_account_subscription_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerDnsAlias(ProxyResource): + """A server DNS alias. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerDnsAliasProperties + """ + + properties: Optional["_models.ServerDnsAliasProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["azure_dns_record"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerDnsAliasProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerDnsAliasAcquisition(_Model): + """A server dns alias acquisition request. + + :ivar old_server_dns_alias_id: The id of the server alias that will be acquired to point to + this server instead. Required. + :vartype old_server_dns_alias_id: str + """ + + old_server_dns_alias_id: str = rest_field( + name="oldServerDnsAliasId", visibility=["read", "create", "update", "delete", "query"] + ) + """The id of the server alias that will be acquired to point to this server instead. Required.""" + + @overload + def __init__( + self, + *, + old_server_dns_alias_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerDnsAliasProperties(_Model): + """Properties of a server DNS alias. + + :ivar azure_dns_record: The fully qualified DNS record for alias. + :vartype azure_dns_record: str + """ + + azure_dns_record: Optional[str] = rest_field(name="azureDnsRecord", visibility=["read"]) + """The fully qualified DNS record for alias.""" + + +class ServerExternalAdministrator(_Model): + """Properties of a active directory administrator. + + :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" + :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :ivar principal_type: Principal Type of the sever administrator. Known values are: "User", + "Group", and "Application". + :vartype principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :ivar login: Login name of the server administrator. + :vartype login: str + :ivar sid: SID (object ID) of the server administrator. + :vartype sid: str + :ivar tenant_id: Tenant ID of the administrator. + :vartype tenant_id: str + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. + :vartype azure_ad_only_authentication: bool + """ + + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = rest_field( + name="administratorType", visibility=["read", "create", "update", "delete", "query"] + ) + """Type of the sever administrator. \"ActiveDirectory\"""" + principal_type: Optional[Union[str, "_models.PrincipalType"]] = rest_field( + name="principalType", visibility=["read", "create", "update", "delete", "query"] + ) + """Principal Type of the sever administrator. Known values are: \"User\", \"Group\", and + \"Application\".""" + login: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Login name of the server administrator.""" + sid: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """SID (object ID) of the server administrator.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read", "create", "update", "delete", "query"]) + """Tenant ID of the administrator.""" + azure_ad_only_authentication: Optional[bool] = rest_field( + name="azureADOnlyAuthentication", visibility=["read", "create", "update", "delete", "query"] + ) + """Azure Active Directory only Authentication enabled.""" + + @overload + def __init__( + self, + *, + administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, + principal_type: Optional[Union[str, "_models.PrincipalType"]] = None, + login: Optional[str] = None, + sid: Optional[str] = None, + tenant_id: Optional[str] = None, + azure_ad_only_authentication: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerFirewallRuleProperties(_Model): + """The properties of a server firewall rule. + + :ivar start_ip_address: The start IP address of the firewall rule. Must be IPv4 format. Use + value '0.0.0.0' for all Azure-internal IP addresses. + :vartype start_ip_address: str + :ivar end_ip_address: The end IP address of the firewall rule. Must be IPv4 format. Must be + greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP + addresses. + :vartype end_ip_address: str + """ + + start_ip_address: Optional[str] = rest_field( + name="startIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """The start IP address of the firewall rule. Must be IPv4 format. Use value '0.0.0.0' for all + Azure-internal IP addresses.""" + end_ip_address: Optional[str] = rest_field( + name="endIpAddress", visibility=["read", "create", "update", "delete", "query"] + ) + """The end IP address of the firewall rule. Must be IPv4 format. Must be greater than or equal to + startIpAddress. Use value '0.0.0.0' for all Azure-internal IP addresses.""" + + @overload + def __init__( + self, + *, + start_ip_address: Optional[str] = None, + end_ip_address: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerInfo(_Model): + """Server info for the server trust group. + + :ivar server_id: Server Id. Required. + :vartype server_id: str + """ + + server_id: str = rest_field(name="serverId", visibility=["read", "create", "update", "delete", "query"]) + """Server Id. Required.""" + + @overload + def __init__( + self, + *, + server_id: str, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerKey(ProxyResource): + """A server key. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerKeyProperties + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal + experience. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + """ + + properties: Optional["_models.ServerKeyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + kind: Optional[str] = rest_field(visibility=["read"]) + """Kind of encryption protector. This is metadata used for the Azure portal experience.""" + location: Optional[str] = rest_field(visibility=["read"]) + """Resource location.""" + + __flattened_items = [ + "subregion", + "server_key_type", + "uri", + "thumbprint", + "creation_date", + "auto_rotation_enabled", + "key_version", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerKeyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerKeyProperties(_Model): + """Properties for a server key execution. + + :ivar subregion: Subregion of the server key. + :vartype subregion: str + :ivar server_key_type: The server key type like 'ServiceManaged', 'AzureKeyVault'. Required. + Known values are: "ServiceManaged" and "AzureKeyVault". + :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is + required. The AKV URI is required to be in this format: + '`https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion + `_' or can be + '`https://YourVaultName.vault.azure.net/keys/YourKeyName + `_'. + :vartype uri: str + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + :ivar creation_date: The server key creation date. + :vartype creation_date: ~datetime.datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. + :vartype auto_rotation_enabled: bool + :ivar key_version: The version of the server key. + :vartype key_version: str + """ + + subregion: Optional[str] = rest_field(visibility=["read"]) + """Subregion of the server key.""" + server_key_type: Union[str, "_models.ServerKeyType"] = rest_field(name="serverKeyType", visibility=["create"]) + """The server key type like 'ServiceManaged', 'AzureKeyVault'. Required. Known values are: + \"ServiceManaged\" and \"AzureKeyVault\".""" + uri: Optional[str] = rest_field(visibility=["create"]) + """The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The + AKV URI is required to be in this format: + '`https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion + `_' or can be + '`https://YourVaultName.vault.azure.net/keys/YourKeyName + `_'.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """Thumbprint of the server key.""" + creation_date: Optional[datetime.datetime] = rest_field(name="creationDate", visibility=["read"], format="rfc3339") + """The server key creation date.""" + auto_rotation_enabled: Optional[bool] = rest_field(name="autoRotationEnabled", visibility=["read"]) + """Key auto rotation opt-in flag. Either true or false.""" + key_version: Optional[str] = rest_field(name="keyVersion", visibility=["read"]) + """The version of the server key.""" + + @overload + def __init__( + self, + *, + server_key_type: Union[str, "_models.ServerKeyType"], + uri: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerOperation(ProxyResourceAutoGenerated): + """A server operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerOperationProperties + """ + + properties: Optional["_models.ServerOperationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "operation", + "operation_friendly_name", + "percent_complete", + "server_name", + "start_time", + "state", + "error_code", + "error_description", + "error_severity", + "is_user_error", + "estimated_completion_time", + "description", + "is_cancellable", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerOperationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerOperationProperties(_Model): + """The properties of a server operation. + + :ivar operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar server_name: The name of the server. + :vartype server_name: str + :ivar start_time: The operation start time. + :vartype start_time: ~datetime.datetime + :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", + "Failed", "CancelInProgress", and "Cancelled". + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the operation. + :vartype estimated_completion_time: ~datetime.datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + operation: Optional[str] = rest_field(visibility=["read"]) + """The name of operation.""" + operation_friendly_name: Optional[str] = rest_field(name="operationFriendlyName", visibility=["read"]) + """The friendly name of operation.""" + percent_complete: Optional[int] = rest_field(name="percentComplete", visibility=["read"]) + """The percentage of the operation completed.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """The name of the server.""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The operation start time.""" + state: Optional[Union[str, "_models.ManagementOperationState"]] = rest_field(visibility=["read"]) + """The operation state. Known values are: \"Pending\", \"InProgress\", \"Succeeded\", \"Failed\", + \"CancelInProgress\", and \"Cancelled\".""" + error_code: Optional[int] = rest_field(name="errorCode", visibility=["read"]) + """The operation error code.""" + error_description: Optional[str] = rest_field(name="errorDescription", visibility=["read"]) + """The operation error description.""" + error_severity: Optional[int] = rest_field(name="errorSeverity", visibility=["read"]) + """The operation error severity.""" + is_user_error: Optional[bool] = rest_field(name="isUserError", visibility=["read"]) + """Whether or not the error is a user error.""" + estimated_completion_time: Optional[datetime.datetime] = rest_field( + name="estimatedCompletionTime", visibility=["read"], format="rfc3339" + ) + """The estimated completion time of the operation.""" + description: Optional[str] = rest_field(visibility=["read"]) + """The operation description.""" + is_cancellable: Optional[bool] = rest_field(name="isCancellable", visibility=["read"]) + """Whether the operation can be cancelled.""" + + +class ServerPrivateEndpointConnection(_Model): + """A private endpoint connection under a server. + + :ivar id: Resource ID. + :vartype id: str + :ivar properties: Private endpoint connection properties. + :vartype properties: ~azure.mgmt.sql.models.PrivateEndpointConnectionProperties + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Resource ID.""" + properties: Optional["_models.PrivateEndpointConnectionProperties"] = rest_field(visibility=["read"]) + """Private endpoint connection properties.""" + + +class ServerProperties(_Model): + """The properties of a server. + + :ivar administrator_login: Administrator username for the server. Once created it cannot be + changed. + :vartype administrator_login: str + :ivar administrator_login_password: The administrator login password (required for server + creation). + :vartype administrator_login_password: str + :ivar version: The version of the server. + :vartype version: str + :ivar state: The state of the server. + :vartype state: str + :ivar fully_qualified_domain_name: The fully qualified domain name of the server. + :vartype fully_qualified_domain_name: str + :ivar private_endpoint_connections: List of private endpoint connections on a server. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] + :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', + '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". + :vartype minimal_tls_version: str or ~azure.mgmt.sql.models.MinimalTlsVersion + :ivar public_network_access: Whether or not public endpoint access is allowed for this server. + Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'. + Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". + :vartype public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccessFlag + :ivar workspace_feature: Whether or not existing server has a workspace created and if it + allows connection from workspace. Known values are: "Connected" and "Disconnected". + :vartype workspace_feature: str or ~azure.mgmt.sql.models.ServerWorkspaceFeature + :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used + by default. + :vartype primary_user_assigned_identity_id: str + :ivar federated_client_id: The Client id used for cross tenant CMK scenario. + :vartype federated_client_id: str + :ivar key_id: A CMK URI of the key to use for encryption. + :vartype key_id: str + :ivar administrators: The Azure Active Directory administrator can be utilized during server + creation and for server updates, except for the azureADOnlyAuthentication property. To update + the azureADOnlyAuthentication property, individual API must be used. + :vartype administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :ivar restrict_outbound_network_access: Whether or not to restrict outbound network access for + this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values + are: "Enabled" and "Disabled". + :vartype restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :ivar is_i_pv6_enabled: Whether or not to enable IPv6 support for this server. Value is + optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and + "Disabled". + :vartype is_i_pv6_enabled: str or ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :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 retention_days: Number of days this server will stay soft-deleted. + :vartype retention_days: int + :ivar create_mode: Create mode for server, only valid values for this are Normal and Restore. + Known values are: "Normal" and "Restore". + :vartype create_mode: str or ~azure.mgmt.sql.models.ServerCreateMode + """ + + administrator_login: Optional[str] = rest_field(name="administratorLogin", visibility=["read", "create"]) + """Administrator username for the server. Once created it cannot be changed.""" + administrator_login_password: Optional[str] = rest_field( + name="administratorLoginPassword", visibility=["create", "update"] + ) + """The administrator login password (required for server creation).""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The version of the server.""" + state: Optional[str] = rest_field(visibility=["read"]) + """The state of the server.""" + fully_qualified_domain_name: Optional[str] = rest_field(name="fullyQualifiedDomainName", visibility=["read"]) + """The fully qualified domain name of the server.""" + private_endpoint_connections: Optional[list["_models.ServerPrivateEndpointConnection"]] = rest_field( + name="privateEndpointConnections", visibility=["read"] + ) + """List of private endpoint connections on a server.""" + minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = rest_field( + name="minimalTlsVersion", visibility=["read", "create", "update", "delete", "query"] + ) + """Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', '1.3'. Known values are: + \"None\", \"1.0\", \"1.1\", \"1.2\", and \"1.3\".""" + public_network_access: Optional[Union[str, "_models.ServerPublicNetworkAccessFlag"]] = rest_field( + name="publicNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not public endpoint access is allowed for this server. Value is optional but if + passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'. Known values are: + \"Enabled\", \"Disabled\", and \"SecuredByPerimeter\".""" + workspace_feature: Optional[Union[str, "_models.ServerWorkspaceFeature"]] = rest_field( + name="workspaceFeature", visibility=["read"] + ) + """Whether or not existing server has a workspace created and if it allows connection from + workspace. Known values are: \"Connected\" and \"Disconnected\".""" + primary_user_assigned_identity_id: Optional[str] = rest_field( + name="primaryUserAssignedIdentityId", visibility=["read", "create", "update", "delete", "query"] + ) + """The resource id of a user assigned identity to be used by default.""" + federated_client_id: Optional[str] = rest_field( + name="federatedClientId", visibility=["read", "create", "update", "delete", "query"] + ) + """The Client id used for cross tenant CMK scenario.""" + key_id: Optional[str] = rest_field(name="keyId", visibility=["read", "create", "update", "delete", "query"]) + """A CMK URI of the key to use for encryption.""" + administrators: Optional["_models.ServerExternalAdministrator"] = rest_field(visibility=["read", "create"]) + """The Azure Active Directory administrator can be utilized during server creation and for server + updates, except for the azureADOnlyAuthentication property. To update the + azureADOnlyAuthentication property, individual API must be used.""" + restrict_outbound_network_access: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = rest_field( + name="restrictOutboundNetworkAccess", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not to restrict outbound network access for this server. Value is optional but if + passed in, must be 'Enabled' or 'Disabled'. Known values are: \"Enabled\" and \"Disabled\".""" + is_i_pv6_enabled: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = rest_field( + name="isIPv6Enabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether or not to enable IPv6 support for this server. Value is optional but if passed in, + must be 'Enabled' or 'Disabled'. Known values are: \"Enabled\" and \"Disabled\".""" + external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = rest_field( + name="externalGovernanceStatus", visibility=["read"] + ) + """Status of external governance. Known values are: \"Enabled\" and \"Disabled\".""" + retention_days: Optional[int] = rest_field( + name="retentionDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Number of days this server will stay soft-deleted.""" + create_mode: Optional[Union[str, "_models.ServerCreateMode"]] = rest_field( + name="createMode", visibility=["read", "create"] + ) + """Create mode for server, only valid values for this are Normal and Restore. Known values are: + \"Normal\" and \"Restore\".""" + + @overload + def __init__( + self, + *, + administrator_login: Optional[str] = None, + administrator_login_password: Optional[str] = None, + version: Optional[str] = None, + minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + public_network_access: Optional[Union[str, "_models.ServerPublicNetworkAccessFlag"]] = None, + primary_user_assigned_identity_id: Optional[str] = None, + federated_client_id: Optional[str] = None, + key_id: Optional[str] = None, + administrators: Optional["_models.ServerExternalAdministrator"] = None, + restrict_outbound_network_access: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, + is_i_pv6_enabled: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, + retention_days: Optional[int] = None, + create_mode: Optional[Union[str, "_models.ServerCreateMode"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerSecurityAlertPolicy(ProxyResource): + """A server security alert policy. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SecurityAlertsPolicyProperties + """ + + properties: Optional["_models.SecurityAlertsPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "state", + "disabled_alerts", + "email_addresses", + "email_account_admins", + "storage_endpoint", + "storage_account_access_key", + "retention_days", + "creation_time", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SecurityAlertsPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerTrustCertificate(ProxyResource): + """Server trust certificate imported from box to enable connection between box and Sql Managed + Instance. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerTrustCertificateProperties + """ + + properties: Optional["_models.ServerTrustCertificateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["public_blob", "thumbprint", "certificate_name"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerTrustCertificateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerTrustCertificateProperties(_Model): + """The properties of a server trust certificate. + + :ivar public_blob: The certificate public blob. + :vartype public_blob: str + :ivar thumbprint: The certificate thumbprint. + :vartype thumbprint: str + :ivar certificate_name: The certificate name. + :vartype certificate_name: str + """ + + public_blob: Optional[str] = rest_field( + name="publicBlob", visibility=["read", "create", "update", "delete", "query"] + ) + """The certificate public blob.""" + thumbprint: Optional[str] = rest_field(visibility=["read"]) + """The certificate thumbprint.""" + certificate_name: Optional[str] = rest_field(name="certificateName", visibility=["read"]) + """The certificate name.""" + + @overload + def __init__( + self, + *, + public_blob: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerTrustGroup(ProxyResource): + """A server trust group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerTrustGroupProperties + """ + + properties: Optional["_models.ServerTrustGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["group_members", "trust_scopes"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerTrustGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerTrustGroupProperties(_Model): + """Properties of a server trust group. + + :ivar group_members: Group members information for the server trust group. Required. + :vartype group_members: list[~azure.mgmt.sql.models.ServerInfo] + :ivar trust_scopes: Trust scope of the server trust group. Required. + :vartype trust_scopes: list[str or + ~azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem] + """ + + group_members: list["_models.ServerInfo"] = rest_field( + name="groupMembers", visibility=["read", "create", "update", "delete", "query"] + ) + """Group members information for the server trust group. Required.""" + trust_scopes: list[Union[str, "_models.ServerTrustGroupPropertiesTrustScopesItem"]] = rest_field( + name="trustScopes", visibility=["read", "create", "update", "delete", "query"] + ) + """Trust scope of the server trust group. Required.""" + + @overload + def __init__( + self, + *, + group_members: list["_models.ServerInfo"], + trust_scopes: list[Union[str, "_models.ServerTrustGroupPropertiesTrustScopesItem"]], + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerUpdate(_Model): + """An update request for an Azure SQL Database server. + + :ivar identity: Server identity. + :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + identity: Optional["_models.ResourceIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Server identity.""" + properties: Optional["_models.ServerProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = [ + "administrator_login", + "administrator_login_password", + "version", + "state", + "fully_qualified_domain_name", + "private_endpoint_connections", + "minimal_tls_version", + "public_network_access", + "workspace_feature", + "primary_user_assigned_identity_id", + "federated_client_id", + "key_id", + "administrators", + "restrict_outbound_network_access", + "is_i_pv6_enabled", + "external_governance_status", + "retention_days", + "create_mode", + ] + + @overload + def __init__( + self, + *, + identity: Optional["_models.ResourceIdentity"] = None, + properties: Optional["_models.ServerProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerUsage(ProxyResourceAutoGenerated): + """Usage metric of a server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerUsageProperties + """ + + properties: Optional["_models.ServerUsageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["display_name", "current_value", "limit", "unit"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerUsageProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerUsageProperties(_Model): + """Properties of a server usage. + + :ivar display_name: User-readable name of the metric. + :vartype display_name: str + :ivar current_value: Current value of the metric. + :vartype current_value: float + :ivar limit: Boundary value of the metric. + :vartype limit: float + :ivar unit: Unit of the metric. + :vartype unit: str + """ + + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """User-readable name of the metric.""" + current_value: Optional[float] = rest_field(name="currentValue", visibility=["read"]) + """Current value of the metric.""" + limit: Optional[float] = rest_field(visibility=["read"]) + """Boundary value of the metric.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Unit of the metric.""" + + +class ServerVersionCapability(_Model): + """The server capability. + + :ivar name: The server version name. + :vartype name: str + :ivar supported_editions: The list of supported database editions. + :vartype supported_editions: list[~azure.mgmt.sql.models.EditionCapability] + :ivar supported_elastic_pool_editions: The list of supported elastic pool editions. + :vartype supported_elastic_pool_editions: + list[~azure.mgmt.sql.models.ElasticPoolEditionCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """The server version name.""" + supported_editions: Optional[list["_models.EditionCapability"]] = rest_field( + name="supportedEditions", visibility=["read"] + ) + """The list of supported database editions.""" + supported_elastic_pool_editions: Optional[list["_models.ElasticPoolEditionCapability"]] = rest_field( + name="supportedElasticPoolEditions", visibility=["read"] + ) + """The list of supported elastic pool editions.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServerVulnerabilityAssessment(ProxyResource): + """A server vulnerability assessment. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.ServerVulnerabilityAssessmentProperties + """ + + properties: Optional["_models.ServerVulnerabilityAssessmentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "storage_container_path", + "storage_container_sas_key", + "storage_account_access_key", + "recurring_scans", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.ServerVulnerabilityAssessmentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class ServerVulnerabilityAssessmentProperties(_Model): + """Properties of a server Vulnerability Assessment. + + :ivar storage_container_path: A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). Required. + :vartype storage_container_path: str + :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to + the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' + isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not + behind a Vnet or a firewall. + :vartype storage_container_sas_key: str + :ivar storage_account_access_key: Specifies the identifier key of the storage account for + vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, + storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet + or a firewall. + :vartype storage_account_access_key: str + :ivar recurring_scans: The recurring scans settings. + :vartype recurring_scans: + ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties + """ + + storage_container_path: str = rest_field(name="storageContainerPath", visibility=["create", "update"]) + """A blob storage container path to hold the scan results (e.g. + `https://myStorage.blob.core.windows.net/VaScans/ + `_). Required.""" + storage_container_sas_key: Optional[str] = rest_field( + name="storageContainerSasKey", visibility=["create", "update"] + ) + """A shared access signature (SAS Key) that has write access to the blob container specified in + 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. Applies only if the storage account is not behind a Vnet or + a firewall.""" + storage_account_access_key: Optional[str] = rest_field( + name="storageAccountAccessKey", visibility=["create", "update"] + ) + """Specifies the identifier key of the storage account for vulnerability assessment scan results. + If 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is required. Applies only + if the storage account is not behind a Vnet or a firewall.""" + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = rest_field( + name="recurringScans", visibility=["read", "create", "update", "delete", "query"] + ) + """The recurring scans settings.""" + + @overload + def __init__( + self, + *, + storage_container_path: str, + storage_container_sas_key: Optional[str] = None, + storage_account_access_key: Optional[str] = None, + recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServiceObjectiveCapability(_Model): + """The service objectives capability. + + :ivar id: The unique ID of the service objective. + :vartype id: str + :ivar name: The service objective name. + :vartype name: str + :ivar supported_max_sizes: The list of supported maximum database sizes. + :vartype supported_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] + :ivar performance_level: The performance level. + :vartype performance_level: ~azure.mgmt.sql.models.PerformanceLevelCapability + :ivar sku: The sku. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar supported_license_types: List of supported license types. + :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] + :ivar included_max_size: The included (free) max size. + :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability + :ivar zone_redundant: Whether or not zone redundancy is supported for the service objective. + :vartype zone_redundant: bool + :ivar supported_auto_pause_delay: Supported time range for auto pause delay. + :vartype supported_auto_pause_delay: ~azure.mgmt.sql.models.AutoPauseDelayTimeRange + :ivar supported_min_capacities: List of supported min capacities. + :vartype supported_min_capacities: list[~azure.mgmt.sql.models.MinCapacityCapability] + :ivar compute_model: The compute model. + :vartype compute_model: str + :ivar supported_maintenance_configurations: List of supported maintenance configurations. + :vartype supported_maintenance_configurations: + list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] + :ivar zone_pinning: Whether or not zone pinning is supported. + :vartype zone_pinning: bool + :ivar supported_zones: List of supported availability zones. + :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] + :ivar supported_free_limit_exhaustion_behaviors: List of supported free limit exhaustion + behaviors. + :vartype supported_free_limit_exhaustion_behaviors: + list[~azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability] + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """The unique ID of the service objective.""" + name: Optional[str] = rest_field(visibility=["read"]) + """The service objective name.""" + supported_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = rest_field( + name="supportedMaxSizes", visibility=["read"] + ) + """The list of supported maximum database sizes.""" + performance_level: Optional["_models.PerformanceLevelCapability"] = rest_field( + name="performanceLevel", visibility=["read"] + ) + """The performance level.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read"]) + """The sku.""" + supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = rest_field( + name="supportedLicenseTypes", visibility=["read"] + ) + """List of supported license types.""" + included_max_size: Optional["_models.MaxSizeCapability"] = rest_field(name="includedMaxSize", visibility=["read"]) + """The included (free) max size.""" + zone_redundant: Optional[bool] = rest_field(name="zoneRedundant", visibility=["read"]) + """Whether or not zone redundancy is supported for the service objective.""" + supported_auto_pause_delay: Optional["_models.AutoPauseDelayTimeRange"] = rest_field( + name="supportedAutoPauseDelay", visibility=["read"] + ) + """Supported time range for auto pause delay.""" + supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = rest_field( + name="supportedMinCapacities", visibility=["read"] + ) + """List of supported min capacities.""" + compute_model: Optional[str] = rest_field(name="computeModel", visibility=["read"]) + """The compute model.""" + supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = rest_field( + name="supportedMaintenanceConfigurations", visibility=["read"] + ) + """List of supported maintenance configurations.""" + zone_pinning: Optional[bool] = rest_field(name="zonePinning", visibility=["read"]) + """Whether or not zone pinning is supported.""" + supported_zones: Optional[list["_models.ZonePinningCapability"]] = rest_field( + name="supportedZones", visibility=["read"] + ) + """List of supported availability zones.""" + supported_free_limit_exhaustion_behaviors: Optional[list["_models.FreeLimitExhaustionBehaviorCapability"]] = ( + rest_field(name="supportedFreeLimitExhaustionBehaviors", visibility=["read"]) + ) + """List of supported free limit exhaustion behaviors.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ServicePrincipal(_Model): + """The managed instance's service principal configuration for a resource. + + :ivar principal_id: The Azure Active Directory application object id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory application client id. + :vartype client_id: str + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :ivar type: Service principal type. Known values are: "None" and "SystemAssigned". + :vartype type: str or ~azure.mgmt.sql.models.ServicePrincipalType + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory application object id.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The Azure Active Directory application client id.""" + tenant_id: Optional[str] = rest_field(name="tenantId", visibility=["read"]) + """The Azure Active Directory tenant id.""" + type: Optional[Union[str, "_models.ServicePrincipalType"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Service principal type. Known values are: \"None\" and \"SystemAssigned\".""" + + @overload + def __init__( + self, + *, + type: Optional[Union[str, "_models.ServicePrincipalType"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Sku(_Model): + """An ARM Resource SKU. + + :ivar name: The name of the SKU, typically, a letter + Number code, e.g. P3. Required. + :vartype name: str + :ivar tier: The tier or edition of the particular SKU, e.g. Basic, Premium. + :vartype tier: str + :ivar size: Size of the particular SKU. + :vartype size: str + :ivar family: If the service has different generations of hardware, for the same SKU, then that + can be captured here. + :vartype family: str + :ivar capacity: Capacity of the particular SKU. + :vartype capacity: int + """ + + name: str = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name of the SKU, typically, a letter + Number code, e.g. P3. Required.""" + tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The tier or edition of the particular SKU, e.g. Basic, Premium.""" + size: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Size of the particular SKU.""" + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """If the service has different generations of hardware, for the same SKU, then that can be + captured here.""" + capacity: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Capacity of the particular SKU.""" + + @overload + def __init__( + self, + *, + name: str, + tier: Optional[str] = None, + size: Optional[str] = None, + family: Optional[str] = None, + capacity: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SqlAgentConfiguration(ProxyResource): + """A recoverable managed database resource. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SqlAgentConfigurationProperties + """ + + properties: Optional["_models.SqlAgentConfigurationProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SqlAgentConfigurationProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SqlAgentConfigurationProperties(_Model): + """Sql agent configuration properties. + + :ivar state: The state of Sql Agent. Known values are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState + """ + + state: Optional[Union[str, "_models.SqlAgentConfigurationPropertiesState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """The state of Sql Agent. Known values are: \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.SqlAgentConfigurationPropertiesState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SqlVulnerabilityAssessment(ProxyResource): + """A SQL Vulnerability Assessment. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentPolicyProperties + """ + + properties: Optional["_models.SqlVulnerabilityAssessmentPolicyProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SqlVulnerabilityAssessmentPolicyProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SqlVulnerabilityAssessmentPolicyProperties(_Model): # pylint: disable=name-too-long + """SqlVulnerabilityAssessmentPolicyProperties. + + :ivar state: Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or + disabled or a state has not been applied yet on the specific database or server. Known values + are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentState + """ + + state: Optional[Union[str, "_models.SqlVulnerabilityAssessmentState"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or disabled or a + state has not been applied yet on the specific database or server. Known values are: + \"Enabled\" and \"Disabled\".""" + + @overload + def __init__( + self, + *, + state: Optional[Union[str, "_models.SqlVulnerabilityAssessmentState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SqlVulnerabilityAssessmentScanError(_Model): + """Properties of a vulnerability assessment scan error. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + + +class SqlVulnerabilityAssessmentScanRecord(ProxyResource): + """A vulnerability assessment scan record. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecordProperties + """ + + properties: Optional["_models.SqlVulnerabilityAssessmentScanRecordProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "scan_id", + "trigger_type", + "state", + "start_time", + "end_time", + "errors", + "server", + "database", + "sql_version", + "high_severity_failed_rules_count", + "medium_severity_failed_rules_count", + "low_severity_failed_rules_count", + "total_passed_rules_count", + "total_failed_rules_count", + "total_rules_count", + "is_baseline_applied", + "last_scan_time", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SqlVulnerabilityAssessmentScanRecordProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SqlVulnerabilityAssessmentScanRecordProperties(_Model): # pylint: disable=name-too-long + """Properties of a vulnerability assessment scan record. + + :ivar scan_id: The scan ID. + :vartype scan_id: str + :ivar trigger_type: The scan trigger type. Known values are: "OnDemand" and "Recurring". + :vartype trigger_type: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType + :ivar state: The scan status. Known values are: "Passed", "Failed", "FailedToRun", and + "InProgress". + :vartype state: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState + :ivar start_time: The scan start time (UTC). + :vartype start_time: ~datetime.datetime + :ivar end_time: The scan end time (UTC). + :vartype end_time: ~datetime.datetime + :ivar errors: The scan errors. + :vartype errors: list[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanError] + :ivar server: The server name. + :vartype server: str + :ivar database: The database name. + :vartype database: str + :ivar sql_version: The SQL version. + :vartype sql_version: str + :ivar high_severity_failed_rules_count: The number of failed rules with high severity. + :vartype high_severity_failed_rules_count: int + :ivar medium_severity_failed_rules_count: The number of failed rules with medium severity. + :vartype medium_severity_failed_rules_count: int + :ivar low_severity_failed_rules_count: The number of failed rules with low severity. + :vartype low_severity_failed_rules_count: int + :ivar total_passed_rules_count: The number of total passed rules. + :vartype total_passed_rules_count: int + :ivar total_failed_rules_count: The number of total failed rules. + :vartype total_failed_rules_count: int + :ivar total_rules_count: The number of total rules assessed. + :vartype total_rules_count: int + :ivar is_baseline_applied: Baseline created for this database, and has one or more rules. + :vartype is_baseline_applied: bool + :ivar last_scan_time: The last scan time. + :vartype last_scan_time: ~datetime.datetime + """ + + scan_id: Optional[str] = rest_field(name="scanId", visibility=["read"]) + """The scan ID.""" + trigger_type: Optional[Union[str, "_models.VulnerabilityAssessmentScanTriggerType"]] = rest_field( + name="triggerType", visibility=["read"] + ) + """The scan trigger type. Known values are: \"OnDemand\" and \"Recurring\".""" + state: Optional[Union[str, "_models.VulnerabilityAssessmentScanState"]] = rest_field(visibility=["read"]) + """The scan status. Known values are: \"Passed\", \"Failed\", \"FailedToRun\", and \"InProgress\".""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The scan start time (UTC).""" + end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The scan end time (UTC).""" + errors: Optional[list["_models.SqlVulnerabilityAssessmentScanError"]] = rest_field(visibility=["read"]) + """The scan errors.""" + server: Optional[str] = rest_field(visibility=["read"]) + """The server name.""" + database: Optional[str] = rest_field(visibility=["read"]) + """The database name.""" + sql_version: Optional[str] = rest_field(name="sqlVersion", visibility=["read"]) + """The SQL version.""" + high_severity_failed_rules_count: Optional[int] = rest_field( + name="highSeverityFailedRulesCount", visibility=["read"] + ) + """The number of failed rules with high severity.""" + medium_severity_failed_rules_count: Optional[int] = rest_field( + name="mediumSeverityFailedRulesCount", visibility=["read"] + ) + """The number of failed rules with medium severity.""" + low_severity_failed_rules_count: Optional[int] = rest_field(name="lowSeverityFailedRulesCount", visibility=["read"]) + """The number of failed rules with low severity.""" + total_passed_rules_count: Optional[int] = rest_field(name="totalPassedRulesCount", visibility=["read"]) + """The number of total passed rules.""" + total_failed_rules_count: Optional[int] = rest_field(name="totalFailedRulesCount", visibility=["read"]) + """The number of total failed rules.""" + total_rules_count: Optional[int] = rest_field(name="totalRulesCount", visibility=["read"]) + """The number of total rules assessed.""" + is_baseline_applied: Optional[bool] = rest_field(name="isBaselineApplied", visibility=["read"]) + """Baseline created for this database, and has one or more rules.""" + last_scan_time: Optional[datetime.datetime] = rest_field(name="lastScanTime", visibility=["read"], format="rfc3339") + """The last scan time.""" + + +class SqlVulnerabilityAssessmentScanResultProperties(_Model): # pylint: disable=name-too-long + """SQL Vulnerability Assessment scan result properties for a single rule. + + :ivar rule_id: SQL Vulnerability Assessment rule Id. + :vartype rule_id: str + :ivar status: SQL Vulnerability Assessment rule result status. Known values are: "NonFinding", + "Finding", and "InternalError". + :vartype status: str or ~azure.mgmt.sql.models.RuleStatus + :ivar error_message: SQL Vulnerability Assessment error message. + :vartype error_message: str + :ivar is_trimmed: SQL Vulnerability Assessment is the query results trimmed. + :vartype is_trimmed: bool + :ivar query_results: SQL Vulnerability Assessment query results that was run. + :vartype query_results: list[list[str]] + :ivar remediation: SQL Vulnerability Assessment the remediation details. + :vartype remediation: ~azure.mgmt.sql.models.Remediation + :ivar baseline_adjusted_result: SQL Vulnerability Assessment rule result adjusted with + baseline. + :vartype baseline_adjusted_result: ~azure.mgmt.sql.models.BaselineAdjustedResult + :ivar rule_metadata: SQL Vulnerability Assessment rule metadata. + :vartype rule_metadata: ~azure.mgmt.sql.models.VaRule + """ + + rule_id: Optional[str] = rest_field(name="ruleId", visibility=["read"]) + """SQL Vulnerability Assessment rule Id.""" + status: Optional[Union[str, "_models.RuleStatus"]] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule result status. Known values are: \"NonFinding\", \"Finding\", + and \"InternalError\".""" + error_message: Optional[str] = rest_field(name="errorMessage", visibility=["read"]) + """SQL Vulnerability Assessment error message.""" + is_trimmed: Optional[bool] = rest_field(name="isTrimmed", visibility=["read"]) + """SQL Vulnerability Assessment is the query results trimmed.""" + query_results: Optional[list[list[str]]] = rest_field(name="queryResults", visibility=["read"]) + """SQL Vulnerability Assessment query results that was run.""" + remediation: Optional["_models.Remediation"] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment the remediation details.""" + baseline_adjusted_result: Optional["_models.BaselineAdjustedResult"] = rest_field( + name="baselineAdjustedResult", visibility=["read"] + ) + """SQL Vulnerability Assessment rule result adjusted with baseline.""" + rule_metadata: Optional["_models.VaRule"] = rest_field(name="ruleMetadata", visibility=["read"]) + """SQL Vulnerability Assessment rule metadata.""" + + +class SqlVulnerabilityAssessmentScanResults(ProxyResource): + """Concrete proxy resource types can be created by aliasing this type using a specific property + type. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResultProperties + """ + + properties: Optional["_models.SqlVulnerabilityAssessmentScanResultProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "rule_id", + "status", + "error_message", + "is_trimmed", + "query_results", + "remediation", + "baseline_adjusted_result", + "rule_metadata", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SqlVulnerabilityAssessmentScanResultProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class StartStopManagedInstanceSchedule(ProxyResource): + """Managed instance's Start/Stop schedule. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.StartStopManagedInstanceScheduleProperties + """ + + properties: Optional["_models.StartStopManagedInstanceScheduleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["description", "time_zone_id", "schedule_list", "next_run_action", "next_execution_time"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.StartStopManagedInstanceScheduleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class StartStopManagedInstanceScheduleProperties(_Model): # pylint: disable=name-too-long + """Properties of managed instance's Start/Stop schedule. + + :ivar description: The description of the schedule. + :vartype description: str + :ivar time_zone_id: The time zone of the schedule. + :vartype time_zone_id: str + :ivar schedule_list: Schedule list. Required. + :vartype schedule_list: list[~azure.mgmt.sql.models.ScheduleItem] + :ivar next_run_action: Next action to be executed (Start or Stop). + :vartype next_run_action: str + :ivar next_execution_time: Timestamp when the next action will be executed in the corresponding + schedule time zone. + :vartype next_execution_time: str + """ + + description: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The description of the schedule.""" + time_zone_id: Optional[str] = rest_field( + name="timeZoneId", visibility=["read", "create", "update", "delete", "query"] + ) + """The time zone of the schedule.""" + schedule_list: list["_models.ScheduleItem"] = rest_field( + name="scheduleList", visibility=["read", "create", "update", "delete", "query"] + ) + """Schedule list. Required.""" + next_run_action: Optional[str] = rest_field(name="nextRunAction", visibility=["read"]) + """Next action to be executed (Start or Stop).""" + next_execution_time: Optional[str] = rest_field(name="nextExecutionTime", visibility=["read"]) + """Timestamp when the next action will be executed in the corresponding schedule time zone.""" + + @overload + def __init__( + self, + *, + schedule_list: list["_models.ScheduleItem"], + description: Optional[str] = None, + time_zone_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class StorageCapability(_Model): + """The storage account type capability. + + :ivar storage_account_type: The storage account type for the database's backups. Known values + are: "GRS", "LRS", "ZRS", and "GZRS". + :vartype storage_account_type: str or + ~azure.mgmt.sql.models.StorageCapabilityStorageAccountType + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + storage_account_type: Optional[Union[str, "_models.StorageCapabilityStorageAccountType"]] = rest_field( + name="storageAccountType", visibility=["read"] + ) + """The storage account type for the database's backups. Known values are: \"GRS\", \"LRS\", + \"ZRS\", and \"GZRS\".""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SubscriptionUsage(ProxyResource): + """Usage Metric of a Subscription in a Location. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SubscriptionUsageProperties + """ + + properties: Optional["_models.SubscriptionUsageProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["display_name", "current_value", "limit", "unit"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SubscriptionUsageProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SubscriptionUsageProperties(_Model): + """Properties of a subscription usage. + + :ivar display_name: User-readable name of the metric. + :vartype display_name: str + :ivar current_value: Current value of the metric. + :vartype current_value: float + :ivar limit: Boundary value of the metric. + :vartype limit: float + :ivar unit: Unit of the metric. + :vartype unit: str + """ + + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """User-readable name of the metric.""" + current_value: Optional[float] = rest_field(name="currentValue", visibility=["read"]) + """Current value of the metric.""" + limit: Optional[float] = rest_field(visibility=["read"]) + """Boundary value of the metric.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Unit of the metric.""" + + +class SynapseLinkWorkspace(ProxyResourceAutoGenerated): + """Synapse link workspace resource. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SynapseLinkWorkspaceProperties + """ + + properties: Optional["_models.SynapseLinkWorkspaceProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["workspaces"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SynapseLinkWorkspaceProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SynapseLinkWorkspaceInfoProperties(_Model): + """Properties of a Synapse link workspaces. + + :ivar workspace_id: Synapse link workspace id. + :vartype workspace_id: str + :ivar link_connection_name: Link connection name. + :vartype link_connection_name: str + """ + + workspace_id: Optional[str] = rest_field( + name="workspaceId", visibility=["read", "create", "update", "delete", "query"] + ) + """Synapse link workspace id.""" + link_connection_name: Optional[str] = rest_field( + name="linkConnectionName", visibility=["read", "create", "update", "delete", "query"] + ) + """Link connection name.""" + + @overload + def __init__( + self, + *, + workspace_id: Optional[str] = None, + link_connection_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SynapseLinkWorkspaceProperties(_Model): + """Properties of a Synapse link workspaces. + + :ivar workspaces: List of all synapselink workspaces. + :vartype workspaces: list[~azure.mgmt.sql.models.SynapseLinkWorkspaceInfoProperties] + """ + + workspaces: Optional[list["_models.SynapseLinkWorkspaceInfoProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of all synapselink workspaces.""" + + @overload + def __init__( + self, + *, + workspaces: Optional[list["_models.SynapseLinkWorkspaceInfoProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncAgent(ProxyResource): + """An Azure SQL Database sync agent. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SyncAgentProperties + """ + + properties: Optional["_models.SyncAgentProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "name", + "sync_database_id", + "last_alive_time", + "state", + "is_up_to_date", + "expiry_time", + "version", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SyncAgentProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SyncAgentKeyProperties(_Model): + """Properties of an Azure SQL Database sync agent key. + + :ivar sync_agent_key: Key of sync agent. + :vartype sync_agent_key: str + """ + + sync_agent_key: Optional[str] = rest_field(name="syncAgentKey", visibility=["read"]) + """Key of sync agent.""" + + +class SyncAgentLinkedDatabase(ProxyResourceAutoGenerated): + """An Azure SQL Database sync agent linked database. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SyncAgentLinkedDatabaseProperties + """ + + properties: Optional["_models.SyncAgentLinkedDatabaseProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["database_type", "database_id", "description", "server_name", "database_name", "user_name"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SyncAgentLinkedDatabaseProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SyncAgentLinkedDatabaseProperties(_Model): + """Properties of an Azure SQL Database sync agent linked database. + + :ivar database_type: Type of the sync agent linked database. Known values are: + "AzureSqlDatabase" and "SqlServerDatabase". + :vartype database_type: str or ~azure.mgmt.sql.models.SyncMemberDbType + :ivar database_id: Id of the sync agent linked database. + :vartype database_id: str + :ivar description: Description of the sync agent linked database. + :vartype description: str + :ivar server_name: Server name of the sync agent linked database. + :vartype server_name: str + :ivar database_name: Database name of the sync agent linked database. + :vartype database_name: str + :ivar user_name: User name of the sync agent linked database. + :vartype user_name: str + """ + + database_type: Optional[Union[str, "_models.SyncMemberDbType"]] = rest_field( + name="databaseType", visibility=["read"] + ) + """Type of the sync agent linked database. Known values are: \"AzureSqlDatabase\" and + \"SqlServerDatabase\".""" + database_id: Optional[str] = rest_field(name="databaseId", visibility=["read"]) + """Id of the sync agent linked database.""" + description: Optional[str] = rest_field(visibility=["read"]) + """Description of the sync agent linked database.""" + server_name: Optional[str] = rest_field(name="serverName", visibility=["read"]) + """Server name of the sync agent linked database.""" + database_name: Optional[str] = rest_field(name="databaseName", visibility=["read"]) + """Database name of the sync agent linked database.""" + user_name: Optional[str] = rest_field(name="userName", visibility=["read"]) + """User name of the sync agent linked database.""" + + +class SyncAgentProperties(_Model): + """Properties of an Azure SQL Database sync agent. + + :ivar name: Name of the sync agent. + :vartype name: str + :ivar sync_database_id: ARM resource id of the sync database in the sync agent. + :vartype sync_database_id: str + :ivar last_alive_time: Last alive time of the sync agent. + :vartype last_alive_time: ~datetime.datetime + :ivar state: State of the sync agent. Known values are: "Online", "Offline", and + "NeverConnected". + :vartype state: str or ~azure.mgmt.sql.models.SyncAgentState + :ivar is_up_to_date: If the sync agent version is up to date. + :vartype is_up_to_date: bool + :ivar expiry_time: Expiration time of the sync agent version. + :vartype expiry_time: ~datetime.datetime + :ivar version: Version of the sync agent. + :vartype version: str + """ + + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the sync agent.""" + sync_database_id: Optional[str] = rest_field( + name="syncDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the sync database in the sync agent.""" + last_alive_time: Optional[datetime.datetime] = rest_field( + name="lastAliveTime", visibility=["read"], format="rfc3339" + ) + """Last alive time of the sync agent.""" + state: Optional[Union[str, "_models.SyncAgentState"]] = rest_field(visibility=["read"]) + """State of the sync agent. Known values are: \"Online\", \"Offline\", and \"NeverConnected\".""" + is_up_to_date: Optional[bool] = rest_field(name="isUpToDate", visibility=["read"]) + """If the sync agent version is up to date.""" + expiry_time: Optional[datetime.datetime] = rest_field(name="expiryTime", visibility=["read"], format="rfc3339") + """Expiration time of the sync agent version.""" + version: Optional[str] = rest_field(visibility=["read"]) + """Version of the sync agent.""" + + @overload + def __init__( + self, + *, + sync_database_id: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncDatabaseIdProperties(_Model): + """Properties of the sync database id. + + :ivar id: ARM resource id of sync database. + :vartype id: str + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """ARM resource id of sync database.""" + + +class SyncFullSchemaProperties(_Model): + """Properties of the database full schema. + + :ivar tables: List of tables in the database full schema. + :vartype tables: list[~azure.mgmt.sql.models.SyncFullSchemaTable] + :ivar last_update_time: Last update time of the database schema. + :vartype last_update_time: ~datetime.datetime + """ + + tables: Optional[list["_models.SyncFullSchemaTable"]] = rest_field(visibility=["read"]) + """List of tables in the database full schema.""" + last_update_time: Optional[datetime.datetime] = rest_field( + name="lastUpdateTime", visibility=["read"], format="rfc3339" + ) + """Last update time of the database schema.""" + + +class SyncFullSchemaTable(_Model): + """Properties of the table in the database full schema. + + :ivar columns: List of columns in the table of database full schema. + :vartype columns: list[~azure.mgmt.sql.models.SyncFullSchemaTableColumn] + :ivar error_id: Error id of the table. + :vartype error_id: str + :ivar has_error: If there is error in the table. + :vartype has_error: bool + :ivar name: Name of the table. + :vartype name: str + :ivar quoted_name: Quoted name of the table. + :vartype quoted_name: str + """ + + columns: Optional[list["_models.SyncFullSchemaTableColumn"]] = rest_field(visibility=["read"]) + """List of columns in the table of database full schema.""" + error_id: Optional[str] = rest_field(name="errorId", visibility=["read"]) + """Error id of the table.""" + has_error: Optional[bool] = rest_field(name="hasError", visibility=["read"]) + """If there is error in the table.""" + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the table.""" + quoted_name: Optional[str] = rest_field(name="quotedName", visibility=["read"]) + """Quoted name of the table.""" + + +class SyncFullSchemaTableColumn(_Model): + """Properties of the column in the table of database full schema. + + :ivar data_size: Data size of the column. + :vartype data_size: str + :ivar data_type: Data type of the column. + :vartype data_type: str + :ivar error_id: Error id of the column. + :vartype error_id: str + :ivar has_error: If there is error in the table. + :vartype has_error: bool + :ivar is_primary_key: If it is the primary key of the table. + :vartype is_primary_key: bool + :ivar name: Name of the column. + :vartype name: str + :ivar quoted_name: Quoted name of the column. + :vartype quoted_name: str + """ + + data_size: Optional[str] = rest_field(name="dataSize", visibility=["read"]) + """Data size of the column.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read"]) + """Data type of the column.""" + error_id: Optional[str] = rest_field(name="errorId", visibility=["read"]) + """Error id of the column.""" + has_error: Optional[bool] = rest_field(name="hasError", visibility=["read"]) + """If there is error in the table.""" + is_primary_key: Optional[bool] = rest_field(name="isPrimaryKey", visibility=["read"]) + """If it is the primary key of the table.""" + name: Optional[str] = rest_field(visibility=["read"]) + """Name of the column.""" + quoted_name: Optional[str] = rest_field(name="quotedName", visibility=["read"]) + """Quoted name of the column.""" + + +class SyncGroup(ProxyResource): + """An Azure SQL Database sync group. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SyncGroupProperties + :ivar sku: The name and capacity of the SKU. + :vartype sku: ~azure.mgmt.sql.models.Sku + :ivar identity: Sync group authentication information. + :vartype identity: ~azure.mgmt.sql.models.DataSyncParticipantIdentity + """ + + properties: Optional["_models.SyncGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + sku: Optional["_models.Sku"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The name and capacity of the SKU.""" + identity: Optional["_models.DataSyncParticipantIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Sync group authentication information.""" + + __flattened_items = [ + "interval", + "last_sync_time", + "conflict_resolution_policy", + "sync_database_id", + "hub_database_user_name", + "hub_database_password", + "sync_state", + "schema", + "enable_conflict_logging", + "conflict_logging_retention_in_days", + "use_private_link_connection", + "private_endpoint_name", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SyncGroupProperties"] = None, + sku: Optional["_models.Sku"] = None, + identity: Optional["_models.DataSyncParticipantIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SyncGroupLogProperties(_Model): + """Properties of an Azure SQL Database sync group log. + + :ivar timestamp: Timestamp of the sync group log. + :vartype timestamp: ~datetime.datetime + :ivar type: Type of the sync group log. Known values are: "All", "Error", "Warning", and + "Success". + :vartype type: str or ~azure.mgmt.sql.models.SyncGroupLogType + :ivar source: Source of the sync group log. + :vartype source: str + :ivar details: Details of the sync group log. + :vartype details: str + :ivar tracing_id: TracingId of the sync group log. + :vartype tracing_id: str + :ivar operation_status: OperationStatus of the sync group log. + :vartype operation_status: str + """ + + timestamp: Optional[datetime.datetime] = rest_field(visibility=["read"], format="rfc3339") + """Timestamp of the sync group log.""" + type: Optional[Union[str, "_models.SyncGroupLogType"]] = rest_field(visibility=["read"]) + """Type of the sync group log. Known values are: \"All\", \"Error\", \"Warning\", and \"Success\".""" + source: Optional[str] = rest_field(visibility=["read"]) + """Source of the sync group log.""" + details: Optional[str] = rest_field(visibility=["read"]) + """Details of the sync group log.""" + tracing_id: Optional[str] = rest_field(name="tracingId", visibility=["read"]) + """TracingId of the sync group log.""" + operation_status: Optional[str] = rest_field(name="operationStatus", visibility=["read"]) + """OperationStatus of the sync group log.""" + + +class SyncGroupProperties(_Model): + """Properties of a sync group with support to MI. + + :ivar interval: Sync interval of the sync group. + :vartype interval: int + :ivar last_sync_time: Last sync time of the sync group. + :vartype last_sync_time: ~datetime.datetime + :ivar conflict_resolution_policy: Conflict resolution policy of the sync group. Known values + are: "HubWin" and "MemberWin". + :vartype conflict_resolution_policy: str or ~azure.mgmt.sql.models.SyncConflictResolutionPolicy + :ivar sync_database_id: ARM resource id of the sync database in the sync group. + :vartype sync_database_id: str + :ivar hub_database_user_name: User name for the sync group hub database credential. + :vartype hub_database_user_name: str + :ivar hub_database_password: Password for the sync group hub database credential. + :vartype hub_database_password: str + :ivar sync_state: Sync state of the sync group. Known values are: "NotReady", "Error", + "Warning", "Progressing", and "Good". + :vartype sync_state: str or ~azure.mgmt.sql.models.SyncGroupState + :ivar schema: Sync schema of the sync group. + :vartype schema: ~azure.mgmt.sql.models.SyncGroupSchema + :ivar enable_conflict_logging: If conflict logging is enabled. + :vartype enable_conflict_logging: bool + :ivar conflict_logging_retention_in_days: Conflict logging retention period. + :vartype conflict_logging_retention_in_days: int + :ivar use_private_link_connection: If use private link connection is enabled. + :vartype use_private_link_connection: bool + :ivar private_endpoint_name: Private endpoint name of the sync group if use private link + connection is enabled. + :vartype private_endpoint_name: str + """ + + interval: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sync interval of the sync group.""" + last_sync_time: Optional[datetime.datetime] = rest_field(name="lastSyncTime", visibility=["read"], format="rfc3339") + """Last sync time of the sync group.""" + conflict_resolution_policy: Optional[Union[str, "_models.SyncConflictResolutionPolicy"]] = rest_field( + name="conflictResolutionPolicy", visibility=["read", "create", "update", "delete", "query"] + ) + """Conflict resolution policy of the sync group. Known values are: \"HubWin\" and \"MemberWin\".""" + sync_database_id: Optional[str] = rest_field( + name="syncDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the sync database in the sync group.""" + hub_database_user_name: Optional[str] = rest_field( + name="hubDatabaseUserName", visibility=["read", "create", "update", "delete", "query"] + ) + """User name for the sync group hub database credential.""" + hub_database_password: Optional[str] = rest_field(name="hubDatabasePassword", visibility=["create", "update"]) + """Password for the sync group hub database credential.""" + sync_state: Optional[Union[str, "_models.SyncGroupState"]] = rest_field(name="syncState", visibility=["read"]) + """Sync state of the sync group. Known values are: \"NotReady\", \"Error\", \"Warning\", + \"Progressing\", and \"Good\".""" + schema: Optional["_models.SyncGroupSchema"] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Sync schema of the sync group.""" + enable_conflict_logging: Optional[bool] = rest_field( + name="enableConflictLogging", visibility=["read", "create", "update", "delete", "query"] + ) + """If conflict logging is enabled.""" + conflict_logging_retention_in_days: Optional[int] = rest_field( + name="conflictLoggingRetentionInDays", visibility=["read", "create", "update", "delete", "query"] + ) + """Conflict logging retention period.""" + use_private_link_connection: Optional[bool] = rest_field( + name="usePrivateLinkConnection", visibility=["read", "create", "update", "delete", "query"] + ) + """If use private link connection is enabled.""" + private_endpoint_name: Optional[str] = rest_field(name="privateEndpointName", visibility=["read"]) + """Private endpoint name of the sync group if use private link connection is enabled.""" + + @overload + def __init__( + self, + *, + interval: Optional[int] = None, + conflict_resolution_policy: Optional[Union[str, "_models.SyncConflictResolutionPolicy"]] = None, + sync_database_id: Optional[str] = None, + hub_database_user_name: Optional[str] = None, + hub_database_password: Optional[str] = None, + schema: Optional["_models.SyncGroupSchema"] = None, + enable_conflict_logging: Optional[bool] = None, + conflict_logging_retention_in_days: Optional[int] = None, + use_private_link_connection: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncGroupSchema(_Model): + """Properties of sync group schema. + + :ivar tables: List of tables in sync group schema. + :vartype tables: list[~azure.mgmt.sql.models.SyncGroupSchemaTable] + :ivar master_sync_member_name: Name of master sync member where the schema is from. + :vartype master_sync_member_name: str + """ + + tables: Optional[list["_models.SyncGroupSchemaTable"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of tables in sync group schema.""" + master_sync_member_name: Optional[str] = rest_field( + name="masterSyncMemberName", visibility=["read", "create", "update", "delete", "query"] + ) + """Name of master sync member where the schema is from.""" + + @overload + def __init__( + self, + *, + tables: Optional[list["_models.SyncGroupSchemaTable"]] = None, + master_sync_member_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncGroupSchemaTable(_Model): + """Properties of table in sync group schema. + + :ivar columns: List of columns in sync group schema. + :vartype columns: list[~azure.mgmt.sql.models.SyncGroupSchemaTableColumn] + :ivar quoted_name: Quoted name of sync group schema table. + :vartype quoted_name: str + """ + + columns: Optional[list["_models.SyncGroupSchemaTableColumn"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of columns in sync group schema.""" + quoted_name: Optional[str] = rest_field( + name="quotedName", visibility=["read", "create", "update", "delete", "query"] + ) + """Quoted name of sync group schema table.""" + + @overload + def __init__( + self, + *, + columns: Optional[list["_models.SyncGroupSchemaTableColumn"]] = None, + quoted_name: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncGroupSchemaTableColumn(_Model): + """Properties of column in sync group table. + + :ivar quoted_name: Quoted name of sync group table column. + :vartype quoted_name: str + :ivar data_size: Data size of the column. + :vartype data_size: str + :ivar data_type: Data type of the column. + :vartype data_type: str + """ + + quoted_name: Optional[str] = rest_field( + name="quotedName", visibility=["read", "create", "update", "delete", "query"] + ) + """Quoted name of sync group table column.""" + data_size: Optional[str] = rest_field(name="dataSize", visibility=["read", "create", "update", "delete", "query"]) + """Data size of the column.""" + data_type: Optional[str] = rest_field(name="dataType", visibility=["read", "create", "update", "delete", "query"]) + """Data type of the column.""" + + @overload + def __init__( + self, + *, + quoted_name: Optional[str] = None, + data_size: Optional[str] = None, + data_type: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SyncMember(ProxyResource): + """An Azure SQL Database sync member. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.SyncMemberProperties + :ivar identity: Sync member authentication information. + :vartype identity: ~azure.mgmt.sql.models.DataSyncParticipantIdentity + """ + + properties: Optional["_models.SyncMemberProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + identity: Optional["_models.DataSyncParticipantIdentity"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Sync member authentication information.""" + + __flattened_items = [ + "database_type", + "sync_agent_id", + "sql_server_database_id", + "sync_member_azure_database_resource_id", + "use_private_link_connection", + "private_endpoint_name", + "server_name", + "database_name", + "user_name", + "password", + "sync_direction", + "sync_state", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.SyncMemberProperties"] = None, + identity: Optional["_models.DataSyncParticipantIdentity"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class SyncMemberProperties(_Model): + """Properties of a sync member with support to MI. + + :ivar database_type: Database type of the sync member. Known values are: "AzureSqlDatabase" and + "SqlServerDatabase". + :vartype database_type: str or ~azure.mgmt.sql.models.SyncMemberDbType + :ivar sync_agent_id: ARM resource id of the sync agent in the sync member. + :vartype sync_agent_id: str + :ivar sql_server_database_id: SQL Server database id of the sync member. + :vartype sql_server_database_id: str + :ivar sync_member_azure_database_resource_id: ARM resource id of the sync member logical + database, for sync members in Azure. + :vartype sync_member_azure_database_resource_id: str + :ivar use_private_link_connection: Whether to use private link connection. + :vartype use_private_link_connection: bool + :ivar private_endpoint_name: Private endpoint name of the sync member if use private link + connection is enabled, for sync members in Azure. + :vartype private_endpoint_name: str + :ivar server_name: Server name of the member database in the sync member. + :vartype server_name: str + :ivar database_name: Database name of the member database in the sync member. + :vartype database_name: str + :ivar user_name: User name of the member database in the sync member. + :vartype user_name: str + :ivar password: Password of the member database in the sync member. + :vartype password: str + :ivar sync_direction: Sync direction of the sync member. Known values are: "Bidirectional", + "OneWayMemberToHub", and "OneWayHubToMember". + :vartype sync_direction: str or ~azure.mgmt.sql.models.SyncDirection + :ivar sync_state: Sync state of the sync member. Known values are: "SyncInProgress", + "SyncSucceeded", "SyncFailed", "DisabledTombstoneCleanup", "DisabledBackupRestore", + "SyncSucceededWithWarnings", "SyncCancelling", "SyncCancelled", "UnProvisioned", + "Provisioning", "Provisioned", "ProvisionFailed", "DeProvisioning", "DeProvisioned", + "DeProvisionFailed", "Reprovisioning", "ReprovisionFailed", and "UnReprovisioned". + :vartype sync_state: str or ~azure.mgmt.sql.models.SyncMemberState + """ + + database_type: Optional[Union[str, "_models.SyncMemberDbType"]] = rest_field( + name="databaseType", visibility=["read", "create", "update", "delete", "query"] + ) + """Database type of the sync member. Known values are: \"AzureSqlDatabase\" and + \"SqlServerDatabase\".""" + sync_agent_id: Optional[str] = rest_field( + name="syncAgentId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the sync agent in the sync member.""" + sql_server_database_id: Optional[str] = rest_field( + name="sqlServerDatabaseId", visibility=["read", "create", "update", "delete", "query"] + ) + """SQL Server database id of the sync member.""" + sync_member_azure_database_resource_id: Optional[str] = rest_field( + name="syncMemberAzureDatabaseResourceId", visibility=["read", "create", "update", "delete", "query"] + ) + """ARM resource id of the sync member logical database, for sync members in Azure.""" + use_private_link_connection: Optional[bool] = rest_field( + name="usePrivateLinkConnection", visibility=["read", "create", "update", "delete", "query"] + ) + """Whether to use private link connection.""" + private_endpoint_name: Optional[str] = rest_field(name="privateEndpointName", visibility=["read"]) + """Private endpoint name of the sync member if use private link connection is enabled, for sync + members in Azure.""" + server_name: Optional[str] = rest_field( + name="serverName", visibility=["read", "create", "update", "delete", "query"] + ) + """Server name of the member database in the sync member.""" + database_name: Optional[str] = rest_field( + name="databaseName", visibility=["read", "create", "update", "delete", "query"] + ) + """Database name of the member database in the sync member.""" + user_name: Optional[str] = rest_field(name="userName", visibility=["read", "create", "update", "delete", "query"]) + """User name of the member database in the sync member.""" + password: Optional[str] = rest_field(visibility=["create", "update"]) + """Password of the member database in the sync member.""" + sync_direction: Optional[Union[str, "_models.SyncDirection"]] = rest_field( + name="syncDirection", visibility=["read", "create", "update", "delete", "query"] + ) + """Sync direction of the sync member. Known values are: \"Bidirectional\", \"OneWayMemberToHub\", + and \"OneWayHubToMember\".""" + sync_state: Optional[Union[str, "_models.SyncMemberState"]] = rest_field(name="syncState", visibility=["read"]) + """Sync state of the sync member. Known values are: \"SyncInProgress\", \"SyncSucceeded\", + \"SyncFailed\", \"DisabledTombstoneCleanup\", \"DisabledBackupRestore\", + \"SyncSucceededWithWarnings\", \"SyncCancelling\", \"SyncCancelled\", \"UnProvisioned\", + \"Provisioning\", \"Provisioned\", \"ProvisionFailed\", \"DeProvisioning\", \"DeProvisioned\", + \"DeProvisionFailed\", \"Reprovisioning\", \"ReprovisionFailed\", and \"UnReprovisioned\".""" + + @overload + def __init__( + self, + *, + database_type: Optional[Union[str, "_models.SyncMemberDbType"]] = None, + sync_agent_id: Optional[str] = None, + sql_server_database_id: Optional[str] = None, + sync_member_azure_database_resource_id: Optional[str] = None, + use_private_link_connection: Optional[bool] = None, + server_name: Optional[str] = None, + database_name: Optional[str] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + sync_direction: Optional[Union[str, "_models.SyncDirection"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class SystemData(_Model): + """Metadata pertaining to creation and last modification of the resource. + + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + created_by: Optional[str] = rest_field(name="createdBy", visibility=["read", "create", "update", "delete", "query"]) + """The identity that created the resource.""" + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="createdByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that created the resource. Known values are: \"User\", \"Application\", + \"ManagedIdentity\", and \"Key\".""" + created_at: Optional[datetime.datetime] = rest_field( + name="createdAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource creation (UTC).""" + last_modified_by: Optional[str] = rest_field( + name="lastModifiedBy", visibility=["read", "create", "update", "delete", "query"] + ) + """The identity that last modified the resource.""" + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = rest_field( + name="lastModifiedByType", visibility=["read", "create", "update", "delete", "query"] + ) + """The type of identity that last modified the resource. Known values are: \"User\", + \"Application\", \"ManagedIdentity\", and \"Key\".""" + last_modified_at: Optional[datetime.datetime] = rest_field( + name="lastModifiedAt", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + """The timestamp of resource last modification (UTC).""" + + @overload + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TdeCertificate(ProxyResourceAutoGenerated): + """A TDE certificate that can be uploaded into a server. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.TdeCertificateProperties + """ + + properties: Optional["_models.TdeCertificateProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["private_blob", "cert_password"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.TdeCertificateProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class TdeCertificateProperties(_Model): + """Properties of a TDE certificate. + + :ivar private_blob: The base64 encoded certificate private blob. Required. + :vartype private_blob: str + :ivar cert_password: The certificate password. + :vartype cert_password: str + """ + + private_blob: str = rest_field(name="privateBlob", visibility=["create", "update"]) + """The base64 encoded certificate private blob. Required.""" + cert_password: Optional[str] = rest_field(name="certPassword", visibility=["create", "update"]) + """The certificate password.""" + + @overload + def __init__( + self, + *, + private_blob: str, + cert_password: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TimeZone(ProxyResource): + """Time Zone property. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.TimeZoneProperties + """ + + properties: Optional["_models.TimeZoneProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["time_zone_id", "display_name"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.TimeZoneProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class TimeZoneProperties(_Model): + """The properties of a time zone. + + :ivar time_zone_id: The time zone id. + :vartype time_zone_id: str + :ivar display_name: The time zone display name. + :vartype display_name: str + """ + + time_zone_id: Optional[str] = rest_field(name="timeZoneId", visibility=["read"]) + """The time zone id.""" + display_name: Optional[str] = rest_field(name="displayName", visibility=["read"]) + """The time zone display name.""" + + +class TopQueries(_Model): + """TopQueries. + + :ivar number_of_queries: Requested number of top queries. + :vartype number_of_queries: int + :ivar aggregation_function: Aggregation function used to calculate query metrics. + :vartype aggregation_function: str + :ivar observation_metric: Metric used to rank queries. + :vartype observation_metric: str + :ivar interval_type: Interval type (length). Known values are: "PT1H" and "P1D". + :vartype interval_type: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: str + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: str + :ivar queries: List of top resource consuming queries with appropriate metric data. + :vartype queries: list[~azure.mgmt.sql.models.QueryStatisticsProperties] + """ + + number_of_queries: Optional[int] = rest_field(name="numberOfQueries", visibility=["read"]) + """Requested number of top queries.""" + aggregation_function: Optional[str] = rest_field(name="aggregationFunction", visibility=["read"]) + """Aggregation function used to calculate query metrics.""" + observation_metric: Optional[str] = rest_field(name="observationMetric", visibility=["read"]) + """Metric used to rank queries.""" + interval_type: Optional[Union[str, "_models.QueryTimeGrainType"]] = rest_field( + name="intervalType", visibility=["read"] + ) + """Interval type (length). Known values are: \"PT1H\" and \"P1D\".""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read"]) + """The start time for the metric (ISO-8601 format).""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read"]) + """The end time for the metric (ISO-8601 format).""" + queries: Optional[list["_models.QueryStatisticsProperties"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """List of top resource consuming queries with appropriate metric data.""" + + @overload + def __init__( + self, + *, + queries: Optional[list["_models.QueryStatisticsProperties"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class TransparentDataEncryptionProperties(_Model): + """Properties of a transparent data encryption scan. + + :ivar state: Specifies the state of the transparent data encryption. Required. Known values + are: "Enabled" and "Disabled". + :vartype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + :ivar scan_state: Specifies the encryption scan state of the transparent data encryption. Known + values are: "None", "Resume", "Running", "Suspend", "Aborted", and "Completed". + :vartype scan_state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionScanState + """ + + state: Union[str, "_models.TransparentDataEncryptionState"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the state of the transparent data encryption. Required. Known values are: \"Enabled\" + and \"Disabled\".""" + scan_state: Optional[Union[str, "_models.TransparentDataEncryptionScanState"]] = rest_field( + name="scanState", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies the encryption scan state of the transparent data encryption. Known values are: + \"None\", \"Resume\", \"Running\", \"Suspend\", \"Aborted\", and \"Completed\".""" + + @overload + def __init__( + self, + *, + state: Union[str, "_models.TransparentDataEncryptionState"], + scan_state: Optional[Union[str, "_models.TransparentDataEncryptionScanState"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateLongTermRetentionBackupParameters(_Model): + """Contains the information necessary to perform long term retention backup update operation. + + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParametersProperties + """ + + properties: Optional["_models.UpdateLongTermRetentionBackupParametersProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["requested_backup_storage_redundancy"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.UpdateLongTermRetentionBackupParametersProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class UpdateLongTermRetentionBackupParametersProperties(_Model): # pylint: disable=name-too-long + """Contains the properties to perform long term retention backup copy operation. + + :ivar requested_backup_storage_redundancy: The storage redundancy type of the copied backup. + Known values are: "Geo", "Local", "Zone", and "GeoZone". + :vartype requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + """ + + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = rest_field( + name="requestedBackupStorageRedundancy", visibility=["create"] + ) + """The storage redundancy type of the copied backup. Known values are: \"Geo\", \"Local\", + \"Zone\", and \"GeoZone\".""" + + @overload + def __init__( + self, + *, + requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpdateVirtualClusterDnsServersOperation(ProxyResourceAutoGenerated): + """A refresh DNS servers operation. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.VirtualClusterDnsServersProperties + """ + + properties: Optional["_models.VirtualClusterDnsServersProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["status"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.VirtualClusterDnsServersProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class UpsertManagedServerOperationParameters(_Model): + """UpsertManagedServerOperationParameters. + + :ivar family: + :vartype family: str + :ivar tier: + :vartype tier: str + :ivar v_cores: + :vartype v_cores: int + :ivar storage_size_in_gb: + :vartype storage_size_in_gb: int + """ + + family: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + tier: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + v_cores: Optional[int] = rest_field(name="vCores", visibility=["read", "create", "update", "delete", "query"]) + storage_size_in_gb: Optional[int] = rest_field( + name="storageSizeInGB", visibility=["read", "create", "update", "delete", "query"] + ) + + @overload + def __init__( + self, + *, + family: Optional[str] = None, + tier: Optional[str] = None, + v_cores: Optional[int] = None, + storage_size_in_gb: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class UpsertManagedServerOperationStepWithEstimatesAndDuration(_Model): # pylint: disable=name-too-long + """UpsertManagedServerOperationStepWithEstimatesAndDuration. + + :ivar step_start_time: + :vartype step_start_time: ~datetime.datetime + :ivar step_end_time: + :vartype step_end_time: ~datetime.datetime + :ivar time_elapsed: + :vartype time_elapsed: str + :ivar order: + :vartype order: int + :ivar name: + :vartype name: str + :ivar status: Known values are: "NotStarted", "InProgress", "SlowedDown", "Completed", + "Failed", and "Canceled". + :vartype status: str or + ~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus + """ + + step_start_time: Optional[datetime.datetime] = rest_field( + name="stepStartTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + step_end_time: Optional[datetime.datetime] = rest_field( + name="stepEndTime", visibility=["read", "create", "update", "delete", "query"], format="rfc3339" + ) + time_elapsed: Optional[str] = rest_field( + name="timeElapsed", visibility=["read", "create", "update", "delete", "query"] + ) + order: Optional[int] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + name: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + status: Optional[Union[str, "_models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus"]] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Known values are: \"NotStarted\", \"InProgress\", \"SlowedDown\", \"Completed\", \"Failed\", + and \"Canceled\".""" + + @overload + def __init__( + self, + *, + step_start_time: Optional[datetime.datetime] = None, + step_end_time: Optional[datetime.datetime] = None, + time_elapsed: Optional[str] = None, + order: Optional[int] = None, + name: Optional[str] = None, + status: Optional[Union[str, "_models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus"]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class Usage(_Model): + """ARM usage. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: ~azure.mgmt.sql.models.Name + :ivar type: Resource type. + :vartype type: str + :ivar unit: Usage unit. + :vartype unit: str + :ivar current_value: Usage current value. + :vartype current_value: int + :ivar limit: Usage limit. + :vartype limit: int + :ivar requested_limit: Usage requested limit. + :vartype requested_limit: int + """ + + id: Optional[str] = rest_field(visibility=["read"]) + """Resource ID.""" + name: Optional["_models.Name"] = rest_field(visibility=["read"]) + """Resource name.""" + type: Optional[str] = rest_field(visibility=["read"]) + """Resource type.""" + unit: Optional[str] = rest_field(visibility=["read"]) + """Usage unit.""" + current_value: Optional[int] = rest_field(name="currentValue", visibility=["read"]) + """Usage current value.""" + limit: Optional[int] = rest_field(visibility=["read"]) + """Usage limit.""" + requested_limit: Optional[int] = rest_field(name="requestedLimit", visibility=["read"]) + """Usage requested limit.""" + + +class UserIdentity(_Model): + """Azure Active Directory identity configuration for a resource. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + principal_id: Optional[str] = rest_field(name="principalId", visibility=["read"]) + """The Azure Active Directory principal id.""" + client_id: Optional[str] = rest_field(name="clientId", visibility=["read"]) + """The Azure Active Directory client id.""" + + +class VaRule(_Model): + """SQL Vulnerability Assessment rule metadata details. + + :ivar rule_id: SQL Vulnerability Assessment rule Id. + :vartype rule_id: str + :ivar severity: SQL Vulnerability Assessment rule severity. Known values are: "High", "Medium", + "Low", "Informational", and "Obsolete". + :vartype severity: str or ~azure.mgmt.sql.models.RuleSeverity + :ivar category: SQL Vulnerability Assessment rule category. + :vartype category: str + :ivar rule_type: SQL Vulnerability Assessment rule type. Known values are: "Binary", + "BaselineExpected", "PositiveList", and "NegativeList". + :vartype rule_type: str or ~azure.mgmt.sql.models.RuleType + :ivar title: SQL Vulnerability Assessment rule title. + :vartype title: str + :ivar description: SQL Vulnerability Assessment rule description. + :vartype description: str + :ivar rationale: SQL Vulnerability Assessment rule rationale. + :vartype rationale: str + :ivar query_check: SQL Vulnerability Assessment rule query details. + :vartype query_check: ~azure.mgmt.sql.models.QueryCheck + :ivar benchmark_references: SQL Vulnerability Assessment benchmark references. + :vartype benchmark_references: list[~azure.mgmt.sql.models.BenchmarkReference] + """ + + rule_id: Optional[str] = rest_field(name="ruleId", visibility=["read"]) + """SQL Vulnerability Assessment rule Id.""" + severity: Optional[Union[str, "_models.RuleSeverity"]] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule severity. Known values are: \"High\", \"Medium\", \"Low\", + \"Informational\", and \"Obsolete\".""" + category: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule category.""" + rule_type: Optional[Union[str, "_models.RuleType"]] = rest_field(name="ruleType", visibility=["read"]) + """SQL Vulnerability Assessment rule type. Known values are: \"Binary\", \"BaselineExpected\", + \"PositiveList\", and \"NegativeList\".""" + title: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule title.""" + description: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule description.""" + rationale: Optional[str] = rest_field(visibility=["read"]) + """SQL Vulnerability Assessment rule rationale.""" + query_check: Optional["_models.QueryCheck"] = rest_field(name="queryCheck", visibility=["read"]) + """SQL Vulnerability Assessment rule query details.""" + benchmark_references: Optional[list["_models.BenchmarkReference"]] = rest_field( + name="benchmarkReferences", visibility=["read"] + ) + """SQL Vulnerability Assessment benchmark references.""" + + +class VirtualCluster(TrackedResource): + """An Azure SQL virtual cluster. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + :ivar location: The geo-location where the resource lives. Required. + :vartype location: str + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.VirtualClusterProperties + """ + + properties: Optional["_models.VirtualClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["subnet_id", "version", "child_resources"] + + @overload + def __init__( + self, + *, + location: str, + tags: Optional[dict[str, str]] = None, + properties: Optional["_models.VirtualClusterProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class VirtualClusterDnsServersProperties(_Model): + """The properties of dns servers on virtual cluster. + + :ivar status: The status of the DNS refresh operation. Known values are: "Succeeded", "Failed", + and "InProgress". + :vartype status: str or ~azure.mgmt.sql.models.DNSRefreshOperationStatus + """ + + status: Optional[Union[str, "_models.DNSRefreshOperationStatus"]] = rest_field(visibility=["read"]) + """The status of the DNS refresh operation. Known values are: \"Succeeded\", \"Failed\", and + \"InProgress\".""" + + +class VirtualClusterProperties(_Model): + """The properties of a virtual cluster. + + :ivar subnet_id: Subnet resource ID for the virtual cluster. + :vartype subnet_id: str + :ivar version: Virtual cluster version. + :vartype version: str + :ivar child_resources: List of resources in this virtual cluster. + :vartype child_resources: list[str] + """ + + subnet_id: Optional[str] = rest_field(name="subnetId", visibility=["read"]) + """Subnet resource ID for the virtual cluster.""" + version: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Virtual cluster version.""" + child_resources: Optional[list[str]] = rest_field(name="childResources", visibility=["read"]) + """List of resources in this virtual cluster.""" + + @overload + def __init__( + self, + *, + version: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VirtualClusterUpdate(_Model): + """An update request for virtual cluster. + + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.VirtualClusterProperties + :ivar tags: Resource tags. + :vartype tags: dict[str, str] + """ + + properties: Optional["_models.VirtualClusterProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + tags: Optional[dict[str, str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Resource tags.""" + + __flattened_items = ["subnet_id", "version", "child_resources"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.VirtualClusterProperties"] = None, + tags: Optional[dict[str, str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class VirtualNetworkRule(ProxyResource): + """A virtual network rule. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.VirtualNetworkRuleProperties + """ + + properties: Optional["_models.VirtualNetworkRuleProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["virtual_network_subnet_id", "ignore_missing_vnet_service_endpoint", "state"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.VirtualNetworkRuleProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class VirtualNetworkRuleProperties(_Model): + """Properties of a virtual network rule. + + :ivar virtual_network_subnet_id: The ARM resource id of the virtual network subnet. Required. + :vartype virtual_network_subnet_id: str + :ivar ignore_missing_vnet_service_endpoint: Create firewall rule before the virtual network has + vnet service endpoint enabled. + :vartype ignore_missing_vnet_service_endpoint: bool + :ivar state: Virtual Network Rule State. Known values are: "Initializing", "InProgress", + "Ready", "Failed", "Deleting", and "Unknown". + :vartype state: str or ~azure.mgmt.sql.models.VirtualNetworkRuleState + """ + + virtual_network_subnet_id: str = rest_field( + name="virtualNetworkSubnetId", visibility=["read", "create", "update", "delete", "query"] + ) + """The ARM resource id of the virtual network subnet. Required.""" + ignore_missing_vnet_service_endpoint: Optional[bool] = rest_field( + name="ignoreMissingVnetServiceEndpoint", visibility=["read", "create", "update", "delete", "query"] + ) + """Create firewall rule before the virtual network has vnet service endpoint enabled.""" + state: Optional[Union[str, "_models.VirtualNetworkRuleState"]] = rest_field(visibility=["read"]) + """Virtual Network Rule State. Known values are: \"Initializing\", \"InProgress\", \"Ready\", + \"Failed\", \"Deleting\", and \"Unknown\".""" + + @overload + def __init__( + self, + *, + virtual_network_subnet_id: str, + ignore_missing_vnet_service_endpoint: Optional[bool] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VulnerabilityAssessmentRecurringScansProperties(_Model): # pylint: disable=name-too-long + """Properties of a Vulnerability Assessment recurring scans. + + :ivar is_enabled: Recurring scans state. + :vartype is_enabled: bool + :ivar email_subscription_admins: Specifies that the schedule scan notification will be is sent + to the subscription administrators. + :vartype email_subscription_admins: bool + :ivar emails: Specifies an array of e-mail addresses to which the scan notification is sent. + :vartype emails: list[str] + """ + + is_enabled: Optional[bool] = rest_field( + name="isEnabled", visibility=["read", "create", "update", "delete", "query"] + ) + """Recurring scans state.""" + email_subscription_admins: Optional[bool] = rest_field( + name="emailSubscriptionAdmins", visibility=["read", "create", "update", "delete", "query"] + ) + """Specifies that the schedule scan notification will be is sent to the subscription + administrators.""" + emails: Optional[list[str]] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """Specifies an array of e-mail addresses to which the scan notification is sent.""" + + @overload + def __init__( + self, + *, + is_enabled: Optional[bool] = None, + email_subscription_admins: Optional[bool] = None, + emails: Optional[list[str]] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class VulnerabilityAssessmentScanError(_Model): + """Properties of a vulnerability assessment scan error. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + """ + + code: Optional[str] = rest_field(visibility=["read"]) + """The error code.""" + message: Optional[str] = rest_field(visibility=["read"]) + """The error message.""" + + +class VulnerabilityAssessmentScanRecord(ProxyResource): + """A vulnerability assessment scan record. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordProperties + """ + + properties: Optional["_models.VulnerabilityAssessmentScanRecordProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "scan_id", + "trigger_type", + "state", + "start_time", + "end_time", + "errors", + "storage_container_path", + "number_of_failed_security_checks", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.VulnerabilityAssessmentScanRecordProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class VulnerabilityAssessmentScanRecordProperties(_Model): # pylint: disable=name-too-long + """Properties of a vulnerability assessment scan record. + + :ivar scan_id: The scan ID. + :vartype scan_id: str + :ivar trigger_type: The scan trigger type. Known values are: "OnDemand" and "Recurring". + :vartype trigger_type: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType + :ivar state: The scan status. Known values are: "Passed", "Failed", "FailedToRun", and + "InProgress". + :vartype state: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState + :ivar start_time: The scan start time (UTC). + :vartype start_time: ~datetime.datetime + :ivar end_time: The scan end time (UTC). + :vartype end_time: ~datetime.datetime + :ivar errors: The scan errors. + :vartype errors: list[~azure.mgmt.sql.models.VulnerabilityAssessmentScanError] + :ivar storage_container_path: The scan results storage container path. + :vartype storage_container_path: str + :ivar number_of_failed_security_checks: The number of failed security checks. + :vartype number_of_failed_security_checks: int + """ + + scan_id: Optional[str] = rest_field(name="scanId", visibility=["read"]) + """The scan ID.""" + trigger_type: Optional[Union[str, "_models.VulnerabilityAssessmentScanTriggerType"]] = rest_field( + name="triggerType", visibility=["read"] + ) + """The scan trigger type. Known values are: \"OnDemand\" and \"Recurring\".""" + state: Optional[Union[str, "_models.VulnerabilityAssessmentScanState"]] = rest_field(visibility=["read"]) + """The scan status. Known values are: \"Passed\", \"Failed\", \"FailedToRun\", and \"InProgress\".""" + start_time: Optional[datetime.datetime] = rest_field(name="startTime", visibility=["read"], format="rfc3339") + """The scan start time (UTC).""" + end_time: Optional[datetime.datetime] = rest_field(name="endTime", visibility=["read"], format="rfc3339") + """The scan end time (UTC).""" + errors: Optional[list["_models.VulnerabilityAssessmentScanError"]] = rest_field(visibility=["read"]) + """The scan errors.""" + storage_container_path: Optional[str] = rest_field(name="storageContainerPath", visibility=["read"]) + """The scan results storage container path.""" + number_of_failed_security_checks: Optional[int] = rest_field( + name="numberOfFailedSecurityChecks", visibility=["read"] + ) + """The number of failed security checks.""" + + +class WorkloadClassifier(ProxyResource): + """Workload classifier operations for a data warehouse. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.WorkloadClassifierProperties + """ + + properties: Optional["_models.WorkloadClassifierProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = ["member_name", "label", "context", "start_time", "end_time", "importance"] + + @overload + def __init__( + self, + *, + properties: Optional["_models.WorkloadClassifierProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class WorkloadClassifierProperties(_Model): + """Workload classifier definition. For more information look at + sys.workload_management_workload_classifiers (DMV). + + :ivar member_name: The workload classifier member name. Required. + :vartype member_name: str + :ivar label: The workload classifier label. + :vartype label: str + :ivar context: The workload classifier context. + :vartype context: str + :ivar start_time: The workload classifier start time for classification. + :vartype start_time: str + :ivar end_time: The workload classifier end time for classification. + :vartype end_time: str + :ivar importance: The workload classifier importance. + :vartype importance: str + """ + + member_name: str = rest_field(name="memberName", visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier member name. Required.""" + label: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier label.""" + context: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier context.""" + start_time: Optional[str] = rest_field(name="startTime", visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier start time for classification.""" + end_time: Optional[str] = rest_field(name="endTime", visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier end time for classification.""" + importance: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workload classifier importance.""" + + @overload + def __init__( + self, + *, + member_name: str, + label: Optional[str] = None, + context: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + importance: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class WorkloadGroup(ProxyResource): + """Workload group operations for a data warehouse. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.sql.models.ArmSystemData + :ivar properties: Resource properties. + :vartype properties: ~azure.mgmt.sql.models.WorkloadGroupProperties + """ + + properties: Optional["_models.WorkloadGroupProperties"] = rest_field( + visibility=["read", "create", "update", "delete", "query"] + ) + """Resource properties.""" + + __flattened_items = [ + "min_resource_percent", + "max_resource_percent", + "min_resource_percent_per_request", + "max_resource_percent_per_request", + "importance", + "query_execution_timeout", + ] + + @overload + def __init__( + self, + *, + properties: Optional["_models.WorkloadGroupProperties"] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + _flattened_input = {k: kwargs.pop(k) for k in kwargs.keys() & self.__flattened_items} + super().__init__(*args, **kwargs) + for k, v in _flattened_input.items(): + setattr(self, k, v) + + def __getattr__(self, name: str) -> Any: + if name in self.__flattened_items: + if self.properties is None: + return None + return getattr(self.properties, name) + raise AttributeError(f"'{self.__class__.__name__}' object has no attribute '{name}'") + + def __setattr__(self, key: str, value: Any) -> None: + if key in self.__flattened_items: + if self.properties is None: + self.properties = self._attr_to_rest_field["properties"]._class_type() + setattr(self.properties, key, value) + else: + super().__setattr__(key, value) + + +class WorkloadGroupProperties(_Model): + """Workload group definition. For more information look at sys.workload_management_workload_groups + (DMV). + + :ivar min_resource_percent: The workload group minimum percentage resource. Required. + :vartype min_resource_percent: int + :ivar max_resource_percent: The workload group cap percentage resource. Required. + :vartype max_resource_percent: int + :ivar min_resource_percent_per_request: The workload group request minimum grant percentage. + Required. + :vartype min_resource_percent_per_request: float + :ivar max_resource_percent_per_request: The workload group request maximum grant percentage. + :vartype max_resource_percent_per_request: float + :ivar importance: The workload group importance level. + :vartype importance: str + :ivar query_execution_timeout: The workload group query execution timeout. + :vartype query_execution_timeout: int + """ + + min_resource_percent: int = rest_field( + name="minResourcePercent", visibility=["read", "create", "update", "delete", "query"] + ) + """The workload group minimum percentage resource. Required.""" + max_resource_percent: int = rest_field( + name="maxResourcePercent", visibility=["read", "create", "update", "delete", "query"] + ) + """The workload group cap percentage resource. Required.""" + min_resource_percent_per_request: float = rest_field( + name="minResourcePercentPerRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """The workload group request minimum grant percentage. Required.""" + max_resource_percent_per_request: Optional[float] = rest_field( + name="maxResourcePercentPerRequest", visibility=["read", "create", "update", "delete", "query"] + ) + """The workload group request maximum grant percentage.""" + importance: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The workload group importance level.""" + query_execution_timeout: Optional[int] = rest_field( + name="queryExecutionTimeout", visibility=["read", "create", "update", "delete", "query"] + ) + """The workload group query execution timeout.""" + + @overload + def __init__( + self, + *, + min_resource_percent: int, + max_resource_percent: int, + min_resource_percent_per_request: float, + max_resource_percent_per_request: Optional[float] = None, + importance: Optional[str] = None, + query_execution_timeout: Optional[int] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) + + +class ZonePinningCapability(_Model): + """The zone pinning capability. + + :ivar availability_zone: Name of the availability zone. + :vartype availability_zone: str + :ivar status: The status of the capability. Known values are: "Visible", "Available", + "Default", and "Disabled". + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :ivar reason: The reason for the capability not being available. + :vartype reason: str + """ + + availability_zone: Optional[str] = rest_field(name="availabilityZone", visibility=["read"]) + """Name of the availability zone.""" + status: Optional[Union[str, "_models.CapabilityStatus"]] = rest_field(visibility=["read"]) + """The status of the capability. Known values are: \"Visible\", \"Available\", \"Default\", and + \"Disabled\".""" + reason: Optional[str] = rest_field(visibility=["read", "create", "update", "delete", "query"]) + """The reason for the capability not being available.""" + + @overload + def __init__( + self, + *, + reason: Optional[str] = None, + ) -> None: ... + + @overload + def __init__(self, mapping: Mapping[str, Any]) -> None: + """ + :param mapping: raw JSON to initialize the model. + :type mapping: Mapping[str, Any] + """ + + def __init__(self, *args: Any, **kwargs: Any) -> None: + super().__init__(*args, **kwargs) 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 deleted file mode 100644 index febaf8120837..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ /dev/null @@ -1,23992 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Optional, TYPE_CHECKING, Union - -from .._utils import serialization as _serialization - -if TYPE_CHECKING: - from .. import models as _models -JSON = MutableMapping[str, Any] - - -class AdministratorListResult(_serialization.Model): - """A list of active directory administrators. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerAzureADAdministrator]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerAzureADAdministrator"]] = None - self.next_link: Optional[str] = None - - -class Resource(_serialization.Model): - """ARM 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 - """ - - _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"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - - -class ProxyResource(Resource): - """ARM proxy 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 - """ - - -class Advisor(ProxyResource): - """Database, Server or Elastic Pool Advisor. - - 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 kind: Resource kind. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :ivar advisor_status: Gets the status of availability of this advisor to customers. Possible - values are 'GA', 'PublicPreview', 'LimitedPublicPreview' and 'PrivatePreview'. Known values - are: "GA", "PublicPreview", "LimitedPublicPreview", and "PrivatePreview". - :vartype advisor_status: str or ~azure.mgmt.sql.models.AdvisorStatus - :ivar auto_execute_status: Gets the auto-execute status (whether to let the system execute the - recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Known values - are: "Enabled", "Disabled", and "Default". - :vartype auto_execute_status: str or ~azure.mgmt.sql.models.AutoExecuteStatus - :ivar auto_execute_status_inherited_from: Gets the resource from which current value of - auto-execute status is inherited. Auto-execute status can be set on (and inherited from) - different levels in the resource hierarchy. Possible values are 'Subscription', 'Server', - 'ElasticPool', 'Database' and 'Default' (when status is not explicitly set on any level). Known - values are: "Default", "Subscription", "Server", "ElasticPool", and "Database". - :vartype auto_execute_status_inherited_from: str or - ~azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom - :ivar recommendations_status: Gets that status of recommendations for this advisor and reason - for not having any recommendations. Possible values include, but are not limited to, 'Ok' - (Recommendations available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' - (Database is doing well), etc. - :vartype recommendations_status: str - :ivar last_checked: Gets the time when the current resource was analyzed for recommendations by - this advisor. - :vartype last_checked: ~datetime.datetime - :ivar recommended_actions: Gets the recommended actions for this advisor. - :vartype recommended_actions: list[~azure.mgmt.sql.models.RecommendedAction] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "location": {"readonly": True}, - "advisor_status": {"readonly": True}, - "auto_execute_status_inherited_from": {"readonly": True}, - "recommendations_status": {"readonly": True}, - "last_checked": {"readonly": True}, - "recommended_actions": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "advisor_status": {"key": "properties.advisorStatus", "type": "str"}, - "auto_execute_status": {"key": "properties.autoExecuteStatus", "type": "str"}, - "auto_execute_status_inherited_from": {"key": "properties.autoExecuteStatusInheritedFrom", "type": "str"}, - "recommendations_status": {"key": "properties.recommendationsStatus", "type": "str"}, - "last_checked": {"key": "properties.lastChecked", "type": "iso-8601"}, - "recommended_actions": {"key": "properties.recommendedActions", "type": "[RecommendedAction]"}, - } - - def __init__( - self, *, auto_execute_status: Optional[Union[str, "_models.AutoExecuteStatus"]] = None, **kwargs: Any - ) -> None: - """ - :keyword auto_execute_status: Gets the auto-execute status (whether to let the system execute - the recommendations) of this advisor. Possible values are 'Enabled' and 'Disabled'. Known - values are: "Enabled", "Disabled", and "Default". - :paramtype auto_execute_status: str or ~azure.mgmt.sql.models.AutoExecuteStatus - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.location: Optional[str] = None - self.advisor_status: Optional[Union[str, "_models.AdvisorStatus"]] = None - self.auto_execute_status = auto_execute_status - self.auto_execute_status_inherited_from: Optional[Union[str, "_models.AutoExecuteStatusInheritedFrom"]] = None - self.recommendations_status: Optional[str] = None - self.last_checked: Optional[datetime.datetime] = None - self.recommended_actions: Optional[list["_models.RecommendedAction"]] = None - - -class AutomaticTuningOptions(_serialization.Model): - """Automatic tuning properties for individual advisors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar desired_state: Automatic tuning option desired state. Known values are: "Off", "On", and - "Default". - :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired - :ivar actual_state: Automatic tuning option actual state. Known values are: "Off" and "On". - :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeActual - :ivar reason_code: Reason code if desired and actual state are different. - :vartype reason_code: int - :ivar reason_desc: Reason description if desired and actual state are different. Known values - are: "Default", "Disabled", "AutoConfigured", "InheritedFromServer", "QueryStoreOff", - "QueryStoreReadOnly", and "NotSupported". - :vartype reason_desc: str or ~azure.mgmt.sql.models.AutomaticTuningDisabledReason - """ - - _validation = { - "actual_state": {"readonly": True}, - "reason_code": {"readonly": True}, - "reason_desc": {"readonly": True}, - } - - _attribute_map = { - "desired_state": {"key": "desiredState", "type": "str"}, - "actual_state": {"key": "actualState", "type": "str"}, - "reason_code": {"key": "reasonCode", "type": "int"}, - "reason_desc": {"key": "reasonDesc", "type": "str"}, - } - - def __init__( - self, *, desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = None, **kwargs: Any - ) -> None: - """ - :keyword desired_state: Automatic tuning option desired state. Known values are: "Off", "On", - and "Default". - :paramtype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired - """ - super().__init__(**kwargs) - self.desired_state = desired_state - self.actual_state: Optional[Union[str, "_models.AutomaticTuningOptionModeActual"]] = None - self.reason_code: Optional[int] = None - self.reason_desc: Optional[Union[str, "_models.AutomaticTuningDisabledReason"]] = None - - -class AutomaticTuningServerOptions(_serialization.Model): - """Automatic tuning properties for individual advisors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar desired_state: Automatic tuning option desired state. Known values are: "Off", "On", and - "Default". - :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired - :ivar actual_state: Automatic tuning option actual state. Known values are: "Off" and "On". - :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeActual - :ivar reason_code: Reason code if desired and actual state are different. - :vartype reason_code: int - :ivar reason_desc: Reason description if desired and actual state are different. Known values - are: "Default", "Disabled", and "AutoConfigured". - :vartype reason_desc: str or ~azure.mgmt.sql.models.AutomaticTuningServerReason - """ - - _validation = { - "actual_state": {"readonly": True}, - "reason_code": {"readonly": True}, - "reason_desc": {"readonly": True}, - } - - _attribute_map = { - "desired_state": {"key": "desiredState", "type": "str"}, - "actual_state": {"key": "actualState", "type": "str"}, - "reason_code": {"key": "reasonCode", "type": "int"}, - "reason_desc": {"key": "reasonDesc", "type": "str"}, - } - - def __init__( - self, *, desired_state: Optional[Union[str, "_models.AutomaticTuningOptionModeDesired"]] = None, **kwargs: Any - ) -> None: - """ - :keyword desired_state: Automatic tuning option desired state. Known values are: "Off", "On", - and "Default". - :paramtype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningOptionModeDesired - """ - super().__init__(**kwargs) - self.desired_state = desired_state - self.actual_state: Optional[Union[str, "_models.AutomaticTuningOptionModeActual"]] = None - self.reason_code: Optional[int] = None - self.reason_desc: Optional[Union[str, "_models.AutomaticTuningServerReason"]] = None - - -class AutoPauseDelayTimeRange(_serialization.Model): - """Supported auto pause delay time range. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar min_value: Minimum value. - :vartype min_value: int - :ivar max_value: Maximum value. - :vartype max_value: int - :ivar step_size: Step value for discrete values between the minimum value and the maximum - value. - :vartype step_size: int - :ivar default: Default value is no value is provided. - :vartype default: int - :ivar unit: Unit of time that delay is expressed in. "Minutes" - :vartype unit: str or ~azure.mgmt.sql.models.PauseDelayTimeUnit - :ivar do_not_pause_value: Value that is used to not pause (infinite delay before pause). - :vartype do_not_pause_value: int - """ - - _validation = { - "min_value": {"readonly": True}, - "max_value": {"readonly": True}, - "step_size": {"readonly": True}, - "default": {"readonly": True}, - "unit": {"readonly": True}, - "do_not_pause_value": {"readonly": True}, - } - - _attribute_map = { - "min_value": {"key": "minValue", "type": "int"}, - "max_value": {"key": "maxValue", "type": "int"}, - "step_size": {"key": "stepSize", "type": "int"}, - "default": {"key": "default", "type": "int"}, - "unit": {"key": "unit", "type": "str"}, - "do_not_pause_value": {"key": "doNotPauseValue", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.min_value: Optional[int] = None - self.max_value: Optional[int] = None - self.step_size: Optional[int] = None - self.default: Optional[int] = None - self.unit: Optional[Union[str, "_models.PauseDelayTimeUnit"]] = None - self.do_not_pause_value: Optional[int] = None - - -class AzureADOnlyAuthListResult(_serialization.Model): - """A list of active directory only authentications. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerAzureADOnlyAuthentication]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerAzureADOnlyAuthentication"]] = None - self.next_link: Optional[str] = None - - -class BackupShortTermRetentionPolicy(ProxyResource): - """A short term retention policy. - - 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 retention_days: The backup retention period in days. This is how many days Point-in-Time - Restore will be supported. - :vartype retention_days: int - :ivar diff_backup_interval_in_hours: The differential backup interval in hours. This is how - many interval hours between each differential backup will be supported. This is only applicable - to live databases but not dropped databases. Known values are: 12 and 24. - :vartype diff_backup_interval_in_hours: int or ~azure.mgmt.sql.models.DiffBackupIntervalInHours - """ - - _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"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "diff_backup_interval_in_hours": {"key": "properties.diffBackupIntervalInHours", "type": "int"}, - } - - def __init__( - self, - *, - retention_days: Optional[int] = None, - diff_backup_interval_in_hours: Optional[Union[int, "_models.DiffBackupIntervalInHours"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword retention_days: The backup retention period in days. This is how many days - Point-in-Time Restore will be supported. - :paramtype retention_days: int - :keyword diff_backup_interval_in_hours: The differential backup interval in hours. This is how - many interval hours between each differential backup will be supported. This is only applicable - to live databases but not dropped databases. Known values are: 12 and 24. - :paramtype diff_backup_interval_in_hours: int or - ~azure.mgmt.sql.models.DiffBackupIntervalInHours - """ - super().__init__(**kwargs) - self.retention_days = retention_days - self.diff_backup_interval_in_hours = diff_backup_interval_in_hours - - -class BackupShortTermRetentionPolicyListResult(_serialization.Model): - """A list of short term retention policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BackupShortTermRetentionPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.BackupShortTermRetentionPolicy"]] = None - self.next_link: Optional[str] = None - - -class Baseline(_serialization.Model): - """SQL Vulnerability Assessment baseline Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar expected_results: SQL Vulnerability Assessment baseline expected results. - :vartype expected_results: list[list[str]] - :ivar updated_time: SQL Vulnerability Assessment baseline update time (UTC). - :vartype updated_time: ~datetime.datetime - """ - - _validation = { - "expected_results": {"readonly": True}, - "updated_time": {"readonly": True}, - } - - _attribute_map = { - "expected_results": {"key": "expectedResults", "type": "[[str]]"}, - "updated_time": {"key": "updatedTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.expected_results: Optional[list[list[str]]] = None - self.updated_time: Optional[datetime.datetime] = None - - -class BaselineAdjustedResult(_serialization.Model): - """SQL Vulnerability Assessment baseline adjusted results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar baseline: SQL Vulnerability Assessment baseline details. - :vartype baseline: ~azure.mgmt.sql.models.Baseline - :ivar status: SQL Vulnerability Assessment baseline status. Known values are: "NonFinding", - "Finding", and "InternalError". - :vartype status: str or ~azure.mgmt.sql.models.RuleStatus - :ivar results_not_in_baseline: SQL Vulnerability Assessment results that are not in baseline. - :vartype results_not_in_baseline: list[list[str]] - :ivar results_only_in_baseline: SQL Vulnerability Assessment results that are in baseline. - :vartype results_only_in_baseline: list[list[str]] - """ - - _validation = { - "baseline": {"readonly": True}, - "status": {"readonly": True}, - "results_not_in_baseline": {"readonly": True}, - "results_only_in_baseline": {"readonly": True}, - } - - _attribute_map = { - "baseline": {"key": "baseline", "type": "Baseline"}, - "status": {"key": "status", "type": "str"}, - "results_not_in_baseline": {"key": "resultsNotInBaseline", "type": "[[str]]"}, - "results_only_in_baseline": {"key": "resultsOnlyInBaseline", "type": "[[str]]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.baseline: Optional["_models.Baseline"] = None - self.status: Optional[Union[str, "_models.RuleStatus"]] = None - self.results_not_in_baseline: Optional[list[list[str]]] = None - self.results_only_in_baseline: Optional[list[list[str]]] = None - - -class BenchmarkReference(_serialization.Model): - """SQL Vulnerability Assessment benchmark reference. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar benchmark: SQL Vulnerability Assessment benchmark name. - :vartype benchmark: str - :ivar reference: SQL Vulnerability Assessment benchmark reference. - :vartype reference: str - """ - - _validation = { - "benchmark": {"readonly": True}, - "reference": {"readonly": True}, - } - - _attribute_map = { - "benchmark": {"key": "benchmark", "type": "str"}, - "reference": {"key": "reference", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.benchmark: Optional[str] = None - self.reference: Optional[str] = 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: Optional[str] = None - self.expiry_date: Optional[datetime.datetime] = 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. - - All required parameters must be populated in order to send to server. - - :ivar backup_storage_access_tier: The long term retention backup storage access tier. Required. - :vartype backup_storage_access_tier: str - :ivar operation_mode: The operation mode when updating ltr backup storage access tier. - Required. - :vartype operation_mode: str - """ - - _validation = { - "backup_storage_access_tier": {"required": True}, - "operation_mode": {"required": True}, - } - - _attribute_map = { - "backup_storage_access_tier": {"key": "backupStorageAccessTier", "type": "str"}, - "operation_mode": {"key": "operationMode", "type": "str"}, - } - - def __init__(self, *, backup_storage_access_tier: str, operation_mode: str, **kwargs: Any) -> None: - """ - :keyword backup_storage_access_tier: The long term retention backup storage access tier. - Required. - :paramtype backup_storage_access_tier: str - :keyword operation_mode: The operation mode when updating ltr backup storage access tier. - Required. - :paramtype operation_mode: str - """ - super().__init__(**kwargs) - self.backup_storage_access_tier = backup_storage_access_tier - self.operation_mode = operation_mode - - -class CheckNameAvailabilityRequest(_serialization.Model): - """A request to check whether the specified name for a resource is available. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar name: Required. - :vartype name: str - :ivar type: Required. Default value is "Microsoft.Sql/servers". - :vartype type: str - """ - - _validation = { - "name": {"required": True}, - "type": {"required": True, "constant": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - type = "Microsoft.Sql/servers" - - def __init__(self, *, name: str, **kwargs: Any) -> None: - """ - :keyword name: Required. - :paramtype name: str - """ - super().__init__(**kwargs) - self.name = name - - -class CheckNameAvailabilityResponse(_serialization.Model): - """The result of a name availability check. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name whose availability was checked. - :vartype name: str - :ivar available: True if the name is available, otherwise false. - :vartype available: bool - :ivar reason: The reason code explaining why the name is unavailable. Will be undefined if the - name is available. Known values are: "Invalid" and "AlreadyExists". - :vartype reason: str or ~azure.mgmt.sql.models.CheckNameAvailabilityReason - :ivar message: A message explaining why the name is unavailable. Will be undefined if the name - is available. - :vartype message: str - """ - - _validation = { - "name": {"readonly": True}, - "available": {"readonly": True}, - "reason": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "available": {"key": "available", "type": "bool"}, - "reason": {"key": "reason", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.available: Optional[bool] = None - self.reason: Optional[Union[str, "_models.CheckNameAvailabilityReason"]] = None - self.message: Optional[str] = None - - -class CompleteDatabaseRestoreDefinition(_serialization.Model): - """Contains the information necessary to perform a complete database restore operation. - - All required parameters must be populated in order to send to server. - - :ivar last_backup_name: The last backup name to apply. Required. - :vartype last_backup_name: str - """ - - _validation = { - "last_backup_name": {"required": True}, - } - - _attribute_map = { - "last_backup_name": {"key": "lastBackupName", "type": "str"}, - } - - def __init__(self, *, last_backup_name: str, **kwargs: Any) -> None: - """ - :keyword last_backup_name: The last backup name to apply. Required. - :paramtype last_backup_name: str - """ - super().__init__(**kwargs) - self.last_backup_name = last_backup_name - - -class CopyLongTermRetentionBackupParameters(_serialization.Model): - """Contains the information necessary to perform long term retention backup copy operation. - - :ivar target_subscription_id: The subscription that owns the target server. - :vartype target_subscription_id: str - :ivar target_resource_group: The resource group that owns the target server. - :vartype target_resource_group: str - :ivar target_server_resource_id: The resource Id of the target server that owns the database. - :vartype target_server_resource_id: str - :ivar target_server_fully_qualified_domain_name: The fully qualified domain name of the target - server. - :vartype target_server_fully_qualified_domain_name: str - :ivar target_database_name: The name of the database owns the copied backup. - :vartype target_database_name: str - :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype target_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - """ - - _attribute_map = { - "target_subscription_id": {"key": "properties.targetSubscriptionId", "type": "str"}, - "target_resource_group": {"key": "properties.targetResourceGroup", "type": "str"}, - "target_server_resource_id": {"key": "properties.targetServerResourceId", "type": "str"}, - "target_server_fully_qualified_domain_name": { - "key": "properties.targetServerFullyQualifiedDomainName", - "type": "str", - }, - "target_database_name": {"key": "properties.targetDatabaseName", "type": "str"}, - "target_backup_storage_redundancy": {"key": "properties.targetBackupStorageRedundancy", "type": "str"}, - } - - def __init__( - self, - *, - target_subscription_id: Optional[str] = None, - target_resource_group: Optional[str] = None, - target_server_resource_id: Optional[str] = None, - target_server_fully_qualified_domain_name: Optional[str] = None, - target_database_name: Optional[str] = None, - target_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword target_subscription_id: The subscription that owns the target server. - :paramtype target_subscription_id: str - :keyword target_resource_group: The resource group that owns the target server. - :paramtype target_resource_group: str - :keyword target_server_resource_id: The resource Id of the target server that owns the - database. - :paramtype target_server_resource_id: str - :keyword target_server_fully_qualified_domain_name: The fully qualified domain name of the - target server. - :paramtype target_server_fully_qualified_domain_name: str - :keyword target_database_name: The name of the database owns the copied backup. - :paramtype target_database_name: str - :keyword target_backup_storage_redundancy: The storage redundancy type of the copied backup. - Known values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype target_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - """ - super().__init__(**kwargs) - self.target_subscription_id = target_subscription_id - self.target_resource_group = target_resource_group - self.target_server_resource_id = target_server_resource_id - self.target_server_fully_qualified_domain_name = target_server_fully_qualified_domain_name - self.target_database_name = target_database_name - self.target_backup_storage_redundancy = target_backup_storage_redundancy - - -class CreateDatabaseRestorePointDefinition(_serialization.Model): - """Contains the information necessary to perform a create database restore point operation. - - All required parameters must be populated in order to send to server. - - :ivar restore_point_label: The restore point label to apply. Required. - :vartype restore_point_label: str - """ - - _validation = { - "restore_point_label": {"required": True}, - } - - _attribute_map = { - "restore_point_label": {"key": "restorePointLabel", "type": "str"}, - } - - def __init__(self, *, restore_point_label: str, **kwargs: Any) -> None: - """ - :keyword restore_point_label: The restore point label to apply. Required. - :paramtype restore_point_label: str - """ - super().__init__(**kwargs) - self.restore_point_label = restore_point_label - - -class TrackedResource(Resource): - """ARM tracked top level resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__(self, *, location: str, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.location = location - self.tags = tags - - -class Database(TrackedResource): - """A database resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The database SKU. - - The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU - name, tier/edition, family, and capacity) that are available to your subscription in an Azure - region, use the ``Capabilities_ListByLocation`` REST API or one of the following commands: - - .. code-block:: azurecli - - az sql db list-editions -l -o table - ` - - .. code-block:: powershell - - Get-AzSqlServerServiceObjective -Location - `. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar kind: Kind of database. This is metadata used for the Azure portal experience. - :vartype kind: str - :ivar managed_by: Resource that manages the database. - :vartype managed_by: str - :ivar identity: The Azure Active Directory identity of the database. - :vartype identity: ~azure.mgmt.sql.models.DatabaseIdentity - :ivar create_mode: Specifies the mode of database creation. - - Default: regular database creation. - - Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified - as the resource ID of the source database. - - Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId - must be specified as the resource ID of the existing primary database. - - PointInTimeRestore: Creates a database by restoring a point in time backup of an existing - database. sourceDatabaseId must be specified as the resource ID of the existing database, and - restorePointInTime must be specified. - - Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be - specified as the recoverable database resource ID to restore. - - Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must - be specified. If sourceDatabaseId is the database's original resource ID, then - sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable - dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may - also be specified to restore from an earlier point in time. - - RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention - vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource - ID. - - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse - edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", - "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", - "RestoreLongTermRetentionBackup", and "OnlineSecondary". - :vartype create_mode: str or ~azure.mgmt.sql.models.CreateMode - :ivar collation: The collation of the database. - :vartype collation: str - :ivar max_size_bytes: The max size of the database expressed in bytes. - :vartype max_size_bytes: int - :ivar sample_name: The name of the sample schema to apply when creating this database. Known - values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". - :vartype sample_name: str or ~azure.mgmt.sql.models.SampleName - :ivar elastic_pool_id: The resource identifier of the elastic pool containing this database. - :vartype elastic_pool_id: str - :ivar source_database_id: The resource identifier of the source database associated with create - operation of this database. - :vartype source_database_id: str - :ivar status: The status of the database. Known values are: "Online", "Restoring", - "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", - "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", - "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled", "Stopping", "Stopped", and "Starting". - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: ~datetime.datetime - :ivar current_service_objective_name: The current service level objective name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level objective name of the - database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this database belongs to. - :vartype failover_group_id: str - :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar source_database_deletion_date: Specifies the time that the database was deleted. - :vartype source_database_deletion_date: ~datetime.datetime - :ivar recovery_services_recovery_point_id: The resource identifier of the recovery point - associated with create operation of this database. - :vartype recovery_services_recovery_point_id: str - :ivar long_term_retention_backup_resource_id: The resource identifier of the long term - retention backup associated with create operation of this database. - :vartype long_term_retention_backup_resource_id: str - :ivar recoverable_database_id: The resource identifier of the recoverable database associated - with create operation of this database. - :vartype recoverable_database_id: str - :ivar restorable_dropped_database_id: The resource identifier of the restorable dropped - database associated with create operation of this database. - :vartype restorable_dropped_database_id: str - :ivar catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :ivar zone_redundant: Whether or not this database is zone redundant, which means the replicas - of this database will be spread across multiple availability zones. - :vartype zone_redundant: bool - :ivar license_type: The license type to apply for this database. ``LicenseIncluded`` if you - need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid - Benefit. Known values are: "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: int - :ivar earliest_restore_date: This records the earliest start date and time that restore is - available for this database (ISO8601 format). - :vartype earliest_restore_date: ~datetime.datetime - :ivar read_scale: The state of read-only routing. If enabled, connections that have application - intent set to readonly in their connection string may be routed to a readonly secondary replica - in the same region. Not applicable to a Hyperscale database within an elastic pool. Known - values are: "Enabled" and "Disabled". - :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :ivar high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition database that are used to provide high - availability. Not applicable to a Hyperscale database within an elastic pool. - :vartype high_availability_replica_count: int - :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values - are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". - :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :ivar current_sku: The name and tier of the SKU. - :vartype current_sku: ~azure.mgmt.sql.models.Sku - :ivar auto_pause_delay: Time in minutes after which database is automatically paused. A value - of -1 means that automatic pause is disabled. - :vartype auto_pause_delay: int - :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups - for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar min_capacity: Minimal capacity that database will always have allocated, if not paused. - :vartype min_capacity: float - :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 - format). Null if the database is ready. - :vartype paused_date: ~datetime.datetime - :ivar resumed_date: The date when database was resumed by user action or database login - (ISO8601 format). Null if the database is paused. - :vartype resumed_date: ~datetime.datetime - :ivar maintenance_configuration_id: Maintenance configuration id assigned to the database. This - configuration defines the period when the maintenance updates will occur. - :vartype maintenance_configuration_id: str - :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables - in the database are ledger tables. Note: the value of this property cannot be changed after the - database has been created. - :vartype is_ledger_on: bool - :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. - :vartype is_infra_encryption_enabled: bool - :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. - :vartype federated_client_id: str - :ivar keys: The resource ids of the user assigned identities to use. - :vartype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - :ivar encryption_protector: The azure key vault URI of the database if it's configured with per - Database Customer Managed Keys. - :vartype encryption_protector: str - :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS - enclaves. Known values are: "Default" and "VBS". - :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :ivar use_free_limit: Whether or not the database uses free monthly limits. Allowed on one - database in a subscription. - :vartype use_free_limit: bool - :ivar free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are - exhausted for the free database. - - AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the - month. - - BillForUsage: The database will continue to be online upon exhaustion of free limits and any - overage will be billed. Known values are: "AutoPause" and "BillOverUsage". - :vartype free_limit_exhaustion_behavior: str or - ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior - :ivar source_resource_id: The resource identifier of the source associated with the create - operation of this database. - - This property is only supported for DataWarehouse edition and allows to restore across - subscriptions. - - When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, - restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode - must be PointInTimeRestore, Restore or Recover. - - When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing - database or existing sql pool, and restorePointInTime must be specified. - - When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped - database or restorable dropped sql pool. - - When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or - recoverable sql pool. - - When source subscription belongs to a different tenant than target subscription, - “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. - For more details about “x-ms-authorization-auxiliary” header see - https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant. - :vartype source_resource_id: str - :ivar manual_cutover: Whether or not customer controlled manual cutover needs to be done during - Update Database operation to Hyperscale tier. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier. - - When manualCutover is specified, the scaling operation will wait for user input to trigger - cutover to Hyperscale database. - - To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in - Waiting state. - :vartype manual_cutover: bool - :ivar perform_cutover: To trigger customer controlled manual cutover during the wait state - while Scaling operation is in progress. - - This property parameter is only applicable for scaling operations that are initiated along with - 'manualCutover' parameter. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier is already in progress. - - When performCutover is specified, the scaling operation will trigger cutover and perform - role-change to Hyperscale database. - :vartype perform_cutover: bool - :ivar availability_zone: Specifies the availability zone the database is pinned to. Known - values are: "NoPreference", "1", "2", and "3". - :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - :ivar encryption_protector_auto_rotation: The flag to enable or disable auto rotation of - database encryption protector AKV key. - :vartype encryption_protector_auto_rotation: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "kind": {"readonly": True}, - "managed_by": {"readonly": True}, - "status": {"readonly": True}, - "database_id": {"readonly": True}, - "creation_date": {"readonly": True}, - "current_service_objective_name": {"readonly": True}, - "requested_service_objective_name": {"readonly": True}, - "default_secondary_location": {"readonly": True}, - "failover_group_id": {"readonly": True}, - "max_log_size_bytes": {"readonly": True}, - "earliest_restore_date": {"readonly": True}, - "current_sku": {"readonly": True}, - "current_backup_storage_redundancy": {"readonly": True}, - "paused_date": {"readonly": True}, - "resumed_date": {"readonly": True}, - "is_infra_encryption_enabled": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "kind": {"key": "kind", "type": "str"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "identity": {"key": "identity", "type": "DatabaseIdentity"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "collation": {"key": "properties.collation", "type": "str"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "int"}, - "sample_name": {"key": "properties.sampleName", "type": "str"}, - "elastic_pool_id": {"key": "properties.elasticPoolId", "type": "str"}, - "source_database_id": {"key": "properties.sourceDatabaseId", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "database_id": {"key": "properties.databaseId", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "current_service_objective_name": {"key": "properties.currentServiceObjectiveName", "type": "str"}, - "requested_service_objective_name": {"key": "properties.requestedServiceObjectiveName", "type": "str"}, - "default_secondary_location": {"key": "properties.defaultSecondaryLocation", "type": "str"}, - "failover_group_id": {"key": "properties.failoverGroupId", "type": "str"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "source_database_deletion_date": {"key": "properties.sourceDatabaseDeletionDate", "type": "iso-8601"}, - "recovery_services_recovery_point_id": {"key": "properties.recoveryServicesRecoveryPointId", "type": "str"}, - "long_term_retention_backup_resource_id": { - "key": "properties.longTermRetentionBackupResourceId", - "type": "str", - }, - "recoverable_database_id": {"key": "properties.recoverableDatabaseId", "type": "str"}, - "restorable_dropped_database_id": {"key": "properties.restorableDroppedDatabaseId", "type": "str"}, - "catalog_collation": {"key": "properties.catalogCollation", "type": "str"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "max_log_size_bytes": {"key": "properties.maxLogSizeBytes", "type": "int"}, - "earliest_restore_date": {"key": "properties.earliestRestoreDate", "type": "iso-8601"}, - "read_scale": {"key": "properties.readScale", "type": "str"}, - "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, - "secondary_type": {"key": "properties.secondaryType", "type": "str"}, - "current_sku": {"key": "properties.currentSku", "type": "Sku"}, - "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, - "current_backup_storage_redundancy": {"key": "properties.currentBackupStorageRedundancy", "type": "str"}, - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - "min_capacity": {"key": "properties.minCapacity", "type": "float"}, - "paused_date": {"key": "properties.pausedDate", "type": "iso-8601"}, - "resumed_date": {"key": "properties.resumedDate", "type": "iso-8601"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, - "is_infra_encryption_enabled": {"key": "properties.isInfraEncryptionEnabled", "type": "bool"}, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - "keys": {"key": "properties.keys", "type": "{DatabaseKey}"}, - "encryption_protector": {"key": "properties.encryptionProtector", "type": "str"}, - "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, - "use_free_limit": {"key": "properties.useFreeLimit", "type": "bool"}, - "free_limit_exhaustion_behavior": {"key": "properties.freeLimitExhaustionBehavior", "type": "str"}, - "source_resource_id": {"key": "properties.sourceResourceId", "type": "str"}, - "manual_cutover": {"key": "properties.manualCutover", "type": "bool"}, - "perform_cutover": {"key": "properties.performCutover", "type": "bool"}, - "availability_zone": {"key": "properties.availabilityZone", "type": "str"}, - "encryption_protector_auto_rotation": {"key": "properties.encryptionProtectorAutoRotation", "type": "bool"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - identity: Optional["_models.DatabaseIdentity"] = None, - create_mode: Optional[Union[str, "_models.CreateMode"]] = None, - collation: Optional[str] = None, - max_size_bytes: Optional[int] = None, - sample_name: Optional[Union[str, "_models.SampleName"]] = None, - elastic_pool_id: Optional[str] = None, - source_database_id: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - source_database_deletion_date: Optional[datetime.datetime] = None, - recovery_services_recovery_point_id: Optional[str] = None, - long_term_retention_backup_resource_id: Optional[str] = None, - recoverable_database_id: Optional[str] = None, - restorable_dropped_database_id: Optional[str] = None, - catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, - zone_redundant: Optional[bool] = None, - license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = None, - read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = None, - high_availability_replica_count: Optional[int] = None, - secondary_type: Optional[Union[str, "_models.SecondaryType"]] = None, - auto_pause_delay: Optional[int] = None, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - min_capacity: Optional[float] = None, - maintenance_configuration_id: Optional[str] = None, - is_ledger_on: Optional[bool] = None, - federated_client_id: Optional[str] = None, - keys: Optional[dict[str, "_models.DatabaseKey"]] = None, - encryption_protector: Optional[str] = None, - preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, - use_free_limit: Optional[bool] = None, - free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None, - source_resource_id: Optional[str] = None, - manual_cutover: Optional[bool] = None, - perform_cutover: Optional[bool] = None, - availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, - encryption_protector_auto_rotation: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The database SKU. - - The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU - name, tier/edition, family, and capacity) that are available to your subscription in an Azure - region, use the ``Capabilities_ListByLocation`` REST API or one of the following commands: - - .. code-block:: azurecli - - az sql db list-editions -l -o table - ` - - .. code-block:: powershell - - Get-AzSqlServerServiceObjective -Location - `. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword identity: The Azure Active Directory identity of the database. - :paramtype identity: ~azure.mgmt.sql.models.DatabaseIdentity - :keyword create_mode: Specifies the mode of database creation. - - Default: regular database creation. - - Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified - as the resource ID of the source database. - - Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId - must be specified as the resource ID of the existing primary database. - - PointInTimeRestore: Creates a database by restoring a point in time backup of an existing - database. sourceDatabaseId must be specified as the resource ID of the existing database, and - restorePointInTime must be specified. - - Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be - specified as the recoverable database resource ID to restore. - - Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must - be specified. If sourceDatabaseId is the database's original resource ID, then - sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable - dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may - also be specified to restore from an earlier point in time. - - RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention - vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource - ID. - - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse - edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", - "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", - "RestoreLongTermRetentionBackup", and "OnlineSecondary". - :paramtype create_mode: str or ~azure.mgmt.sql.models.CreateMode - :keyword collation: The collation of the database. - :paramtype collation: str - :keyword max_size_bytes: The max size of the database expressed in bytes. - :paramtype max_size_bytes: int - :keyword sample_name: The name of the sample schema to apply when creating this database. Known - values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". - :paramtype sample_name: str or ~azure.mgmt.sql.models.SampleName - :keyword elastic_pool_id: The resource identifier of the elastic pool containing this database. - :paramtype elastic_pool_id: str - :keyword source_database_id: The resource identifier of the source database associated with - create operation of this database. - :paramtype source_database_id: str - :keyword restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword source_database_deletion_date: Specifies the time that the database was deleted. - :paramtype source_database_deletion_date: ~datetime.datetime - :keyword recovery_services_recovery_point_id: The resource identifier of the recovery point - associated with create operation of this database. - :paramtype recovery_services_recovery_point_id: str - :keyword long_term_retention_backup_resource_id: The resource identifier of the long term - retention backup associated with create operation of this database. - :paramtype long_term_retention_backup_resource_id: str - :keyword recoverable_database_id: The resource identifier of the recoverable database - associated with create operation of this database. - :paramtype recoverable_database_id: str - :keyword restorable_dropped_database_id: The resource identifier of the restorable dropped - database associated with create operation of this database. - :paramtype restorable_dropped_database_id: str - :keyword catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :paramtype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :keyword zone_redundant: Whether or not this database is zone redundant, which means the - replicas of this database will be spread across multiple availability zones. - :paramtype zone_redundant: bool - :keyword license_type: The license type to apply for this database. ``LicenseIncluded`` if you - need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid - Benefit. Known values are: "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :keyword read_scale: The state of read-only routing. If enabled, connections that have - application intent set to readonly in their connection string may be routed to a readonly - secondary replica in the same region. Not applicable to a Hyperscale database within an elastic - pool. Known values are: "Enabled" and "Disabled". - :paramtype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :keyword high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition database that are used to provide high - availability. Not applicable to a Hyperscale database within an elastic pool. - :paramtype high_availability_replica_count: int - :keyword secondary_type: The secondary type of the database if it is a secondary. Valid values - are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". - :paramtype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :keyword auto_pause_delay: Time in minutes after which database is automatically paused. A - value of -1 means that automatic pause is disabled. - :paramtype auto_pause_delay: int - :keyword requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword min_capacity: Minimal capacity that database will always have allocated, if not - paused. - :paramtype min_capacity: float - :keyword maintenance_configuration_id: Maintenance configuration id assigned to the database. - This configuration defines the period when the maintenance updates will occur. - :paramtype maintenance_configuration_id: str - :keyword is_ledger_on: Whether or not this database is a ledger database, which means all - tables in the database are ledger tables. Note: the value of this property cannot be changed - after the database has been created. - :paramtype is_ledger_on: bool - :keyword federated_client_id: The Client id used for cross tenant per database CMK scenario. - :paramtype federated_client_id: str - :keyword keys: The resource ids of the user assigned identities to use. - :paramtype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - :keyword encryption_protector: The azure key vault URI of the database if it's configured with - per Database Customer Managed Keys. - :paramtype encryption_protector: str - :keyword preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS - enclaves. Known values are: "Default" and "VBS". - :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :keyword use_free_limit: Whether or not the database uses free monthly limits. Allowed on one - database in a subscription. - :paramtype use_free_limit: bool - :keyword free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are - exhausted for the free database. - - AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the - month. - - BillForUsage: The database will continue to be online upon exhaustion of free limits and any - overage will be billed. Known values are: "AutoPause" and "BillOverUsage". - :paramtype free_limit_exhaustion_behavior: str or - ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior - :keyword source_resource_id: The resource identifier of the source associated with the create - operation of this database. - - This property is only supported for DataWarehouse edition and allows to restore across - subscriptions. - - When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, - restorableDroppedDatabaseId and sourceDatabaseDeletionDate must not be specified and CreateMode - must be PointInTimeRestore, Restore or Recover. - - When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing - database or existing sql pool, and restorePointInTime must be specified. - - When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped - database or restorable dropped sql pool. - - When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or - recoverable sql pool. - - When source subscription belongs to a different tenant than target subscription, - “x-ms-authorization-auxiliary” header must contain authentication token for the source tenant. - For more details about “x-ms-authorization-auxiliary” header see - https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant. - :paramtype source_resource_id: str - :keyword manual_cutover: Whether or not customer controlled manual cutover needs to be done - during Update Database operation to Hyperscale tier. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier. - - When manualCutover is specified, the scaling operation will wait for user input to trigger - cutover to Hyperscale database. - - To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in - Waiting state. - :paramtype manual_cutover: bool - :keyword perform_cutover: To trigger customer controlled manual cutover during the wait state - while Scaling operation is in progress. - - This property parameter is only applicable for scaling operations that are initiated along with - 'manualCutover' parameter. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier is already in progress. - - When performCutover is specified, the scaling operation will trigger cutover and perform - role-change to Hyperscale database. - :paramtype perform_cutover: bool - :keyword availability_zone: Specifies the availability zone the database is pinned to. Known - values are: "NoPreference", "1", "2", and "3". - :paramtype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - :keyword encryption_protector_auto_rotation: The flag to enable or disable auto rotation of - database encryption protector AKV key. - :paramtype encryption_protector_auto_rotation: bool - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.kind: Optional[str] = None - self.managed_by: Optional[str] = None - self.identity = identity - self.create_mode = create_mode - self.collation = collation - self.max_size_bytes = max_size_bytes - self.sample_name = sample_name - self.elastic_pool_id = elastic_pool_id - self.source_database_id = source_database_id - self.status: Optional[Union[str, "_models.DatabaseStatus"]] = None - self.database_id: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.current_service_objective_name: Optional[str] = None - self.requested_service_objective_name: Optional[str] = None - self.default_secondary_location: Optional[str] = None - self.failover_group_id: Optional[str] = None - self.restore_point_in_time = restore_point_in_time - self.source_database_deletion_date = source_database_deletion_date - self.recovery_services_recovery_point_id = recovery_services_recovery_point_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.recoverable_database_id = recoverable_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.catalog_collation = catalog_collation - self.zone_redundant = zone_redundant - self.license_type = license_type - self.max_log_size_bytes: Optional[int] = None - self.earliest_restore_date: Optional[datetime.datetime] = None - self.read_scale = read_scale - self.high_availability_replica_count = high_availability_replica_count - self.secondary_type = secondary_type - self.current_sku: Optional["_models.Sku"] = None - self.auto_pause_delay = auto_pause_delay - self.current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - self.min_capacity = min_capacity - self.paused_date: Optional[datetime.datetime] = None - self.resumed_date: Optional[datetime.datetime] = None - self.maintenance_configuration_id = maintenance_configuration_id - self.is_ledger_on = is_ledger_on - self.is_infra_encryption_enabled: Optional[bool] = None - self.federated_client_id = federated_client_id - self.keys = keys - self.encryption_protector = encryption_protector - self.preferred_enclave_type = preferred_enclave_type - self.use_free_limit = use_free_limit - self.free_limit_exhaustion_behavior = free_limit_exhaustion_behavior - self.source_resource_id = source_resource_id - self.manual_cutover = manual_cutover - self.perform_cutover = perform_cutover - self.availability_zone = availability_zone - self.encryption_protector_auto_rotation = encryption_protector_auto_rotation - - -class DatabaseAdvancedThreatProtection(ProxyResource): - """A database Advanced Threat Protection. - - 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 system_data: SystemData of AdvancedThreatProtectionResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.AdvancedThreatProtectionState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.creation_time: Optional[datetime.datetime] = None - - -class DatabaseAdvancedThreatProtectionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the database's Advanced Threat Protection configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseAdvancedThreatProtection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseAdvancedThreatProtection"]] = None - self.next_link: Optional[str] = None - - -class DatabaseAutomaticTuning(ProxyResource): - """Database-level Automatic Tuning. - - 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 desired_state: Automatic tuning desired state. Known values are: "Inherit", "Custom", - "Auto", and "Unspecified". - :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningMode - :ivar actual_state: Automatic tuning actual state. Known values are: "Inherit", "Custom", - "Auto", and "Unspecified". - :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningMode - :ivar options: Automatic tuning options definition. - :vartype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningOptions] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "actual_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "desired_state": {"key": "properties.desiredState", "type": "str"}, - "actual_state": {"key": "properties.actualState", "type": "str"}, - "options": {"key": "properties.options", "type": "{AutomaticTuningOptions}"}, - } - - def __init__( - self, - *, - desired_state: Optional[Union[str, "_models.AutomaticTuningMode"]] = None, - options: Optional[dict[str, "_models.AutomaticTuningOptions"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword desired_state: Automatic tuning desired state. Known values are: "Inherit", "Custom", - "Auto", and "Unspecified". - :paramtype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningMode - :keyword options: Automatic tuning options definition. - :paramtype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningOptions] - """ - super().__init__(**kwargs) - self.desired_state = desired_state - self.actual_state: Optional[Union[str, "_models.AutomaticTuningMode"]] = None - self.options = options - - -class DatabaseBlobAuditingPolicy(ProxyResource): - """A database blob auditing policy. - - 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 kind: Resource kind. - :vartype kind: str - :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :vartype retention_days: int - :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :vartype audit_actions_and_groups: list[str] - :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the - storage's secondary key. - :vartype is_storage_secondary_key_in_use: bool - :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_azure_monitor_target_enabled: bool - :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum - is 2,147,483,647. - :vartype queue_delay_ms: int - :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :vartype is_managed_identity_in_use: bool - :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :vartype storage_account_access_key: str - :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. - :vartype storage_account_subscription_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "audit_actions_and_groups": {"key": "properties.auditActionsAndGroups", "type": "[str]"}, - "is_storage_secondary_key_in_use": {"key": "properties.isStorageSecondaryKeyInUse", "type": "bool"}, - "is_azure_monitor_target_enabled": {"key": "properties.isAzureMonitorTargetEnabled", "type": "bool"}, - "queue_delay_ms": {"key": "properties.queueDelayMs", "type": "int"}, - "is_managed_identity_in_use": {"key": "properties.isManagedIdentityInUse", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "storage_account_subscription_id": {"key": "properties.storageAccountSubscriptionId", "type": "str"}, - } - - def __init__( - self, - *, - retention_days: Optional[int] = None, - audit_actions_and_groups: Optional[list[str]] = None, - is_storage_secondary_key_in_use: Optional[bool] = None, - is_azure_monitor_target_enabled: Optional[bool] = None, - queue_delay_ms: Optional[int] = None, - is_managed_identity_in_use: Optional[bool] = None, - state: Optional[Union[str, "_models.BlobAuditingPolicyState"]] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - storage_account_subscription_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :paramtype retention_days: int - :keyword audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :paramtype audit_actions_and_groups: list[str] - :keyword is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is - the storage's secondary key. - :paramtype is_storage_secondary_key_in_use: bool - :keyword is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_azure_monitor_target_enabled: bool - :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. The default minimum value is 1000 (1 second). The - maximum is 2,147,483,647. - :paramtype queue_delay_ms: int - :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :paramtype is_managed_identity_in_use: bool - :keyword state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the auditing storage - account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :paramtype storage_account_access_key: str - :keyword storage_account_subscription_id: Specifies the blob storage subscription Id. - :paramtype storage_account_subscription_id: str - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.retention_days = retention_days - self.audit_actions_and_groups = audit_actions_and_groups - self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use - self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled - self.queue_delay_ms = queue_delay_ms - self.is_managed_identity_in_use = is_managed_identity_in_use - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.storage_account_subscription_id = storage_account_subscription_id - - -class DatabaseBlobAuditingPolicyListResult(_serialization.Model): - """A list of database auditing settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseBlobAuditingPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseBlobAuditingPolicy"]] = None - self.next_link: Optional[str] = None - - -class DatabaseColumn(ProxyResource): - """A database column 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 column_type: The column data type. Known values are: "image", "text", "uniqueidentifier", - "date", "time", "datetime2", "datetimeoffset", "tinyint", "smallint", "int", "smalldatetime", - "real", "money", "datetime", "float", "sql_variant", "ntext", "bit", "decimal", "numeric", - "smallmoney", "bigint", "hierarchyid", "geometry", "geography", "varbinary", "varchar", - "binary", "char", "timestamp", "nvarchar", "nchar", "xml", and "sysname". - :vartype column_type: str or ~azure.mgmt.sql.models.ColumnDataType - :ivar temporal_type: The table temporal type. Known values are: "NonTemporalTable", - "HistoryTable", and "SystemVersionedTemporalTable". - :vartype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType - :ivar memory_optimized: Whether or not the column belongs to a memory optimized table. - :vartype memory_optimized: bool - :ivar is_computed: Whether or not the column is computed. - :vartype is_computed: bool - """ - - _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"}, - "column_type": {"key": "properties.columnType", "type": "str"}, - "temporal_type": {"key": "properties.temporalType", "type": "str"}, - "memory_optimized": {"key": "properties.memoryOptimized", "type": "bool"}, - "is_computed": {"key": "properties.isComputed", "type": "bool"}, - } - - def __init__( - self, - *, - column_type: Optional[Union[str, "_models.ColumnDataType"]] = None, - temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = None, - memory_optimized: Optional[bool] = None, - is_computed: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword column_type: The column data type. Known values are: "image", "text", - "uniqueidentifier", "date", "time", "datetime2", "datetimeoffset", "tinyint", "smallint", - "int", "smalldatetime", "real", "money", "datetime", "float", "sql_variant", "ntext", "bit", - "decimal", "numeric", "smallmoney", "bigint", "hierarchyid", "geometry", "geography", - "varbinary", "varchar", "binary", "char", "timestamp", "nvarchar", "nchar", "xml", and - "sysname". - :paramtype column_type: str or ~azure.mgmt.sql.models.ColumnDataType - :keyword temporal_type: The table temporal type. Known values are: "NonTemporalTable", - "HistoryTable", and "SystemVersionedTemporalTable". - :paramtype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType - :keyword memory_optimized: Whether or not the column belongs to a memory optimized table. - :paramtype memory_optimized: bool - :keyword is_computed: Whether or not the column is computed. - :paramtype is_computed: bool - """ - super().__init__(**kwargs) - self.column_type = column_type - self.temporal_type = temporal_type - self.memory_optimized = memory_optimized - self.is_computed = is_computed - - -class DatabaseColumnListResult(_serialization.Model): - """A list of database columns. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseColumn] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseColumn]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseColumn"]] = None - self.next_link: Optional[str] = None - - -class DatabaseExtensions(ProxyResource): - """An Import, Export, or PolybaseImport 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 operation_mode: Operation mode of the operation: Import, Export, or PolybaseImport. Known - values are: "PolybaseImport", "Import", and "Export". - :vartype operation_mode: str or ~azure.mgmt.sql.models.OperationMode - :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey or ManagedIdentity. - Known values are: "SharedAccessKey", "StorageAccessKey", and "ManagedIdentity". - :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. - :vartype storage_key: str - :ivar storage_uri: Storage Uri for the storage account. - :vartype storage_uri: str - :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. - :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :vartype administrator_login_password: str - :ivar authentication_type: Authentication type used to access the SQL: Sql, ADPassword or - ManagedIdentity. - :vartype authentication_type: str - :ivar database_edition: Database edition for the newly created database in the case of an - import operation. - :vartype database_edition: str - :ivar service_objective_name: Database service level objective for the newly created database - in the case of an import operation. - :vartype service_objective_name: str - :ivar max_size_bytes: Database max size in bytes for the newly created database in the case of - an import operation. - :vartype max_size_bytes: str - :ivar network_isolation: Optional resource information to enable network isolation for request. - :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - - _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"}, - "operation_mode": {"key": "properties.operationMode", "type": "str"}, - "storage_key_type": {"key": "properties.storageKeyType", "type": "str"}, - "storage_key": {"key": "properties.storageKey", "type": "str"}, - "storage_uri": {"key": "properties.storageUri", "type": "str"}, - "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, - "authentication_type": {"key": "properties.authenticationType", "type": "str"}, - "database_edition": {"key": "properties.databaseEdition", "type": "str"}, - "service_objective_name": {"key": "properties.serviceObjectiveName", "type": "str"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "str"}, - "network_isolation": {"key": "properties.networkIsolation", "type": "NetworkIsolationSettings"}, - } - - def __init__( - self, - *, - operation_mode: Optional[Union[str, "_models.OperationMode"]] = None, - storage_key_type: Optional[Union[str, "_models.StorageKeyType"]] = None, - storage_key: Optional[str] = None, - storage_uri: Optional[str] = None, - administrator_login: Optional[str] = None, - administrator_login_password: Optional[str] = None, - authentication_type: Optional[str] = None, - database_edition: Optional[str] = None, - service_objective_name: Optional[str] = None, - max_size_bytes: Optional[str] = None, - network_isolation: Optional["_models.NetworkIsolationSettings"] = None, - **kwargs: Any - ) -> None: - """ - :keyword operation_mode: Operation mode of the operation: Import, Export, or PolybaseImport. - Known values are: "PolybaseImport", "Import", and "Export". - :paramtype operation_mode: str or ~azure.mgmt.sql.models.OperationMode - :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey or - ManagedIdentity. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key for the storage account. If StorageKeyType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. - :paramtype storage_key: str - :keyword storage_uri: Storage Uri for the storage account. - :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. If AuthenticationType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. - :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :paramtype administrator_login_password: str - :keyword authentication_type: Authentication type used to access the SQL: Sql, ADPassword or - ManagedIdentity. - :paramtype authentication_type: str - :keyword database_edition: Database edition for the newly created database in the case of an - import operation. - :paramtype database_edition: str - :keyword service_objective_name: Database service level objective for the newly created - database in the case of an import operation. - :paramtype service_objective_name: str - :keyword max_size_bytes: Database max size in bytes for the newly created database in the case - of an import operation. - :paramtype max_size_bytes: str - :keyword network_isolation: Optional resource information to enable network isolation for - request. - :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - super().__init__(**kwargs) - self.operation_mode = operation_mode - self.storage_key_type = storage_key_type - self.storage_key = storage_key - self.storage_uri = storage_uri - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.authentication_type = authentication_type - self.database_edition = database_edition - self.service_objective_name = service_objective_name - self.max_size_bytes = max_size_bytes - self.network_isolation = network_isolation - - -class DatabaseIdentity(_serialization.Model): - """Azure Active Directory identity configuration for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The identity type. Known values are: "None" and "UserAssigned". - :vartype type: str or ~azure.mgmt.sql.models.DatabaseIdentityType - :ivar tenant_id: The Azure Active Directory tenant id. - :vartype tenant_id: str - :ivar user_assigned_identities: The resource ids of the user assigned identities to use. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.DatabaseUserIdentity] - """ - - _validation = { - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{DatabaseUserIdentity}"}, - } - - def __init__( - self, - *, - type: Optional[Union[str, "_models.DatabaseIdentityType"]] = None, - user_assigned_identities: Optional[dict[str, "_models.DatabaseUserIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: The identity type. Known values are: "None" and "UserAssigned". - :paramtype type: str or ~azure.mgmt.sql.models.DatabaseIdentityType - :keyword user_assigned_identities: The resource ids of the user assigned identities to use. - :paramtype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.DatabaseUserIdentity] - """ - super().__init__(**kwargs) - self.type = type - self.tenant_id: Optional[str] = None - self.user_assigned_identities = user_assigned_identities - - -class DatabaseKey(_serialization.Model): - """Database level key used for encryption at rest. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The database key type. Only supported value is 'AzureKeyVault'. "AzureKeyVault" - :vartype type: str or ~azure.mgmt.sql.models.DatabaseKeyType - :ivar thumbprint: Thumbprint of the database key. - :vartype thumbprint: str - :ivar creation_date: The database key creation date. - :vartype creation_date: ~datetime.datetime - :ivar subregion: Subregion of the server key. - :vartype subregion: str - :ivar key_version: The database key's version. - :vartype key_version: str - """ - - _validation = { - "type": {"readonly": True}, - "thumbprint": {"readonly": True}, - "creation_date": {"readonly": True}, - "subregion": {"readonly": True}, - "key_version": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "thumbprint": {"key": "thumbprint", "type": "str"}, - "creation_date": {"key": "creationDate", "type": "iso-8601"}, - "subregion": {"key": "subregion", "type": "str"}, - "key_version": {"key": "keyVersion", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[Union[str, "_models.DatabaseKeyType"]] = None - self.thumbprint: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.subregion: Optional[str] = None - self.key_version: Optional[str] = None - - -class DatabaseListResult(_serialization.Model): - """A list of databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.Database] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Database]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Database"]] = None - self.next_link: Optional[str] = None - - -class DatabaseOperation(ProxyResource): - """A database operation. - - 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 database_name: The name of the database the operation is being performed on. - :vartype database_name: str - :ivar operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar server_name: The name of the server. - :vartype server_name: str - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", - "Failed", "CancelInProgress", and "Cancelled". - :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - :ivar operation_phase_details: The operation phase details. - :vartype operation_phase_details: ~azure.mgmt.sql.models.PhaseDetails - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "database_name": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "server_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - "operation_phase_details": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - "operation_phase_details": {"key": "properties.operationPhaseDetails", "type": "PhaseDetails"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.database_name: Optional[str] = None - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.percent_complete: Optional[int] = None - self.server_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.is_user_error: Optional[bool] = None - self.estimated_completion_time: Optional[datetime.datetime] = None - self.description: Optional[str] = None - self.is_cancellable: Optional[bool] = None - self.operation_phase_details: Optional["_models.PhaseDetails"] = None - - -class DatabaseOperationListResult(_serialization.Model): - """The response to a list database operations request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseOperation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseOperation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseOperation"]] = None - self.next_link: Optional[str] = None - - -class DatabaseSchema(ProxyResource): - """A database schema 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 - """ - - -class DatabaseSchemaListResult(_serialization.Model): - """A list of database schemas. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseSchema] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseSchema]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseSchema"]] = None - self.next_link: Optional[str] = None - - -class DatabaseSecurityAlertListResult(_serialization.Model): - """A list of the database's security alert policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseSecurityAlertPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseSecurityAlertPolicy"]] = None - self.next_link: Optional[str] = None - - -class DatabaseSecurityAlertPolicy(ProxyResource): - """A database security alert policy. - - 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 system_data: SystemData of SecurityAlertPolicyResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the policy, whether it is enabled or disabled or a policy - has not been applied yet on the specific database. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :vartype disabled_alerts: list[str] - :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :vartype email_addresses: list[str] - :ivar email_account_admins: Specifies that the alert is sent to the account administrators. - :vartype email_account_admins: bool - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :vartype storage_account_access_key: str - :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. - :vartype retention_days: int - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "disabled_alerts": {"key": "properties.disabledAlerts", "type": "[str]"}, - "email_addresses": {"key": "properties.emailAddresses", "type": "[str]"}, - "email_account_admins": {"key": "properties.emailAccountAdmins", "type": "bool"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, - *, - state: Optional[Union[str, "_models.SecurityAlertsPolicyState"]] = None, - disabled_alerts: Optional[list[str]] = None, - email_addresses: Optional[list[str]] = None, - email_account_admins: Optional[bool] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - retention_days: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the policy, whether it is enabled or disabled or a - policy has not been applied yet on the specific database. Known values are: "Enabled" and - "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :keyword disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :paramtype disabled_alerts: list[str] - :keyword email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :paramtype email_addresses: list[str] - :keyword email_account_admins: Specifies that the alert is sent to the account administrators. - :paramtype email_account_admins: bool - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :paramtype storage_account_access_key: str - :keyword retention_days: Specifies the number of days to keep in the Threat Detection audit - logs. - :paramtype retention_days: int - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.disabled_alerts = disabled_alerts - self.email_addresses = email_addresses - self.email_account_admins = email_account_admins - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.retention_days = retention_days - self.creation_time: Optional[datetime.datetime] = None - - -class DatabaseSqlVulnerabilityAssessmentBaselineSet(ProxyResource): # pylint: disable=name-too-long - """A database sql vulnerability assessment baseline set. - - 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 system_data: SystemData of DatabaseSqlVulnerabilityAssessmentBaselineSetResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar results: The baseline set result. - :vartype results: dict[str, list[list[str]]] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "results": {"key": "properties.results", "type": "{[[str]]}"}, - } - - def __init__(self, *, results: Optional[dict[str, list[list[str]]]] = None, **kwargs: Any) -> None: - """ - :keyword results: The baseline set result. - :paramtype results: dict[str, list[list[str]]] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.results = results - - -class DatabaseSqlVulnerabilityAssessmentBaselineSetListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of SQL Vulnerability Assessments baseline set. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseSqlVulnerabilityAssessmentBaselineSet]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]] = None - self.next_link: Optional[str] = None - - -class DatabaseSqlVulnerabilityAssessmentRuleBaseline(ProxyResource): # pylint: disable=name-too-long - """A database sql vulnerability assessment rule baseline. - - 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 system_data: SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar results: The rule baseline result. - :vartype results: list[list[str]] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "results": {"key": "properties.results", "type": "[[str]]"}, - } - - def __init__(self, *, results: Optional[list[list[str]]] = None, **kwargs: Any) -> None: - """ - :keyword results: The rule baseline result. - :paramtype results: list[list[str]] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.results = results - - -class DatabaseSqlVulnerabilityAssessmentRuleBaselineInput(ProxyResource): # pylint: disable=name-too-long - """A database sql vulnerability assessment rule baseline input. - - 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 system_data: SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineInputResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar latest_scan: The latest scan flag. - :vartype latest_scan: bool - :ivar results: The rule baseline result. - :vartype results: list[list[str]] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "latest_scan": {"key": "properties.latestScan", "type": "bool"}, - "results": {"key": "properties.results", "type": "[[str]]"}, - } - - def __init__( - self, *, latest_scan: Optional[bool] = None, results: Optional[list[list[str]]] = None, **kwargs: Any - ) -> None: - """ - :keyword latest_scan: The latest scan flag. - :paramtype latest_scan: bool - :keyword results: The rule baseline result. - :paramtype results: list[list[str]] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.latest_scan = latest_scan - self.results = results - - -class DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput(ProxyResource): # pylint: disable=name-too-long - """A database sql vulnerability assessment rule baseline list input. - - 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 system_data: SystemData of - DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar latest_scan: The latest scan flag. - :vartype latest_scan: bool - :ivar results: The rule baseline result list. - :vartype results: dict[str, list[list[str]]] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "latest_scan": {"key": "properties.latestScan", "type": "bool"}, - "results": {"key": "properties.results", "type": "{[[str]]}"}, - } - - def __init__( - self, *, latest_scan: Optional[bool] = None, results: Optional[dict[str, list[list[str]]]] = None, **kwargs: Any - ) -> None: - """ - :keyword latest_scan: The latest scan flag. - :paramtype latest_scan: bool - :keyword results: The rule baseline result list. - :paramtype results: dict[str, list[list[str]]] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.latest_scan = latest_scan - self.results = results - - -class DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of SQL Vulnerability Assessments rule baseline. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseSqlVulnerabilityAssessmentRuleBaseline]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]] = None - self.next_link: Optional[str] = None - - -class DatabaseTable(ProxyResource): - """A database table 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 temporal_type: The table temporal type. Known values are: "NonTemporalTable", - "HistoryTable", and "SystemVersionedTemporalTable". - :vartype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType - :ivar memory_optimized: Whether or not the table is memory optimized. - :vartype memory_optimized: bool - """ - - _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"}, - "temporal_type": {"key": "properties.temporalType", "type": "str"}, - "memory_optimized": {"key": "properties.memoryOptimized", "type": "bool"}, - } - - def __init__( - self, - *, - temporal_type: Optional[Union[str, "_models.TableTemporalType"]] = None, - memory_optimized: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword temporal_type: The table temporal type. Known values are: "NonTemporalTable", - "HistoryTable", and "SystemVersionedTemporalTable". - :paramtype temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType - :keyword memory_optimized: Whether or not the table is memory optimized. - :paramtype memory_optimized: bool - """ - super().__init__(**kwargs) - self.temporal_type = temporal_type - self.memory_optimized = memory_optimized - - -class DatabaseTableListResult(_serialization.Model): - """A list of database tables. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseTable] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseTable]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseTable"]] = None - self.next_link: Optional[str] = None - - -class DatabaseUpdate(_serialization.Model): - """A database update resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar identity: Database identity. - :vartype identity: ~azure.mgmt.sql.models.DatabaseIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar create_mode: Specifies the mode of database creation. - - Default: regular database creation. - - Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified - as the resource ID of the source database. - - Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId - must be specified as the resource ID of the existing primary database. - - PointInTimeRestore: Creates a database by restoring a point in time backup of an existing - database. sourceDatabaseId must be specified as the resource ID of the existing database, and - restorePointInTime must be specified. - - Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be - specified as the recoverable database resource ID to restore. - - Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must - be specified. If sourceDatabaseId is the database's original resource ID, then - sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable - dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may - also be specified to restore from an earlier point in time. - - RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention - vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource - ID. - - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse - edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", - "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", - "RestoreLongTermRetentionBackup", and "OnlineSecondary". - :vartype create_mode: str or ~azure.mgmt.sql.models.CreateMode - :ivar collation: The collation of the database. - :vartype collation: str - :ivar max_size_bytes: The max size of the database expressed in bytes. - :vartype max_size_bytes: int - :ivar sample_name: The name of the sample schema to apply when creating this database. Known - values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". - :vartype sample_name: str or ~azure.mgmt.sql.models.SampleName - :ivar elastic_pool_id: The resource identifier of the elastic pool containing this database. - :vartype elastic_pool_id: str - :ivar source_database_id: The resource identifier of the source database associated with create - operation of this database. - :vartype source_database_id: str - :ivar status: The status of the database. Known values are: "Online", "Restoring", - "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", - "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", - "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled", "Stopping", "Stopped", and "Starting". - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: ~datetime.datetime - :ivar current_service_objective_name: The current service level objective name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level objective name of the - database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this database belongs to. - :vartype failover_group_id: str - :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar source_database_deletion_date: Specifies the time that the database was deleted. - :vartype source_database_deletion_date: ~datetime.datetime - :ivar recovery_services_recovery_point_id: The resource identifier of the recovery point - associated with create operation of this database. - :vartype recovery_services_recovery_point_id: str - :ivar long_term_retention_backup_resource_id: The resource identifier of the long term - retention backup associated with create operation of this database. - :vartype long_term_retention_backup_resource_id: str - :ivar recoverable_database_id: The resource identifier of the recoverable database associated - with create operation of this database. - :vartype recoverable_database_id: str - :ivar restorable_dropped_database_id: The resource identifier of the restorable dropped - database associated with create operation of this database. - :vartype restorable_dropped_database_id: str - :ivar catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :ivar zone_redundant: Whether or not this database is zone redundant, which means the replicas - of this database will be spread across multiple availability zones. - :vartype zone_redundant: bool - :ivar license_type: The license type to apply for this database. ``LicenseIncluded`` if you - need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid - Benefit. Known values are: "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: int - :ivar earliest_restore_date: This records the earliest start date and time that restore is - available for this database (ISO8601 format). - :vartype earliest_restore_date: ~datetime.datetime - :ivar read_scale: The state of read-only routing. If enabled, connections that have application - intent set to readonly in their connection string may be routed to a readonly secondary replica - in the same region. Not applicable to a Hyperscale database within an elastic pool. Known - values are: "Enabled" and "Disabled". - :vartype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :ivar high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition database that are used to provide high - availability. Not applicable to a Hyperscale database within an elastic pool. - :vartype high_availability_replica_count: int - :ivar secondary_type: The secondary type of the database if it is a secondary. Valid values - are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". - :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :ivar current_sku: The name and tier of the SKU. - :vartype current_sku: ~azure.mgmt.sql.models.Sku - :ivar auto_pause_delay: Time in minutes after which database is automatically paused. A value - of -1 means that automatic pause is disabled. - :vartype auto_pause_delay: int - :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups - for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar min_capacity: Minimal capacity that database will always have allocated, if not paused. - :vartype min_capacity: float - :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 - format). Null if the database is ready. - :vartype paused_date: ~datetime.datetime - :ivar resumed_date: The date when database was resumed by user action or database login - (ISO8601 format). Null if the database is paused. - :vartype resumed_date: ~datetime.datetime - :ivar maintenance_configuration_id: Maintenance configuration id assigned to the database. This - configuration defines the period when the maintenance updates will occur. - :vartype maintenance_configuration_id: str - :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables - in the database are ledger tables. Note: the value of this property cannot be changed after the - database has been created. - :vartype is_ledger_on: bool - :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. - :vartype is_infra_encryption_enabled: bool - :ivar federated_client_id: The Client id used for cross tenant per database CMK scenario. - :vartype federated_client_id: str - :ivar keys: The resource ids of the user assigned identities to use. - :vartype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - :ivar encryption_protector: The azure key vault URI of the database if it's configured with per - Database Customer Managed Keys. - :vartype encryption_protector: str - :ivar preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS - enclaves. Known values are: "Default" and "VBS". - :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :ivar use_free_limit: Whether or not the database uses free monthly limits. Allowed on one - database in a subscription. - :vartype use_free_limit: bool - :ivar free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are - exhausted for the free database. - - AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the - month. - - BillForUsage: The database will continue to be online upon exhaustion of free limits and any - overage will be billed. Known values are: "AutoPause" and "BillOverUsage". - :vartype free_limit_exhaustion_behavior: str or - ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior - :ivar manual_cutover: Whether or not customer controlled manual cutover needs to be done during - Update Database operation to Hyperscale tier. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier. - - When manualCutover is specified, the scaling operation will wait for user input to trigger - cutover to Hyperscale database. - - To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in - Waiting state. - :vartype manual_cutover: bool - :ivar perform_cutover: To trigger customer controlled manual cutover during the wait state - while Scaling operation is in progress. - - This property parameter is only applicable for scaling operations that are initiated along with - 'manualCutover' parameter. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier is already in progress. - - When performCutover is specified, the scaling operation will trigger cutover and perform - role-change to Hyperscale database. - :vartype perform_cutover: bool - :ivar encryption_protector_auto_rotation: The flag to enable or disable auto rotation of - database encryption protector AKV key. - :vartype encryption_protector_auto_rotation: bool - """ - - _validation = { - "status": {"readonly": True}, - "database_id": {"readonly": True}, - "creation_date": {"readonly": True}, - "current_service_objective_name": {"readonly": True}, - "requested_service_objective_name": {"readonly": True}, - "default_secondary_location": {"readonly": True}, - "failover_group_id": {"readonly": True}, - "max_log_size_bytes": {"readonly": True}, - "earliest_restore_date": {"readonly": True}, - "current_sku": {"readonly": True}, - "current_backup_storage_redundancy": {"readonly": True}, - "paused_date": {"readonly": True}, - "resumed_date": {"readonly": True}, - "is_infra_encryption_enabled": {"readonly": True}, - } - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "DatabaseIdentity"}, - "tags": {"key": "tags", "type": "{str}"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "collation": {"key": "properties.collation", "type": "str"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "int"}, - "sample_name": {"key": "properties.sampleName", "type": "str"}, - "elastic_pool_id": {"key": "properties.elasticPoolId", "type": "str"}, - "source_database_id": {"key": "properties.sourceDatabaseId", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "database_id": {"key": "properties.databaseId", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "current_service_objective_name": {"key": "properties.currentServiceObjectiveName", "type": "str"}, - "requested_service_objective_name": {"key": "properties.requestedServiceObjectiveName", "type": "str"}, - "default_secondary_location": {"key": "properties.defaultSecondaryLocation", "type": "str"}, - "failover_group_id": {"key": "properties.failoverGroupId", "type": "str"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "source_database_deletion_date": {"key": "properties.sourceDatabaseDeletionDate", "type": "iso-8601"}, - "recovery_services_recovery_point_id": {"key": "properties.recoveryServicesRecoveryPointId", "type": "str"}, - "long_term_retention_backup_resource_id": { - "key": "properties.longTermRetentionBackupResourceId", - "type": "str", - }, - "recoverable_database_id": {"key": "properties.recoverableDatabaseId", "type": "str"}, - "restorable_dropped_database_id": {"key": "properties.restorableDroppedDatabaseId", "type": "str"}, - "catalog_collation": {"key": "properties.catalogCollation", "type": "str"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "max_log_size_bytes": {"key": "properties.maxLogSizeBytes", "type": "int"}, - "earliest_restore_date": {"key": "properties.earliestRestoreDate", "type": "iso-8601"}, - "read_scale": {"key": "properties.readScale", "type": "str"}, - "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, - "secondary_type": {"key": "properties.secondaryType", "type": "str"}, - "current_sku": {"key": "properties.currentSku", "type": "Sku"}, - "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, - "current_backup_storage_redundancy": {"key": "properties.currentBackupStorageRedundancy", "type": "str"}, - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - "min_capacity": {"key": "properties.minCapacity", "type": "float"}, - "paused_date": {"key": "properties.pausedDate", "type": "iso-8601"}, - "resumed_date": {"key": "properties.resumedDate", "type": "iso-8601"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, - "is_infra_encryption_enabled": {"key": "properties.isInfraEncryptionEnabled", "type": "bool"}, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - "keys": {"key": "properties.keys", "type": "{DatabaseKey}"}, - "encryption_protector": {"key": "properties.encryptionProtector", "type": "str"}, - "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, - "use_free_limit": {"key": "properties.useFreeLimit", "type": "bool"}, - "free_limit_exhaustion_behavior": {"key": "properties.freeLimitExhaustionBehavior", "type": "str"}, - "manual_cutover": {"key": "properties.manualCutover", "type": "bool"}, - "perform_cutover": {"key": "properties.performCutover", "type": "bool"}, - "encryption_protector_auto_rotation": {"key": "properties.encryptionProtectorAutoRotation", "type": "bool"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - sku: Optional["_models.Sku"] = None, - identity: Optional["_models.DatabaseIdentity"] = None, - tags: Optional[dict[str, str]] = None, - create_mode: Optional[Union[str, "_models.CreateMode"]] = None, - collation: Optional[str] = None, - max_size_bytes: Optional[int] = None, - sample_name: Optional[Union[str, "_models.SampleName"]] = None, - elastic_pool_id: Optional[str] = None, - source_database_id: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - source_database_deletion_date: Optional[datetime.datetime] = None, - recovery_services_recovery_point_id: Optional[str] = None, - long_term_retention_backup_resource_id: Optional[str] = None, - recoverable_database_id: Optional[str] = None, - restorable_dropped_database_id: Optional[str] = None, - catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, - zone_redundant: Optional[bool] = None, - license_type: Optional[Union[str, "_models.DatabaseLicenseType"]] = None, - read_scale: Optional[Union[str, "_models.DatabaseReadScale"]] = None, - high_availability_replica_count: Optional[int] = None, - secondary_type: Optional[Union[str, "_models.SecondaryType"]] = None, - auto_pause_delay: Optional[int] = None, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - min_capacity: Optional[float] = None, - maintenance_configuration_id: Optional[str] = None, - is_ledger_on: Optional[bool] = None, - federated_client_id: Optional[str] = None, - keys: Optional[dict[str, "_models.DatabaseKey"]] = None, - encryption_protector: Optional[str] = None, - preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, - use_free_limit: Optional[bool] = None, - free_limit_exhaustion_behavior: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None, - manual_cutover: Optional[bool] = None, - perform_cutover: Optional[bool] = None, - encryption_protector_auto_rotation: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword identity: Database identity. - :paramtype identity: ~azure.mgmt.sql.models.DatabaseIdentity - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword create_mode: Specifies the mode of database creation. - - Default: regular database creation. - - Copy: creates a database as a copy of an existing database. sourceDatabaseId must be specified - as the resource ID of the source database. - - Secondary: creates a database as a secondary replica of an existing database. sourceDatabaseId - must be specified as the resource ID of the existing primary database. - - PointInTimeRestore: Creates a database by restoring a point in time backup of an existing - database. sourceDatabaseId must be specified as the resource ID of the existing database, and - restorePointInTime must be specified. - - Recovery: Creates a database by restoring a geo-replicated backup. sourceDatabaseId must be - specified as the recoverable database resource ID to restore. - - Restore: Creates a database by restoring a backup of a deleted database. sourceDatabaseId must - be specified. If sourceDatabaseId is the database's original resource ID, then - sourceDatabaseDeletionDate must be specified. Otherwise sourceDatabaseId must be the restorable - dropped database resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime may - also be specified to restore from an earlier point in time. - - RestoreLongTermRetentionBackup: Creates a database by restoring from a long term retention - vault. recoveryServicesRecoveryPointResourceId must be specified as the recovery point resource - ID. - - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for DataWarehouse - edition. Known values are: "Default", "Copy", "Secondary", "PointInTimeRestore", "Restore", - "Recovery", "RestoreExternalBackup", "RestoreExternalBackupSecondary", - "RestoreLongTermRetentionBackup", and "OnlineSecondary". - :paramtype create_mode: str or ~azure.mgmt.sql.models.CreateMode - :keyword collation: The collation of the database. - :paramtype collation: str - :keyword max_size_bytes: The max size of the database expressed in bytes. - :paramtype max_size_bytes: int - :keyword sample_name: The name of the sample schema to apply when creating this database. Known - values are: "AdventureWorksLT", "WideWorldImportersStd", and "WideWorldImportersFull". - :paramtype sample_name: str or ~azure.mgmt.sql.models.SampleName - :keyword elastic_pool_id: The resource identifier of the elastic pool containing this database. - :paramtype elastic_pool_id: str - :keyword source_database_id: The resource identifier of the source database associated with - create operation of this database. - :paramtype source_database_id: str - :keyword restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword source_database_deletion_date: Specifies the time that the database was deleted. - :paramtype source_database_deletion_date: ~datetime.datetime - :keyword recovery_services_recovery_point_id: The resource identifier of the recovery point - associated with create operation of this database. - :paramtype recovery_services_recovery_point_id: str - :keyword long_term_retention_backup_resource_id: The resource identifier of the long term - retention backup associated with create operation of this database. - :paramtype long_term_retention_backup_resource_id: str - :keyword recoverable_database_id: The resource identifier of the recoverable database - associated with create operation of this database. - :paramtype recoverable_database_id: str - :keyword restorable_dropped_database_id: The resource identifier of the restorable dropped - database associated with create operation of this database. - :paramtype restorable_dropped_database_id: str - :keyword catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :paramtype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :keyword zone_redundant: Whether or not this database is zone redundant, which means the - replicas of this database will be spread across multiple availability zones. - :paramtype zone_redundant: bool - :keyword license_type: The license type to apply for this database. ``LicenseIncluded`` if you - need a license, or ``BasePrice`` if you have a license and are eligible for the Azure Hybrid - Benefit. Known values are: "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :keyword read_scale: The state of read-only routing. If enabled, connections that have - application intent set to readonly in their connection string may be routed to a readonly - secondary replica in the same region. Not applicable to a Hyperscale database within an elastic - pool. Known values are: "Enabled" and "Disabled". - :paramtype read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :keyword high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition database that are used to provide high - availability. Not applicable to a Hyperscale database within an elastic pool. - :paramtype high_availability_replica_count: int - :keyword secondary_type: The secondary type of the database if it is a secondary. Valid values - are Geo, Named and Standby. Known values are: "Geo", "Named", and "Standby". - :paramtype secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :keyword auto_pause_delay: Time in minutes after which database is automatically paused. A - value of -1 means that automatic pause is disabled. - :paramtype auto_pause_delay: int - :keyword requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword min_capacity: Minimal capacity that database will always have allocated, if not - paused. - :paramtype min_capacity: float - :keyword maintenance_configuration_id: Maintenance configuration id assigned to the database. - This configuration defines the period when the maintenance updates will occur. - :paramtype maintenance_configuration_id: str - :keyword is_ledger_on: Whether or not this database is a ledger database, which means all - tables in the database are ledger tables. Note: the value of this property cannot be changed - after the database has been created. - :paramtype is_ledger_on: bool - :keyword federated_client_id: The Client id used for cross tenant per database CMK scenario. - :paramtype federated_client_id: str - :keyword keys: The resource ids of the user assigned identities to use. - :paramtype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - :keyword encryption_protector: The azure key vault URI of the database if it's configured with - per Database Customer Managed Keys. - :paramtype encryption_protector: str - :keyword preferred_enclave_type: Type of enclave requested on the database i.e. Default or VBS - enclaves. Known values are: "Default" and "VBS". - :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :keyword use_free_limit: Whether or not the database uses free monthly limits. Allowed on one - database in a subscription. - :paramtype use_free_limit: bool - :keyword free_limit_exhaustion_behavior: Specifies the behavior when monthly free limits are - exhausted for the free database. - - AutoPause: The database will be auto paused upon exhaustion of free limits for remainder of the - month. - - BillForUsage: The database will continue to be online upon exhaustion of free limits and any - overage will be billed. Known values are: "AutoPause" and "BillOverUsage". - :paramtype free_limit_exhaustion_behavior: str or - ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior - :keyword manual_cutover: Whether or not customer controlled manual cutover needs to be done - during Update Database operation to Hyperscale tier. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier. - - When manualCutover is specified, the scaling operation will wait for user input to trigger - cutover to Hyperscale database. - - To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in - Waiting state. - :paramtype manual_cutover: bool - :keyword perform_cutover: To trigger customer controlled manual cutover during the wait state - while Scaling operation is in progress. - - This property parameter is only applicable for scaling operations that are initiated along with - 'manualCutover' parameter. - - This property is only applicable when scaling database from Business Critical/General - Purpose/Premium/Standard tier to Hyperscale tier is already in progress. - - When performCutover is specified, the scaling operation will trigger cutover and perform - role-change to Hyperscale database. - :paramtype perform_cutover: bool - :keyword encryption_protector_auto_rotation: The flag to enable or disable auto rotation of - database encryption protector AKV key. - :paramtype encryption_protector_auto_rotation: bool - """ - super().__init__(**kwargs) - self.sku = sku - self.identity = identity - self.tags = tags - self.create_mode = create_mode - self.collation = collation - self.max_size_bytes = max_size_bytes - self.sample_name = sample_name - self.elastic_pool_id = elastic_pool_id - self.source_database_id = source_database_id - self.status: Optional[Union[str, "_models.DatabaseStatus"]] = None - self.database_id: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.current_service_objective_name: Optional[str] = None - self.requested_service_objective_name: Optional[str] = None - self.default_secondary_location: Optional[str] = None - self.failover_group_id: Optional[str] = None - self.restore_point_in_time = restore_point_in_time - self.source_database_deletion_date = source_database_deletion_date - self.recovery_services_recovery_point_id = recovery_services_recovery_point_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.recoverable_database_id = recoverable_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.catalog_collation = catalog_collation - self.zone_redundant = zone_redundant - self.license_type = license_type - self.max_log_size_bytes: Optional[int] = None - self.earliest_restore_date: Optional[datetime.datetime] = None - self.read_scale = read_scale - self.high_availability_replica_count = high_availability_replica_count - self.secondary_type = secondary_type - self.current_sku: Optional["_models.Sku"] = None - self.auto_pause_delay = auto_pause_delay - self.current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - self.min_capacity = min_capacity - self.paused_date: Optional[datetime.datetime] = None - self.resumed_date: Optional[datetime.datetime] = None - self.maintenance_configuration_id = maintenance_configuration_id - self.is_ledger_on = is_ledger_on - self.is_infra_encryption_enabled: Optional[bool] = None - self.federated_client_id = federated_client_id - self.keys = keys - self.encryption_protector = encryption_protector - self.preferred_enclave_type = preferred_enclave_type - self.use_free_limit = use_free_limit - self.free_limit_exhaustion_behavior = free_limit_exhaustion_behavior - self.manual_cutover = manual_cutover - self.perform_cutover = perform_cutover - self.encryption_protector_auto_rotation = encryption_protector_auto_rotation - - -class DatabaseUsage(ProxyResource): - """Usage metric of a database. - - 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 display_name: User-readable name of the metric. - :vartype display_name: str - :ivar current_value: Current value of the metric. - :vartype current_value: float - :ivar limit: Boundary value of the metric. - :vartype limit: float - :ivar unit: Unit of the metric. - :vartype unit: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "display_name": {"readonly": True}, - "current_value": {"readonly": True}, - "limit": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - "current_value": {"key": "properties.currentValue", "type": "float"}, - "limit": {"key": "properties.limit", "type": "float"}, - "unit": {"key": "properties.unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name: Optional[str] = None - self.current_value: Optional[float] = None - self.limit: Optional[float] = None - self.unit: Optional[str] = None - - -class DatabaseUsageListResult(_serialization.Model): - """A list of database usage metrics. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseUsage] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseUsage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseUsage"]] = None - self.next_link: Optional[str] = None - - -class DatabaseUserIdentity(_serialization.Model): - """Azure Active Directory identity configuration for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The Azure Active Directory principal id. - :vartype principal_id: str - :ivar client_id: The Azure Active Directory client id. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - - -class DatabaseVulnerabilityAssessment(ProxyResource): - """A database vulnerability assessment. - - 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 storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). It is required if server level - vulnerability assessment policy doesn't set. - :vartype storage_container_path: str - :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to - the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' - isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not - behind a Vnet or a firewall. - :vartype storage_container_sas_key: str - :ivar storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :vartype storage_account_access_key: str - :ivar recurring_scans: The recurring scans settings. - :vartype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - - _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"}, - "storage_container_path": {"key": "properties.storageContainerPath", "type": "str"}, - "storage_container_sas_key": {"key": "properties.storageContainerSasKey", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "recurring_scans": { - "key": "properties.recurringScans", - "type": "VulnerabilityAssessmentRecurringScansProperties", - }, - } - - def __init__( - self, - *, - storage_container_path: Optional[str] = None, - storage_container_sas_key: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). It is required if server level - vulnerability assessment policy doesn't set. - :paramtype storage_container_path: str - :keyword storage_container_sas_key: A shared access signature (SAS Key) that has write access - to the blob container specified in 'storageContainerPath' parameter. If - 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. Applies only if - the storage account is not behind a Vnet or a firewall. - :paramtype storage_container_sas_key: str - :keyword storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :paramtype storage_account_access_key: str - :keyword recurring_scans: The recurring scans settings. - :paramtype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - super().__init__(**kwargs) - self.storage_container_path = storage_container_path - self.storage_container_sas_key = storage_container_sas_key - self.storage_account_access_key = storage_account_access_key - self.recurring_scans = recurring_scans - - -class DatabaseVulnerabilityAssessmentListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the database's vulnerability assessments. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DatabaseVulnerabilityAssessment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DatabaseVulnerabilityAssessment"]] = None - self.next_link: Optional[str] = None - - -class DatabaseVulnerabilityAssessmentRuleBaseline(ProxyResource): # pylint: disable=name-too-long - """A database vulnerability assessment rule baseline. - - 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 baseline_results: The rule baseline result. - :vartype baseline_results: - list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] - """ - - _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"}, - "baseline_results": { - "key": "properties.baselineResults", - "type": "[DatabaseVulnerabilityAssessmentRuleBaselineItem]", - }, - } - - def __init__( - self, - *, - baseline_results: Optional[list["_models.DatabaseVulnerabilityAssessmentRuleBaselineItem"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword baseline_results: The rule baseline result. - :paramtype baseline_results: - list[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaselineItem] - """ - super().__init__(**kwargs) - self.baseline_results = baseline_results - - -class DatabaseVulnerabilityAssessmentRuleBaselineItem(_serialization.Model): # pylint: disable=name-too-long - """Properties for an Azure SQL Database Vulnerability Assessment rule baseline's result. - - All required parameters must be populated in order to send to server. - - :ivar result: The rule baseline result. Required. - :vartype result: list[str] - """ - - _validation = { - "result": {"required": True}, - } - - _attribute_map = { - "result": {"key": "result", "type": "[str]"}, - } - - def __init__(self, *, result: list[str], **kwargs: Any) -> None: - """ - :keyword result: The rule baseline result. Required. - :paramtype result: list[str] - """ - super().__init__(**kwargs) - self.result = result - - -class DatabaseVulnerabilityAssessmentScansExport(ProxyResource): # pylint: disable=name-too-long - """A database Vulnerability Assessment scan export 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 exported_report_location: Location of the exported report (e.g. - https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). - :vartype exported_report_location: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "exported_report_location": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "exported_report_location": {"key": "properties.exportedReportLocation", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.exported_report_location: Optional[str] = None - - -class DataMaskingPolicy(ProxyResource): - """A database data masking policy. - - 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 location: The location of the data masking policy. - :vartype location: str - :ivar kind: The kind of Data Masking Policy. Metadata, used for Azure portal. - :vartype kind: str - :ivar data_masking_state: The state of the data masking policy. Known values are: "Enabled" and - "Disabled". - :vartype data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState - :ivar exempt_principals: The list of the exempt principals. Specifies the semicolon-separated - list of database users for which the data masking policy does not apply. The specified users - receive data results without masking for all of the database queries. - :vartype exempt_principals: str - :ivar application_principals: The list of the application principals. This is a legacy - parameter and is no longer used. - :vartype application_principals: str - :ivar masking_level: The masking level. This is a legacy parameter and is no longer used. - :vartype masking_level: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "kind": {"readonly": True}, - "application_principals": {"readonly": True}, - "masking_level": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "data_masking_state": {"key": "properties.dataMaskingState", "type": "str"}, - "exempt_principals": {"key": "properties.exemptPrincipals", "type": "str"}, - "application_principals": {"key": "properties.applicationPrincipals", "type": "str"}, - "masking_level": {"key": "properties.maskingLevel", "type": "str"}, - } - - def __init__( - self, - *, - data_masking_state: Optional[Union[str, "_models.DataMaskingState"]] = None, - exempt_principals: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword data_masking_state: The state of the data masking policy. Known values are: "Enabled" - and "Disabled". - :paramtype data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState - :keyword exempt_principals: The list of the exempt principals. Specifies the - semicolon-separated list of database users for which the data masking policy does not apply. - The specified users receive data results without masking for all of the database queries. - :paramtype exempt_principals: str - """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.kind: Optional[str] = None - self.data_masking_state = data_masking_state - self.exempt_principals = exempt_principals - self.application_principals: Optional[str] = None - self.masking_level: Optional[str] = None - - -class DataMaskingRule(ProxyResource): - """A database data masking rule. - - 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 location: The location of the data masking rule. - :vartype location: str - :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure portal. - :vartype kind: str - :ivar id_properties_id: The rule Id. - :vartype id_properties_id: str - :ivar rule_state: The rule state. Used to delete a rule. To delete an existing rule, specify - the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. - However, if the rule doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Known values are: "Enabled" and - "Disabled". - :vartype rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState - :ivar schema_name: The schema name on which the data masking rule is applied. - :vartype schema_name: str - :ivar table_name: The table name on which the data masking rule is applied. - :vartype table_name: str - :ivar column_name: The column name on which the data masking rule is applied. - :vartype column_name: str - :ivar alias_name: The alias name. This is a legacy parameter and is no longer used. - :vartype alias_name: str - :ivar masking_function: The masking function that is used for the data masking rule. Known - values are: "Default", "CCN", "Email", "Number", "SSN", and "Text". - :vartype masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction - :ivar number_from: The numberFrom property of the masking rule. Required if maskingFunction is - set to Number, otherwise this parameter will be ignored. - :vartype number_from: str - :ivar number_to: The numberTo property of the data masking rule. Required if maskingFunction is - set to Number, otherwise this parameter will be ignored. - :vartype number_to: str - :ivar prefix_size: If maskingFunction is set to Text, the number of characters to show unmasked - in the beginning of the string. Otherwise, this parameter will be ignored. - :vartype prefix_size: str - :ivar suffix_size: If maskingFunction is set to Text, the number of characters to show unmasked - at the end of the string. Otherwise, this parameter will be ignored. - :vartype suffix_size: str - :ivar replacement_string: If maskingFunction is set to Text, the character to use for masking - the unexposed part of the string. Otherwise, this parameter will be ignored. - :vartype replacement_string: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "kind": {"readonly": True}, - "id_properties_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "id_properties_id": {"key": "properties.id", "type": "str"}, - "rule_state": {"key": "properties.ruleState", "type": "str"}, - "schema_name": {"key": "properties.schemaName", "type": "str"}, - "table_name": {"key": "properties.tableName", "type": "str"}, - "column_name": {"key": "properties.columnName", "type": "str"}, - "alias_name": {"key": "properties.aliasName", "type": "str"}, - "masking_function": {"key": "properties.maskingFunction", "type": "str"}, - "number_from": {"key": "properties.numberFrom", "type": "str"}, - "number_to": {"key": "properties.numberTo", "type": "str"}, - "prefix_size": {"key": "properties.prefixSize", "type": "str"}, - "suffix_size": {"key": "properties.suffixSize", "type": "str"}, - "replacement_string": {"key": "properties.replacementString", "type": "str"}, - } - - def __init__( - self, - *, - rule_state: Optional[Union[str, "_models.DataMaskingRuleState"]] = None, - schema_name: Optional[str] = None, - table_name: Optional[str] = None, - column_name: Optional[str] = None, - alias_name: Optional[str] = None, - masking_function: Optional[Union[str, "_models.DataMaskingFunction"]] = None, - number_from: Optional[str] = None, - number_to: Optional[str] = None, - prefix_size: Optional[str] = None, - suffix_size: Optional[str] = None, - replacement_string: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword rule_state: The rule state. Used to delete a rule. To delete an existing rule, specify - the schemaName, tableName, columnName, maskingFunction, and specify ruleState as disabled. - However, if the rule doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Known values are: "Enabled" and - "Disabled". - :paramtype rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState - :keyword schema_name: The schema name on which the data masking rule is applied. - :paramtype schema_name: str - :keyword table_name: The table name on which the data masking rule is applied. - :paramtype table_name: str - :keyword column_name: The column name on which the data masking rule is applied. - :paramtype column_name: str - :keyword alias_name: The alias name. This is a legacy parameter and is no longer used. - :paramtype alias_name: str - :keyword masking_function: The masking function that is used for the data masking rule. Known - values are: "Default", "CCN", "Email", "Number", "SSN", and "Text". - :paramtype masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction - :keyword number_from: The numberFrom property of the masking rule. Required if maskingFunction - is set to Number, otherwise this parameter will be ignored. - :paramtype number_from: str - :keyword number_to: The numberTo property of the data masking rule. Required if maskingFunction - is set to Number, otherwise this parameter will be ignored. - :paramtype number_to: str - :keyword prefix_size: If maskingFunction is set to Text, the number of characters to show - unmasked in the beginning of the string. Otherwise, this parameter will be ignored. - :paramtype prefix_size: str - :keyword suffix_size: If maskingFunction is set to Text, the number of characters to show - unmasked at the end of the string. Otherwise, this parameter will be ignored. - :paramtype suffix_size: str - :keyword replacement_string: If maskingFunction is set to Text, the character to use for - masking the unexposed part of the string. Otherwise, this parameter will be ignored. - :paramtype replacement_string: str - """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.kind: Optional[str] = None - self.id_properties_id: Optional[str] = None - self.rule_state = rule_state - self.schema_name = schema_name - self.table_name = table_name - self.column_name = column_name - self.alias_name = alias_name - self.masking_function = masking_function - self.number_from = number_from - self.number_to = number_to - self.prefix_size = prefix_size - self.suffix_size = suffix_size - self.replacement_string = replacement_string - - -class DataMaskingRuleListResult(_serialization.Model): - """The list of database data masking rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DataMaskingRule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DataMaskingRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DataMaskingRule"]] = None - self.next_link: Optional[str] = None - - -class DataWarehouseUserActivities(ProxyResource): - """User activities of a data warehouse. - - 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 active_queries_count: Count of running and suspended queries. - :vartype active_queries_count: int - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "active_queries_count": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "active_queries_count": {"key": "properties.activeQueriesCount", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.active_queries_count: Optional[int] = None - - -class DataWarehouseUserActivitiesListResult(_serialization.Model): - """User activities of a data warehouse. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DataWarehouseUserActivities] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DataWarehouseUserActivities]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DataWarehouseUserActivities"]] = None - self.next_link: Optional[str] = None - - -class DeletedServer(ProxyResource): - """A deleted server. - - 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 version: The version of the deleted server. - :vartype version: str - :ivar deletion_time: The deletion time of the deleted server. - :vartype deletion_time: ~datetime.datetime - :ivar original_id: The original ID of the server before deletion. - :vartype original_id: str - :ivar fully_qualified_domain_name: The fully qualified domain name of the server. - :vartype fully_qualified_domain_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "version": {"readonly": True}, - "deletion_time": {"readonly": True}, - "original_id": {"readonly": True}, - "fully_qualified_domain_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "deletion_time": {"key": "properties.deletionTime", "type": "iso-8601"}, - "original_id": {"key": "properties.originalId", "type": "str"}, - "fully_qualified_domain_name": {"key": "properties.fullyQualifiedDomainName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.version: Optional[str] = None - self.deletion_time: Optional[datetime.datetime] = None - self.original_id: Optional[str] = None - self.fully_qualified_domain_name: Optional[str] = None - - -class DeletedServerListResult(_serialization.Model): - """A list of deleted servers. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DeletedServer] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DeletedServer]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DeletedServer"]] = None - self.next_link: Optional[str] = None - - -class DistributedAvailabilityGroup(ProxyResource): - """Distributed availability group between box and Sql Managed Instance. - - 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 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. - :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] - """ - - _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}, - } - - _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"}, - "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]"}, - } - - 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, - **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: Optional[str] = None - self.distributed_availability_group_id: Optional[str] = None - self.replication_mode = replication_mode - self.partner_link_role: Optional[Union[str, "_models.LinkRole"]] = 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): - """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: Optional[str] = None - self.partner_replica_id: Optional[str] = None - self.replica_state: Optional[str] = None - self.seeding_progress: Optional[str] = None - self.synchronization_health: Optional[Union[str, "_models.ReplicaSynchronizationHealth"]] = None - self.connected_state: Optional[Union[str, "_models.ReplicaConnectedState"]] = None - self.last_received_lsn: Optional[str] = None - self.last_received_time: Optional[datetime.datetime] = None - self.last_sent_lsn: Optional[str] = None - self.last_sent_time: Optional[datetime.datetime] = None - self.last_commit_lsn: Optional[str] = None - self.last_commit_time: Optional[datetime.datetime] = None - self.last_hardened_lsn: Optional[str] = None - self.last_hardened_time: Optional[datetime.datetime] = None - self.last_backup_lsn: Optional[str] = None - self.last_backup_time: Optional[datetime.datetime] = None - self.most_recent_link_error: Optional[str] = None - self.partner_auth_cert_validity: Optional["_models.CertificateInfo"] = None - self.instance_send_replication_lag_seconds: Optional[int] = None - self.instance_redo_replication_lag_seconds: Optional[int] = 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): - """A list of distributed availability groups in instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DistributedAvailabilityGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.DistributedAvailabilityGroup"]] = None - self.next_link: Optional[str] = None - - -class EditionCapability(_serialization.Model): - """The edition capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The database edition name. - :vartype name: str - :ivar supported_service_level_objectives: The list of supported service objectives for the - edition. - :vartype supported_service_level_objectives: - list[~azure.mgmt.sql.models.ServiceObjectiveCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. - :vartype zone_redundant: bool - :ivar read_scale: The read scale capability for the edition. - :vartype read_scale: ~azure.mgmt.sql.models.ReadScaleCapability - :ivar supported_storage_capabilities: The list of supported storage capabilities for this - edition. - :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] - :ivar zone_pinning: Whether or not zone pinning is supported for the edition. - :vartype zone_pinning: bool - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_service_level_objectives": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "read_scale": {"readonly": True}, - "supported_storage_capabilities": {"readonly": True}, - "zone_pinning": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_service_level_objectives": { - "key": "supportedServiceLevelObjectives", - "type": "[ServiceObjectiveCapability]", - }, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "read_scale": {"key": "readScale", "type": "ReadScaleCapability"}, - "supported_storage_capabilities": {"key": "supportedStorageCapabilities", "type": "[StorageCapability]"}, - "zone_pinning": {"key": "zonePinning", "type": "bool"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_service_level_objectives: Optional[list["_models.ServiceObjectiveCapability"]] = None - self.zone_redundant: Optional[bool] = None - self.read_scale: Optional["_models.ReadScaleCapability"] = None - self.supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = None - self.zone_pinning: Optional[bool] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPool(TrackedResource): - """An elastic pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The elastic pool SKU. - - The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU - name, tier/edition, family, and capacity) that are available to your subscription in an Azure - region, use the ``Capabilities_ListByLocation`` REST API or the following command: - - .. code-block:: azurecli - - az sql elastic-pool list-editions -l -o table - `. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar kind: Kind of elastic pool. This is metadata used for the Azure portal experience. - :vartype kind: str - :ivar state: The state of the elastic pool. Known values are: "Creating", "Ready", and - "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.ElasticPoolState - :ivar creation_date: The creation date of the elastic pool (ISO8601 format). - :vartype creation_date: ~datetime.datetime - :ivar max_size_bytes: The storage limit for the database elastic pool in bytes. - :vartype max_size_bytes: int - :ivar min_capacity: Minimal capacity that serverless pool will not shrink below, if not paused. - :vartype min_capacity: float - :ivar per_database_settings: The per database settings for the elastic pool. - :vartype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :ivar zone_redundant: Whether or not this elastic pool is zone redundant, which means the - replicas of this elastic pool will be spread across multiple availability zones. - :vartype zone_redundant: bool - :ivar license_type: The license type to apply for this elastic pool. Known values are: - "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :ivar maintenance_configuration_id: Maintenance configuration id assigned to the elastic pool. - This configuration defines the period when the maintenance updates will will occur. - :vartype maintenance_configuration_id: str - :ivar high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high - availability. Applicable only to Hyperscale elastic pools. - :vartype high_availability_replica_count: int - :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A - value of -1 means that automatic pause is disabled. - :vartype auto_pause_delay: int - :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: - "Default" and "VBS". - :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :ivar availability_zone: Specifies the availability zone the pool's primary replica is pinned - to. Known values are: "NoPreference", "1", "2", and "3". - :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "kind": {"readonly": True}, - "state": {"readonly": True}, - "creation_date": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "kind": {"key": "kind", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "int"}, - "min_capacity": {"key": "properties.minCapacity", "type": "float"}, - "per_database_settings": {"key": "properties.perDatabaseSettings", "type": "ElasticPoolPerDatabaseSettings"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, - "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, - "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, - "availability_zone": {"key": "properties.availabilityZone", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - max_size_bytes: Optional[int] = None, - min_capacity: Optional[float] = None, - per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = None, - zone_redundant: Optional[bool] = None, - license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, - maintenance_configuration_id: Optional[str] = None, - high_availability_replica_count: Optional[int] = None, - auto_pause_delay: Optional[int] = None, - preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, - availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The elastic pool SKU. - - The list of SKUs may vary by region and support offer. To determine the SKUs (including the SKU - name, tier/edition, family, and capacity) that are available to your subscription in an Azure - region, use the ``Capabilities_ListByLocation`` REST API or the following command: - - .. code-block:: azurecli - - az sql elastic-pool list-editions -l -o table - `. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword max_size_bytes: The storage limit for the database elastic pool in bytes. - :paramtype max_size_bytes: int - :keyword min_capacity: Minimal capacity that serverless pool will not shrink below, if not - paused. - :paramtype min_capacity: float - :keyword per_database_settings: The per database settings for the elastic pool. - :paramtype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :keyword zone_redundant: Whether or not this elastic pool is zone redundant, which means the - replicas of this elastic pool will be spread across multiple availability zones. - :paramtype zone_redundant: bool - :keyword license_type: The license type to apply for this elastic pool. Known values are: - "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :keyword maintenance_configuration_id: Maintenance configuration id assigned to the elastic - pool. This configuration defines the period when the maintenance updates will will occur. - :paramtype maintenance_configuration_id: str - :keyword high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high - availability. Applicable only to Hyperscale elastic pools. - :paramtype high_availability_replica_count: int - :keyword auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A - value of -1 means that automatic pause is disabled. - :paramtype auto_pause_delay: int - :keyword preferred_enclave_type: Type of enclave requested on the elastic pool. Known values - are: "Default" and "VBS". - :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :keyword availability_zone: Specifies the availability zone the pool's primary replica is - pinned to. Known values are: "NoPreference", "1", "2", and "3". - :paramtype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.kind: Optional[str] = None - self.state: Optional[Union[str, "_models.ElasticPoolState"]] = None - self.creation_date: Optional[datetime.datetime] = None - self.max_size_bytes = max_size_bytes - self.min_capacity = min_capacity - self.per_database_settings = per_database_settings - self.zone_redundant = zone_redundant - self.license_type = license_type - self.maintenance_configuration_id = maintenance_configuration_id - self.high_availability_replica_count = high_availability_replica_count - self.auto_pause_delay = auto_pause_delay - self.preferred_enclave_type = preferred_enclave_type - self.availability_zone = availability_zone - - -class ElasticPoolEditionCapability(_serialization.Model): - """The elastic pool edition capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The elastic pool edition name. - :vartype name: str - :ivar supported_elastic_pool_performance_levels: The list of supported elastic pool DTU levels - for the edition. - :vartype supported_elastic_pool_performance_levels: - list[~azure.mgmt.sql.models.ElasticPoolPerformanceLevelCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. - :vartype zone_redundant: bool - :ivar zone_pinning: Whether or not zone pinning is supported for the edition. - :vartype zone_pinning: bool - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_elastic_pool_performance_levels": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "zone_pinning": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_elastic_pool_performance_levels": { - "key": "supportedElasticPoolPerformanceLevels", - "type": "[ElasticPoolPerformanceLevelCapability]", - }, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "zone_pinning": {"key": "zonePinning", "type": "bool"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_elastic_pool_performance_levels: Optional[ - list["_models.ElasticPoolPerformanceLevelCapability"] - ] = None - self.zone_redundant: Optional[bool] = None - self.zone_pinning: Optional[bool] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPoolListResult(_serialization.Model): - """The result of an elastic pool list request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ElasticPool] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ElasticPool]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ElasticPool"]] = None - self.next_link: Optional[str] = None - - -class ElasticPoolOperation(ProxyResource): - """A elastic pool operation. - - 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 elastic_pool_name: The name of the elastic pool the operation is being performed on. - :vartype elastic_pool_name: str - :ivar operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar server_name: The name of the server. - :vartype server_name: str - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. - :vartype state: str - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "elastic_pool_name": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "server_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "elastic_pool_name": {"key": "properties.elasticPoolName", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.elastic_pool_name: Optional[str] = None - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.percent_complete: Optional[int] = None - self.server_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[str] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.is_user_error: Optional[bool] = None - self.estimated_completion_time: Optional[datetime.datetime] = None - self.description: Optional[str] = None - self.is_cancellable: Optional[bool] = None - - -class ElasticPoolOperationListResult(_serialization.Model): - """The response to a list elastic pool operations request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ElasticPoolOperation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ElasticPoolOperation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ElasticPoolOperation"]] = None - self.next_link: Optional[str] = None - - -class ElasticPoolPerDatabaseMaxPerformanceLevelCapability(_serialization.Model): # pylint: disable=name-too-long - """The max per-database performance level capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar limit: The maximum performance level per database. - :vartype limit: float - :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". - :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit - :ivar supported_per_database_min_performance_levels: The list of supported min database - performance levels. - :vartype supported_per_database_min_performance_levels: - list[~azure.mgmt.sql.models.ElasticPoolPerDatabaseMinPerformanceLevelCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "limit": {"readonly": True}, - "unit": {"readonly": True}, - "supported_per_database_min_performance_levels": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "limit": {"key": "limit", "type": "float"}, - "unit": {"key": "unit", "type": "str"}, - "supported_per_database_min_performance_levels": { - "key": "supportedPerDatabaseMinPerformanceLevels", - "type": "[ElasticPoolPerDatabaseMinPerformanceLevelCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.limit: Optional[float] = None - self.unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = None - self.supported_per_database_min_performance_levels: Optional[ - list["_models.ElasticPoolPerDatabaseMinPerformanceLevelCapability"] - ] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPoolPerDatabaseMinPerformanceLevelCapability(_serialization.Model): # pylint: disable=name-too-long - """The minimum per-database performance level capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar limit: The minimum performance level per database. - :vartype limit: float - :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". - :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "limit": {"readonly": True}, - "unit": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "limit": {"key": "limit", "type": "float"}, - "unit": {"key": "unit", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.limit: Optional[float] = None - self.unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPoolPerDatabaseSettings(_serialization.Model): - """Per database settings of an elastic pool. - - :ivar min_capacity: The minimum capacity all databases are guaranteed. - :vartype min_capacity: float - :ivar max_capacity: The maximum capacity any one database can consume. - :vartype max_capacity: float - :ivar auto_pause_delay: Auto Pause Delay for per database within pool. - :vartype auto_pause_delay: int - """ - - _attribute_map = { - "min_capacity": {"key": "minCapacity", "type": "float"}, - "max_capacity": {"key": "maxCapacity", "type": "float"}, - "auto_pause_delay": {"key": "autoPauseDelay", "type": "int"}, - } - - def __init__( - self, - *, - min_capacity: Optional[float] = None, - max_capacity: Optional[float] = None, - auto_pause_delay: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword min_capacity: The minimum capacity all databases are guaranteed. - :paramtype min_capacity: float - :keyword max_capacity: The maximum capacity any one database can consume. - :paramtype max_capacity: float - :keyword auto_pause_delay: Auto Pause Delay for per database within pool. - :paramtype auto_pause_delay: int - """ - super().__init__(**kwargs) - self.min_capacity = min_capacity - self.max_capacity = max_capacity - self.auto_pause_delay = auto_pause_delay - - -class ElasticPoolPerformanceLevelCapability(_serialization.Model): - """The Elastic Pool performance level capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar performance_level: The performance level for the pool. - :vartype performance_level: ~azure.mgmt.sql.models.PerformanceLevelCapability - :ivar sku: The sku. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar supported_license_types: List of supported license types. - :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] - :ivar max_database_count: The maximum number of databases supported. - :vartype max_database_count: int - :ivar included_max_size: The included (free) max size for this performance level. - :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar supported_max_sizes: The list of supported max sizes. - :vartype supported_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] - :ivar supported_per_database_max_sizes: The list of supported per database max sizes. - :vartype supported_per_database_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] - :ivar supported_per_database_max_performance_levels: The list of supported per database max - performance levels. - :vartype supported_per_database_max_performance_levels: - list[~azure.mgmt.sql.models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the performance level. - :vartype zone_redundant: bool - :ivar supported_maintenance_configurations: List of supported maintenance configurations. - :vartype supported_maintenance_configurations: - list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] - :ivar supported_min_capacities: List of supported min capacities. - :vartype supported_min_capacities: list[~azure.mgmt.sql.models.MinCapacityCapability] - :ivar supported_auto_pause_delay: Supported time range for auto pause delay. - :vartype supported_auto_pause_delay: ~azure.mgmt.sql.models.AutoPauseDelayTimeRange - :ivar supported_per_database_auto_pause_delay: Supported time range for per database auto pause - delay. - :vartype supported_per_database_auto_pause_delay: - ~azure.mgmt.sql.models.PerDatabaseAutoPauseDelayTimeRange - :ivar supported_zones: List of supported availability zones. - :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "performance_level": {"readonly": True}, - "sku": {"readonly": True}, - "supported_license_types": {"readonly": True}, - "max_database_count": {"readonly": True}, - "included_max_size": {"readonly": True}, - "supported_max_sizes": {"readonly": True}, - "supported_per_database_max_sizes": {"readonly": True}, - "supported_per_database_max_performance_levels": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "supported_maintenance_configurations": {"readonly": True}, - "supported_min_capacities": {"readonly": True}, - "supported_auto_pause_delay": {"readonly": True}, - "supported_per_database_auto_pause_delay": {"readonly": True}, - "supported_zones": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "performance_level": {"key": "performanceLevel", "type": "PerformanceLevelCapability"}, - "sku": {"key": "sku", "type": "Sku"}, - "supported_license_types": {"key": "supportedLicenseTypes", "type": "[LicenseTypeCapability]"}, - "max_database_count": {"key": "maxDatabaseCount", "type": "int"}, - "included_max_size": {"key": "includedMaxSize", "type": "MaxSizeCapability"}, - "supported_max_sizes": {"key": "supportedMaxSizes", "type": "[MaxSizeRangeCapability]"}, - "supported_per_database_max_sizes": {"key": "supportedPerDatabaseMaxSizes", "type": "[MaxSizeRangeCapability]"}, - "supported_per_database_max_performance_levels": { - "key": "supportedPerDatabaseMaxPerformanceLevels", - "type": "[ElasticPoolPerDatabaseMaxPerformanceLevelCapability]", - }, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "supported_maintenance_configurations": { - "key": "supportedMaintenanceConfigurations", - "type": "[MaintenanceConfigurationCapability]", - }, - "supported_min_capacities": {"key": "supportedMinCapacities", "type": "[MinCapacityCapability]"}, - "supported_auto_pause_delay": {"key": "supportedAutoPauseDelay", "type": "AutoPauseDelayTimeRange"}, - "supported_per_database_auto_pause_delay": { - "key": "supportedPerDatabaseAutoPauseDelay", - "type": "PerDatabaseAutoPauseDelayTimeRange", - }, - "supported_zones": {"key": "supportedZones", "type": "[ZonePinningCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.performance_level: Optional["_models.PerformanceLevelCapability"] = None - self.sku: Optional["_models.Sku"] = None - self.supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = None - self.max_database_count: Optional[int] = None - self.included_max_size: Optional["_models.MaxSizeCapability"] = None - self.supported_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = None - self.supported_per_database_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = None - self.supported_per_database_max_performance_levels: Optional[ - list["_models.ElasticPoolPerDatabaseMaxPerformanceLevelCapability"] - ] = None - self.zone_redundant: Optional[bool] = None - self.supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = None - self.supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = None - self.supported_auto_pause_delay: Optional["_models.AutoPauseDelayTimeRange"] = None - self.supported_per_database_auto_pause_delay: Optional["_models.PerDatabaseAutoPauseDelayTimeRange"] = None - self.supported_zones: Optional[list["_models.ZonePinningCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ElasticPoolUpdate(_serialization.Model): - """An elastic pool update. - - :ivar sku: An ARM Resource SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar max_size_bytes: The storage limit for the database elastic pool in bytes. - :vartype max_size_bytes: int - :ivar min_capacity: Minimal capacity that serverless pool will not shrink below, if not paused. - :vartype min_capacity: float - :ivar per_database_settings: The per database settings for the elastic pool. - :vartype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :ivar zone_redundant: Whether or not this elastic pool is zone redundant, which means the - replicas of this elastic pool will be spread across multiple availability zones. - :vartype zone_redundant: bool - :ivar license_type: The license type to apply for this elastic pool. Known values are: - "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :ivar maintenance_configuration_id: Maintenance configuration id assigned to the elastic pool. - This configuration defines the period when the maintenance updates will will occur. - :vartype maintenance_configuration_id: str - :ivar high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high - availability. Applicable only to Hyperscale elastic pools. - :vartype high_availability_replica_count: int - :ivar auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A - value of -1 means that automatic pause is disabled. - :vartype auto_pause_delay: int - :ivar preferred_enclave_type: Type of enclave requested on the elastic pool. Known values are: - "Default" and "VBS". - :vartype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :ivar availability_zone: Specifies the availability zone the pool's primary replica is pinned - to. Known values are: "NoPreference", "1", "2", and "3". - :vartype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - """ - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "tags": {"key": "tags", "type": "{str}"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "int"}, - "min_capacity": {"key": "properties.minCapacity", "type": "float"}, - "per_database_settings": {"key": "properties.perDatabaseSettings", "type": "ElasticPoolPerDatabaseSettings"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "high_availability_replica_count": {"key": "properties.highAvailabilityReplicaCount", "type": "int"}, - "auto_pause_delay": {"key": "properties.autoPauseDelay", "type": "int"}, - "preferred_enclave_type": {"key": "properties.preferredEnclaveType", "type": "str"}, - "availability_zone": {"key": "properties.availabilityZone", "type": "str"}, - } - - def __init__( - self, - *, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - max_size_bytes: Optional[int] = None, - min_capacity: Optional[float] = None, - per_database_settings: Optional["_models.ElasticPoolPerDatabaseSettings"] = None, - zone_redundant: Optional[bool] = None, - license_type: Optional[Union[str, "_models.ElasticPoolLicenseType"]] = None, - maintenance_configuration_id: Optional[str] = None, - high_availability_replica_count: Optional[int] = None, - auto_pause_delay: Optional[int] = None, - preferred_enclave_type: Optional[Union[str, "_models.AlwaysEncryptedEnclaveType"]] = None, - availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: An ARM Resource SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword max_size_bytes: The storage limit for the database elastic pool in bytes. - :paramtype max_size_bytes: int - :keyword min_capacity: Minimal capacity that serverless pool will not shrink below, if not - paused. - :paramtype min_capacity: float - :keyword per_database_settings: The per database settings for the elastic pool. - :paramtype per_database_settings: ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :keyword zone_redundant: Whether or not this elastic pool is zone redundant, which means the - replicas of this elastic pool will be spread across multiple availability zones. - :paramtype zone_redundant: bool - :keyword license_type: The license type to apply for this elastic pool. Known values are: - "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :keyword maintenance_configuration_id: Maintenance configuration id assigned to the elastic - pool. This configuration defines the period when the maintenance updates will will occur. - :paramtype maintenance_configuration_id: str - :keyword high_availability_replica_count: The number of secondary replicas associated with the - Business Critical, Premium, or Hyperscale edition elastic pool that are used to provide high - availability. Applicable only to Hyperscale elastic pools. - :paramtype high_availability_replica_count: int - :keyword auto_pause_delay: Time in minutes after which elastic pool is automatically paused. A - value of -1 means that automatic pause is disabled. - :paramtype auto_pause_delay: int - :keyword preferred_enclave_type: Type of enclave requested on the elastic pool. Known values - are: "Default" and "VBS". - :paramtype preferred_enclave_type: str or ~azure.mgmt.sql.models.AlwaysEncryptedEnclaveType - :keyword availability_zone: Specifies the availability zone the pool's primary replica is - pinned to. Known values are: "NoPreference", "1", "2", and "3". - :paramtype availability_zone: str or ~azure.mgmt.sql.models.AvailabilityZoneType - """ - super().__init__(**kwargs) - self.sku = sku - self.tags = tags - self.max_size_bytes = max_size_bytes - self.min_capacity = min_capacity - self.per_database_settings = per_database_settings - self.zone_redundant = zone_redundant - self.license_type = license_type - self.maintenance_configuration_id = maintenance_configuration_id - self.high_availability_replica_count = high_availability_replica_count - self.auto_pause_delay = auto_pause_delay - self.preferred_enclave_type = preferred_enclave_type - self.availability_zone = availability_zone - - -class EncryptionProtector(ProxyResource): - """The server encryption protector. - - 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 kind: Kind of encryption protector. This is metadata used for the Azure portal - experience. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :ivar subregion: Subregion of the encryption protector. - :vartype subregion: str - :ivar server_key_name: The name of the server key. - :vartype server_key_name: str - :ivar server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - Known values are: "ServiceManaged" and "AzureKeyVault". - :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :ivar uri: The URI of the server key. - :vartype uri: str - :ivar thumbprint: Thumbprint of the server key. - :vartype thumbprint: str - :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :vartype auto_rotation_enabled: bool - :ivar key_version: The version of the server key being used as encryption protector. - :vartype key_version: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "location": {"readonly": True}, - "subregion": {"readonly": True}, - "uri": {"readonly": True}, - "thumbprint": {"readonly": True}, - "key_version": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "subregion": {"key": "properties.subregion", "type": "str"}, - "server_key_name": {"key": "properties.serverKeyName", "type": "str"}, - "server_key_type": {"key": "properties.serverKeyType", "type": "str"}, - "uri": {"key": "properties.uri", "type": "str"}, - "thumbprint": {"key": "properties.thumbprint", "type": "str"}, - "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, - "key_version": {"key": "properties.keyVersion", "type": "str"}, - } - - def __init__( - self, - *, - server_key_name: Optional[str] = None, - server_key_type: Optional[Union[str, "_models.ServerKeyType"]] = None, - auto_rotation_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword server_key_name: The name of the server key. - :paramtype server_key_name: str - :keyword server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - Known values are: "ServiceManaged" and "AzureKeyVault". - :paramtype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :keyword auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :paramtype auto_rotation_enabled: bool - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.location: Optional[str] = None - self.subregion: Optional[str] = None - self.server_key_name = server_key_name - self.server_key_type = server_key_type - self.uri: Optional[str] = None - self.thumbprint: Optional[str] = None - self.auto_rotation_enabled = auto_rotation_enabled - self.key_version: Optional[str] = None - - -class EncryptionProtectorListResult(_serialization.Model): - """A list of server encryption protectors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.EncryptionProtector] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[EncryptionProtector]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.EncryptionProtector"]] = None - self.next_link: Optional[str] = None - - -class EndpointCertificate(ProxyResource): - """Certificate used on an endpoint on the Managed Instance. - - 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 public_blob: The certificate public blob. - :vartype public_blob: str - """ - - _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"}, - "public_blob": {"key": "properties.publicBlob", "type": "str"}, - } - - def __init__(self, *, public_blob: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword public_blob: The certificate public blob. - :paramtype public_blob: str - """ - super().__init__(**kwargs) - self.public_blob = public_blob - - -class EndpointCertificateListResult(_serialization.Model): - """A list of endpoint certificates on the target instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.EndpointCertificate] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[EndpointCertificate]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.EndpointCertificate"]] = None - self.next_link: Optional[str] = None - - -class EndpointDependency(_serialization.Model): - """A domain name that the managed instance service needs to communicate with, along with - additional details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar domain_name: The domain name of the dependency. - :vartype domain_name: str - :ivar endpoint_details: The IP Addresses and Ports used when connecting to DomainName. - :vartype endpoint_details: list[~azure.mgmt.sql.models.EndpointDetail] - """ - - _validation = { - "domain_name": {"readonly": True}, - "endpoint_details": {"readonly": True}, - } - - _attribute_map = { - "domain_name": {"key": "domainName", "type": "str"}, - "endpoint_details": {"key": "endpointDetails", "type": "[EndpointDetail]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.domain_name: Optional[str] = None - self.endpoint_details: Optional[list["_models.EndpointDetail"]] = None - - -class EndpointDetail(_serialization.Model): - """A domain name that the managed instance service needs to communicate with, along with - additional details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar port: The port an endpoint is connected to. - :vartype port: int - """ - - _validation = { - "port": {"readonly": True}, - } - - _attribute_map = { - "port": {"key": "port", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.port: Optional[int] = None - - -class ErrorAdditionalInfo(_serialization.Model): - """The resource management error additional info. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The additional info type. - :vartype type: str - :ivar info: The additional info. - :vartype info: JSON - """ - - _validation = { - "type": {"readonly": True}, - "info": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "info": {"key": "info", "type": "object"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[str] = None - self.info: Optional[JSON] = None - - -class ErrorDetail(_serialization.Model): - """The error detail. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - :ivar target: The error target. - :vartype target: str - :ivar details: The error details. - :vartype details: list[~azure.mgmt.sql.models.ErrorDetail] - :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.sql.models.ErrorAdditionalInfo] - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - "target": {"readonly": True}, - "details": {"readonly": True}, - "additional_info": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - "target": {"key": "target", "type": "str"}, - "details": {"key": "details", "type": "[ErrorDetail]"}, - "additional_info": {"key": "additionalInfo", "type": "[ErrorAdditionalInfo]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - self.target: Optional[str] = None - self.details: Optional[list["_models.ErrorDetail"]] = None - self.additional_info: Optional[list["_models.ErrorAdditionalInfo"]] = None - - -class ErrorResponse(_serialization.Model): - """Common error response for all Azure Resource Manager APIs to return error details for failed - operations. (This also follows the OData error response format.). - - :ivar error: The error object. - :vartype error: ~azure.mgmt.sql.models.ErrorDetail - """ - - _attribute_map = { - "error": {"key": "error", "type": "ErrorDetail"}, - } - - def __init__(self, *, error: Optional["_models.ErrorDetail"] = None, **kwargs: Any) -> None: - """ - :keyword error: The error object. - :paramtype error: ~azure.mgmt.sql.models.ErrorDetail - """ - super().__init__(**kwargs) - self.error = error - - -class ExportDatabaseDefinition(_serialization.Model): - """Contains the information necessary to perform export database operation. - - All required parameters must be populated in order to send to server. - - :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype storage_key: str - :ivar storage_uri: Storage Uri. Required. - :vartype storage_uri: str - :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :vartype administrator_login_password: str - :ivar authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :vartype authentication_type: str - :ivar network_isolation: Optional resource information to enable network isolation for request. - :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - - _validation = { - "storage_key_type": {"required": True}, - "storage_key": {"required": True}, - "storage_uri": {"required": True}, - "administrator_login": {"required": True}, - } - - _attribute_map = { - "storage_key_type": {"key": "storageKeyType", "type": "str"}, - "storage_key": {"key": "storageKey", "type": "str"}, - "storage_uri": {"key": "storageUri", "type": "str"}, - "administrator_login": {"key": "administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "administratorLoginPassword", "type": "str"}, - "authentication_type": {"key": "authenticationType", "type": "str"}, - "network_isolation": {"key": "networkIsolation", "type": "NetworkIsolationSettings"}, - } - - def __init__( - self, - *, - storage_key_type: Union[str, "_models.StorageKeyType"], - storage_key: str, - storage_uri: str, - administrator_login: str, - administrator_login_password: Optional[str] = None, - authentication_type: Optional[str] = None, - network_isolation: Optional["_models.NetworkIsolationSettings"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key for the storage account. If StorageKeyType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype storage_key: str - :keyword storage_uri: Storage Uri. Required. - :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. If AuthenticationType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :paramtype administrator_login_password: str - :keyword authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :paramtype authentication_type: str - :keyword network_isolation: Optional resource information to enable network isolation for - request. - :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - super().__init__(**kwargs) - self.storage_key_type = storage_key_type - self.storage_key = storage_key - self.storage_uri = storage_uri - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.authentication_type = authentication_type - self.network_isolation = network_isolation - - -class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): - """An extended database blob auditing policy. - - 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 predicate_expression: Specifies condition of where clause when creating an audit. - :vartype predicate_expression: str - :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :vartype retention_days: int - :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :vartype audit_actions_and_groups: list[str] - :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the - storage's secondary key. - :vartype is_storage_secondary_key_in_use: bool - :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_azure_monitor_target_enabled: bool - :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum - is 2,147,483,647. - :vartype queue_delay_ms: int - :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :vartype is_managed_identity_in_use: bool - :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :vartype storage_account_access_key: str - :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. - :vartype storage_account_subscription_id: str - """ - - _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"}, - "predicate_expression": {"key": "properties.predicateExpression", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "audit_actions_and_groups": {"key": "properties.auditActionsAndGroups", "type": "[str]"}, - "is_storage_secondary_key_in_use": {"key": "properties.isStorageSecondaryKeyInUse", "type": "bool"}, - "is_azure_monitor_target_enabled": {"key": "properties.isAzureMonitorTargetEnabled", "type": "bool"}, - "queue_delay_ms": {"key": "properties.queueDelayMs", "type": "int"}, - "is_managed_identity_in_use": {"key": "properties.isManagedIdentityInUse", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "storage_account_subscription_id": {"key": "properties.storageAccountSubscriptionId", "type": "str"}, - } - - def __init__( - self, - *, - predicate_expression: Optional[str] = None, - retention_days: Optional[int] = None, - audit_actions_and_groups: Optional[list[str]] = None, - is_storage_secondary_key_in_use: Optional[bool] = None, - is_azure_monitor_target_enabled: Optional[bool] = None, - queue_delay_ms: Optional[int] = None, - is_managed_identity_in_use: Optional[bool] = None, - state: Optional[Union[str, "_models.BlobAuditingPolicyState"]] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - storage_account_subscription_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword predicate_expression: Specifies condition of where clause when creating an audit. - :paramtype predicate_expression: str - :keyword retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :paramtype retention_days: int - :keyword audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :paramtype audit_actions_and_groups: list[str] - :keyword is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is - the storage's secondary key. - :paramtype is_storage_secondary_key_in_use: bool - :keyword is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_azure_monitor_target_enabled: bool - :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. The default minimum value is 1000 (1 second). The - maximum is 2,147,483,647. - :paramtype queue_delay_ms: int - :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :paramtype is_managed_identity_in_use: bool - :keyword state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the auditing storage - account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :paramtype storage_account_access_key: str - :keyword storage_account_subscription_id: Specifies the blob storage subscription Id. - :paramtype storage_account_subscription_id: str - """ - super().__init__(**kwargs) - self.predicate_expression = predicate_expression - self.retention_days = retention_days - self.audit_actions_and_groups = audit_actions_and_groups - self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use - self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled - self.queue_delay_ms = queue_delay_ms - self.is_managed_identity_in_use = is_managed_identity_in_use - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.storage_account_subscription_id = storage_account_subscription_id - - -class ExtendedDatabaseBlobAuditingPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of database extended auditing settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ExtendedDatabaseBlobAuditingPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ExtendedDatabaseBlobAuditingPolicy"]] = None - self.next_link: Optional[str] = None - - -class ExtendedServerBlobAuditingPolicy(ProxyResource): - """An extended server blob auditing policy. - - 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 is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, devops - logs will be sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled', - 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true - - When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should also be created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_devops_audit_enabled: bool - :ivar predicate_expression: Specifies condition of where clause when creating an audit. - :vartype predicate_expression: str - :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :vartype retention_days: int - :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :vartype audit_actions_and_groups: list[str] - :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the - storage's secondary key. - :vartype is_storage_secondary_key_in_use: bool - :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_azure_monitor_target_enabled: bool - :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum - is 2,147,483,647. - :vartype queue_delay_ms: int - :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :vartype is_managed_identity_in_use: bool - :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :vartype storage_account_access_key: str - :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. - :vartype storage_account_subscription_id: str - """ - - _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"}, - "is_devops_audit_enabled": {"key": "properties.isDevopsAuditEnabled", "type": "bool"}, - "predicate_expression": {"key": "properties.predicateExpression", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "audit_actions_and_groups": {"key": "properties.auditActionsAndGroups", "type": "[str]"}, - "is_storage_secondary_key_in_use": {"key": "properties.isStorageSecondaryKeyInUse", "type": "bool"}, - "is_azure_monitor_target_enabled": {"key": "properties.isAzureMonitorTargetEnabled", "type": "bool"}, - "queue_delay_ms": {"key": "properties.queueDelayMs", "type": "int"}, - "is_managed_identity_in_use": {"key": "properties.isManagedIdentityInUse", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "storage_account_subscription_id": {"key": "properties.storageAccountSubscriptionId", "type": "str"}, - } - - def __init__( - self, - *, - is_devops_audit_enabled: Optional[bool] = None, - predicate_expression: Optional[str] = None, - retention_days: Optional[int] = None, - audit_actions_and_groups: Optional[list[str]] = None, - is_storage_secondary_key_in_use: Optional[bool] = None, - is_azure_monitor_target_enabled: Optional[bool] = None, - queue_delay_ms: Optional[int] = None, - is_managed_identity_in_use: Optional[bool] = None, - state: Optional[Union[str, "_models.BlobAuditingPolicyState"]] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - storage_account_subscription_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, - devops logs will be sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled', - 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true - - When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should also be created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_devops_audit_enabled: bool - :keyword predicate_expression: Specifies condition of where clause when creating an audit. - :paramtype predicate_expression: str - :keyword retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :paramtype retention_days: int - :keyword audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :paramtype audit_actions_and_groups: list[str] - :keyword is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is - the storage's secondary key. - :paramtype is_storage_secondary_key_in_use: bool - :keyword is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_azure_monitor_target_enabled: bool - :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. The default minimum value is 1000 (1 second). The - maximum is 2,147,483,647. - :paramtype queue_delay_ms: int - :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :paramtype is_managed_identity_in_use: bool - :keyword state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the auditing storage - account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :paramtype storage_account_access_key: str - :keyword storage_account_subscription_id: Specifies the blob storage subscription Id. - :paramtype storage_account_subscription_id: str - """ - super().__init__(**kwargs) - self.is_devops_audit_enabled = is_devops_audit_enabled - self.predicate_expression = predicate_expression - self.retention_days = retention_days - self.audit_actions_and_groups = audit_actions_and_groups - self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use - self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled - self.queue_delay_ms = queue_delay_ms - self.is_managed_identity_in_use = is_managed_identity_in_use - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.storage_account_subscription_id = storage_account_subscription_id - - -class ExtendedServerBlobAuditingPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of server extended auditing settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ExtendedServerBlobAuditingPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ExtendedServerBlobAuditingPolicy"]] = None - self.next_link: Optional[str] = None - - -class FailoverGroup(ProxyResource): - """A failover group. - - 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 location: Resource location. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar read_write_endpoint: Read-write endpoint of the failover group instance. - :vartype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint - :ivar read_only_endpoint: Read-only endpoint of the failover group instance. - :vartype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint - :ivar replication_role: Local replication role of the failover group instance. Known values - are: "Primary" and "Secondary". - :vartype replication_role: str or ~azure.mgmt.sql.models.FailoverGroupReplicationRole - :ivar replication_state: Replication state of the failover group instance. - :vartype replication_state: str - :ivar partner_servers: List of partner server information for the failover group. - :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 = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "replication_role": {"readonly": True}, - "replication_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "read_write_endpoint": {"key": "properties.readWriteEndpoint", "type": "FailoverGroupReadWriteEndpoint"}, - "read_only_endpoint": {"key": "properties.readOnlyEndpoint", "type": "FailoverGroupReadOnlyEndpoint"}, - "replication_role": {"key": "properties.replicationRole", "type": "str"}, - "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__( - self, - *, - tags: Optional[dict[str, str]] = None, - read_write_endpoint: Optional["_models.FailoverGroupReadWriteEndpoint"] = None, - 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: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword read_write_endpoint: Read-write endpoint of the failover group instance. - :paramtype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint - :keyword read_only_endpoint: Read-only endpoint of the failover group instance. - :paramtype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint - :keyword partner_servers: List of partner server information for the failover group. - :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: Optional[str] = None - self.tags = tags - self.read_write_endpoint = read_write_endpoint - self.read_only_endpoint = read_only_endpoint - self.replication_role: Optional[Union[str, "_models.FailoverGroupReplicationRole"]] = None - self.replication_state: Optional[str] = None - self.partner_servers = partner_servers - self.databases = databases - self.secondary_type = secondary_type - - -class FailoverGroupListResult(_serialization.Model): - """A list of failover groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.FailoverGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[FailoverGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.FailoverGroup"]] = None - self.next_link: Optional[str] = None - - -class FailoverGroupReadOnlyEndpoint(_serialization.Model): - """Read-only endpoint of the failover group instance. - - :ivar failover_policy: Failover policy of the read-only endpoint for the failover group. Known - values are: "Disabled" and "Enabled". - :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - :ivar target_server: The target partner server where the read-only endpoint points to. - :vartype target_server: str - """ - - _attribute_map = { - "failover_policy": {"key": "failoverPolicy", "type": "str"}, - "target_server": {"key": "targetServer", "type": "str"}, - } - - def __init__( - self, - *, - failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = None, - target_server: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword failover_policy: Failover policy of the read-only endpoint for the failover group. - Known values are: "Disabled" and "Enabled". - :paramtype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - :keyword target_server: The target partner server where the read-only endpoint points to. - :paramtype target_server: str - """ - super().__init__(**kwargs) - self.failover_policy = failover_policy - self.target_server = target_server - - -class FailoverGroupReadWriteEndpoint(_serialization.Model): - """Read-write endpoint of the failover group instance. - - All required parameters must be populated in order to send to server. - - :ivar failover_policy: Failover policy of the read-write endpoint for the failover group. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. - Known values are: "Manual" and "Automatic". - :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :ivar failover_with_data_loss_grace_period_minutes: Grace period before failover with data loss - is attempted for the read-write endpoint. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. - :vartype failover_with_data_loss_grace_period_minutes: int - """ - - _validation = { - "failover_policy": {"required": True}, - } - - _attribute_map = { - "failover_policy": {"key": "failoverPolicy", "type": "str"}, - "failover_with_data_loss_grace_period_minutes": { - "key": "failoverWithDataLossGracePeriodMinutes", - "type": "int", - }, - } - - def __init__( - self, - *, - failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"], - failover_with_data_loss_grace_period_minutes: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword failover_policy: Failover policy of the read-write endpoint for the failover group. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. - Known values are: "Manual" and "Automatic". - :paramtype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :keyword failover_with_data_loss_grace_period_minutes: Grace period before failover with data - loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. - :paramtype failover_with_data_loss_grace_period_minutes: int - """ - super().__init__(**kwargs) - self.failover_policy = failover_policy - self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes - - -class FailoverGroupUpdate(_serialization.Model): - """A failover group update request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar read_write_endpoint: Read-write endpoint of the failover group instance. - :vartype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint - :ivar read_only_endpoint: Read-only endpoint of the failover group instance. - :vartype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint - :ivar databases: List of databases in the failover group. - :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 = { - "tags": {"key": "tags", "type": "{str}"}, - "read_write_endpoint": {"key": "properties.readWriteEndpoint", "type": "FailoverGroupReadWriteEndpoint"}, - "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__( - self, - *, - tags: Optional[dict[str, str]] = None, - read_write_endpoint: Optional["_models.FailoverGroupReadWriteEndpoint"] = None, - 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: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword read_write_endpoint: Read-write endpoint of the failover group instance. - :paramtype read_write_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadWriteEndpoint - :keyword read_only_endpoint: Read-only endpoint of the failover group instance. - :paramtype read_only_endpoint: ~azure.mgmt.sql.models.FailoverGroupReadOnlyEndpoint - :keyword databases: List of databases in the failover group. - :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 - self.read_write_endpoint = read_write_endpoint - self.read_only_endpoint = read_only_endpoint - self.databases = databases - self.partner_servers = partner_servers - self.secondary_type = secondary_type - - -class ResourceWithWritableName(_serialization.Model): - """ARM 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 - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Resource name. - :paramtype name: str - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name = name - self.type: Optional[str] = None - - -class ProxyResourceWithWritableName(ResourceWithWritableName): - """ARM proxy 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 - """ - - -class FirewallRule(ProxyResourceWithWritableName): - """A server firewall rule. - - 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 start_ip_address: The start IP address of the firewall rule. Must be IPv4 format. Use - value '0.0.0.0' for all Azure-internal IP addresses. - :vartype start_ip_address: str - :ivar end_ip_address: The end IP address of the firewall rule. Must be IPv4 format. Must be - greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP - addresses. - :vartype end_ip_address: str - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "start_ip_address": {"key": "properties.startIpAddress", "type": "str"}, - "end_ip_address": {"key": "properties.endIpAddress", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - start_ip_address: Optional[str] = None, - end_ip_address: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Resource name. - :paramtype name: str - :keyword start_ip_address: The start IP address of the firewall rule. Must be IPv4 format. Use - value '0.0.0.0' for all Azure-internal IP addresses. - :paramtype start_ip_address: str - :keyword end_ip_address: The end IP address of the firewall rule. Must be IPv4 format. Must be - greater than or equal to startIpAddress. Use value '0.0.0.0' for all Azure-internal IP - addresses. - :paramtype end_ip_address: str - """ - super().__init__(name=name, **kwargs) - self.start_ip_address = start_ip_address - self.end_ip_address = end_ip_address - - -class FirewallRuleList(_serialization.Model): - """A list of server firewall rules. - - :ivar values: - :vartype values: list[~azure.mgmt.sql.models.FirewallRule] - """ - - _attribute_map = { - "values": {"key": "values", "type": "[FirewallRule]"}, - } - - def __init__(self, *, values: Optional[list["_models.FirewallRule"]] = None, **kwargs: Any) -> None: - """ - :keyword values: - :paramtype values: list[~azure.mgmt.sql.models.FirewallRule] - """ - super().__init__(**kwargs) - self.values = values - - -class FirewallRuleListResult(_serialization.Model): - """The response to a list firewall rules request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.FirewallRule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[FirewallRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.FirewallRule"]] = None - self.next_link: Optional[str] = None - - -class FreeLimitExhaustionBehaviorCapability(_serialization.Model): - """Supported free limit exhaustion behavior options. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar exhaustion_behavior_type: Free limit exhaustion behavior type. Known values are: - "AutoPause" and "BillOverUsage". - :vartype exhaustion_behavior_type: str or ~azure.mgmt.sql.models.FreeLimitExhaustionBehavior - :ivar status: Free limit exhaustion behavior status. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - """ - - _validation = { - "exhaustion_behavior_type": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "exhaustion_behavior_type": {"key": "exhaustionBehaviorType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.exhaustion_behavior_type: Optional[Union[str, "_models.FreeLimitExhaustionBehavior"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - - -class GeoBackupPolicy(ProxyResource): - """A Geo backup policy. - - 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 location: Backup policy location. - :vartype location: str - :ivar kind: Kind of geo backup policy. This is metadata used for the Azure portal experience. - :vartype kind: str - :ivar state: The state of the geo backup policy. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState - :ivar storage_type: The storage type of the geo backup policy. - :vartype storage_type: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "kind": {"readonly": True}, - "storage_type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_type": {"key": "properties.storageType", "type": "str"}, - } - - def __init__(self, *, state: Optional[Union[str, "_models.GeoBackupPolicyState"]] = None, **kwargs: Any) -> None: - """ - :keyword state: The state of the geo backup policy. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState - """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.kind: Optional[str] = None - self.state = state - self.storage_type: Optional[str] = None - - -class GeoBackupPolicyListResult(_serialization.Model): - """The list of geo backup policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.GeoBackupPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GeoBackupPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.GeoBackupPolicy"]] = None - self.next_link: Optional[str] = None - - -class ImportExistingDatabaseDefinition(_serialization.Model): - """Contains the information necessary to perform import operation for existing database. - - All required parameters must be populated in order to send to server. - - :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype storage_key: str - :ivar storage_uri: Storage Uri. Required. - :vartype storage_uri: str - :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :vartype administrator_login_password: str - :ivar authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :vartype authentication_type: str - :ivar network_isolation: Optional resource information to enable network isolation for request. - :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - - _validation = { - "storage_key_type": {"required": True}, - "storage_key": {"required": True}, - "storage_uri": {"required": True}, - "administrator_login": {"required": True}, - } - - _attribute_map = { - "storage_key_type": {"key": "storageKeyType", "type": "str"}, - "storage_key": {"key": "storageKey", "type": "str"}, - "storage_uri": {"key": "storageUri", "type": "str"}, - "administrator_login": {"key": "administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "administratorLoginPassword", "type": "str"}, - "authentication_type": {"key": "authenticationType", "type": "str"}, - "network_isolation": {"key": "networkIsolation", "type": "NetworkIsolationSettings"}, - } - - def __init__( - self, - *, - storage_key_type: Union[str, "_models.StorageKeyType"], - storage_key: str, - storage_uri: str, - administrator_login: str, - administrator_login_password: Optional[str] = None, - authentication_type: Optional[str] = None, - network_isolation: Optional["_models.NetworkIsolationSettings"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key for the storage account. If StorageKeyType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype storage_key: str - :keyword storage_uri: Storage Uri. Required. - :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. If AuthenticationType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :paramtype administrator_login_password: str - :keyword authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :paramtype authentication_type: str - :keyword network_isolation: Optional resource information to enable network isolation for - request. - :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings - """ - super().__init__(**kwargs) - self.storage_key_type = storage_key_type - self.storage_key = storage_key - self.storage_uri = storage_uri - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.authentication_type = authentication_type - self.network_isolation = network_isolation - - -class ImportExportExtensionsOperationListResult(_serialization.Model): # pylint: disable=name-too-long - """Import export operation extensions list. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ImportExportExtensionsOperationResult]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ImportExportExtensionsOperationResult"]] = None - self.next_link: Optional[str] = None - - -class ImportExportExtensionsOperationResult(ProxyResource): - """An Extension 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 last_modified_time: Last modified time. - :vartype last_modified_time: str - :ivar server_name: Server name. - :vartype server_name: str - :ivar database_name: Database name. - :vartype database_name: str - :ivar status: Operation status. - :vartype status: str - :ivar error_message: Error message. - :vartype error_message: str - :ivar queued_time: Queued time. - :vartype queued_time: str - :ivar blob_uri: Blob URI. - :vartype blob_uri: str - :ivar private_endpoint_connections: Gets the status of private endpoints associated with this - request. - :vartype private_endpoint_connections: - list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "request_id": {"readonly": True}, - "request_type": {"readonly": True}, - "last_modified_time": {"readonly": True}, - "server_name": {"readonly": True}, - "database_name": {"readonly": True}, - "status": {"readonly": True}, - "error_message": {"readonly": True}, - "queued_time": {"readonly": True}, - "blob_uri": {"readonly": True}, - "private_endpoint_connections": {"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"}, - "last_modified_time": {"key": "properties.lastModifiedTime", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - "queued_time": {"key": "properties.queuedTime", "type": "str"}, - "blob_uri": {"key": "properties.blobUri", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnectionRequestStatus]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.request_id: Optional[str] = None - self.request_type: Optional[str] = None - self.last_modified_time: Optional[str] = None - self.server_name: Optional[str] = None - self.database_name: Optional[str] = None - self.status: Optional[str] = None - self.error_message: Optional[str] = None - self.queued_time: Optional[str] = None - self.blob_uri: Optional[str] = None - self.private_endpoint_connections: Optional[list["_models.PrivateEndpointConnectionRequestStatus"]] = None - - -class ImportExportOperationResult(ProxyResource): - """An ImportExport 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 last_modified_time: Last modified time. - :vartype last_modified_time: str - :ivar blob_uri: Blob Uri. - :vartype blob_uri: str - :ivar server_name: Server name. - :vartype server_name: str - :ivar database_name: Database name. - :vartype database_name: str - :ivar status: Operation status. - :vartype status: str - :ivar error_message: Error message. - :vartype error_message: str - :ivar private_endpoint_connections: Gets the status of private endpoints associated with this - request. - :vartype private_endpoint_connections: - list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "request_id": {"readonly": True}, - "request_type": {"readonly": True}, - "queued_time": {"readonly": True}, - "last_modified_time": {"readonly": True}, - "blob_uri": {"readonly": True}, - "server_name": {"readonly": True}, - "database_name": {"readonly": True}, - "status": {"readonly": True}, - "error_message": {"readonly": True}, - "private_endpoint_connections": {"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"}, - "last_modified_time": {"key": "properties.lastModifiedTime", "type": "str"}, - "blob_uri": {"key": "properties.blobUri", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[PrivateEndpointConnectionRequestStatus]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.request_id: Optional[str] = None - self.request_type: Optional[str] = None - self.queued_time: Optional[str] = None - self.last_modified_time: Optional[str] = None - self.blob_uri: Optional[str] = None - self.server_name: Optional[str] = None - self.database_name: Optional[str] = None - self.status: Optional[str] = None - self.error_message: Optional[str] = None - self.private_endpoint_connections: Optional[list["_models.PrivateEndpointConnectionRequestStatus"]] = None - - -class ImportNewDatabaseDefinition(_serialization.Model): - """Contains the information necessary to perform import operation for new database. - - All required parameters must be populated in order to send to server. - - :ivar database_name: Name of the import database. - :vartype database_name: str - :ivar edition: Edition of the import database. - :vartype edition: str - :ivar service_objective_name: Service level objective name of the import database. - :vartype service_objective_name: str - :ivar max_size_bytes: Max size in bytes for the import database. - :vartype max_size_bytes: str - :ivar storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :vartype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :ivar storage_key: Storage key for the storage account. If StorageKeyType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype storage_key: str - :ivar storage_uri: Storage Uri. Required. - :vartype storage_uri: str - :ivar administrator_login: Administrator login name. If AuthenticationType is ManagedIdentity, - this field should specify the Managed Identity's resource ID. Required. - :vartype administrator_login: str - :ivar administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :vartype administrator_login_password: str - :ivar authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :vartype authentication_type: str - :ivar network_isolation: Optional resource information to enable network isolation for request. - :vartype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated - """ - - _validation = { - "storage_key_type": {"required": True}, - "storage_key": {"required": True}, - "storage_uri": {"required": True}, - "administrator_login": {"required": True}, - } - - _attribute_map = { - "database_name": {"key": "databaseName", "type": "str"}, - "edition": {"key": "edition", "type": "str"}, - "service_objective_name": {"key": "serviceObjectiveName", "type": "str"}, - "max_size_bytes": {"key": "maxSizeBytes", "type": "str"}, - "storage_key_type": {"key": "storageKeyType", "type": "str"}, - "storage_key": {"key": "storageKey", "type": "str"}, - "storage_uri": {"key": "storageUri", "type": "str"}, - "administrator_login": {"key": "administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "administratorLoginPassword", "type": "str"}, - "authentication_type": {"key": "authenticationType", "type": "str"}, - "network_isolation": {"key": "networkIsolation", "type": "NetworkIsolationSettingsAutoGenerated"}, - } - - def __init__( - self, - *, - storage_key_type: Union[str, "_models.StorageKeyType"], - storage_key: str, - storage_uri: str, - administrator_login: str, - database_name: Optional[str] = None, - edition: Optional[str] = None, - service_objective_name: Optional[str] = None, - max_size_bytes: Optional[str] = None, - administrator_login_password: Optional[str] = None, - authentication_type: Optional[str] = None, - network_isolation: Optional["_models.NetworkIsolationSettingsAutoGenerated"] = None, - **kwargs: Any - ) -> None: - """ - :keyword database_name: Name of the import database. - :paramtype database_name: str - :keyword edition: Edition of the import database. - :paramtype edition: str - :keyword service_objective_name: Service level objective name of the import database. - :paramtype service_objective_name: str - :keyword max_size_bytes: Max size in bytes for the import database. - :paramtype max_size_bytes: str - :keyword storage_key_type: Storage key type: StorageAccessKey, SharedAccessKey, or - ManagedIdentity. Required. Known values are: "SharedAccessKey", "StorageAccessKey", and - "ManagedIdentity". - :paramtype storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :keyword storage_key: Storage key for the storage account. If StorageKeyType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype storage_key: str - :keyword storage_uri: Storage Uri. Required. - :paramtype storage_uri: str - :keyword administrator_login: Administrator login name. If AuthenticationType is - ManagedIdentity, this field should specify the Managed Identity's resource ID. Required. - :paramtype administrator_login: str - :keyword administrator_login_password: Administrator login password. If AuthenticationType is - ManagedIdentity, this field should not be specified. - :paramtype administrator_login_password: str - :keyword authentication_type: Type of credentials provided for access to the target SQL server: - SQL, ADPassword or ManagedIdentity. - :paramtype authentication_type: str - :keyword network_isolation: Optional resource information to enable network isolation for - request. - :paramtype network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettingsAutoGenerated - """ - super().__init__(**kwargs) - self.database_name = database_name - self.edition = edition - self.service_objective_name = service_objective_name - self.max_size_bytes = max_size_bytes - self.storage_key_type = storage_key_type - self.storage_key = storage_key - self.storage_uri = storage_uri - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.authentication_type = authentication_type - self.network_isolation = network_isolation - - -class InstanceFailoverGroup(ProxyResource): - """An instance failover group. - - 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 secondary_type: Type of the geo-secondary instance. Set 'Standby' if the instance is used - as a DR option only. Known values are: "Geo" and "Standby". - :vartype secondary_type: str or ~azure.mgmt.sql.models.SecondaryInstanceType - :ivar read_write_endpoint: Read-write endpoint of the failover group instance. - :vartype read_write_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint - :ivar read_only_endpoint: Read-only endpoint of the failover group instance. - :vartype read_only_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint - :ivar replication_role: Local replication role of the failover group instance. Known values - are: "Primary" and "Secondary". - :vartype replication_role: str or ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - :ivar replication_state: Replication state of the failover group instance. - :vartype replication_state: str - :ivar partner_regions: Partner region information for the failover group. - :vartype partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] - :ivar managed_instance_pairs: List of managed instance pairs in the failover group. - :vartype managed_instance_pairs: list[~azure.mgmt.sql.models.ManagedInstancePairInfo] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "replication_role": {"readonly": True}, - "replication_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "secondary_type": {"key": "properties.secondaryType", "type": "str"}, - "read_write_endpoint": { - "key": "properties.readWriteEndpoint", - "type": "InstanceFailoverGroupReadWriteEndpoint", - }, - "read_only_endpoint": {"key": "properties.readOnlyEndpoint", "type": "InstanceFailoverGroupReadOnlyEndpoint"}, - "replication_role": {"key": "properties.replicationRole", "type": "str"}, - "replication_state": {"key": "properties.replicationState", "type": "str"}, - "partner_regions": {"key": "properties.partnerRegions", "type": "[PartnerRegionInfo]"}, - "managed_instance_pairs": {"key": "properties.managedInstancePairs", "type": "[ManagedInstancePairInfo]"}, - } - - def __init__( - self, - *, - secondary_type: Optional[Union[str, "_models.SecondaryInstanceType"]] = None, - read_write_endpoint: Optional["_models.InstanceFailoverGroupReadWriteEndpoint"] = None, - read_only_endpoint: Optional["_models.InstanceFailoverGroupReadOnlyEndpoint"] = None, - partner_regions: Optional[list["_models.PartnerRegionInfo"]] = None, - managed_instance_pairs: Optional[list["_models.ManagedInstancePairInfo"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword secondary_type: Type of the geo-secondary instance. Set 'Standby' if the instance is - used as a DR option only. Known values are: "Geo" and "Standby". - :paramtype secondary_type: str or ~azure.mgmt.sql.models.SecondaryInstanceType - :keyword read_write_endpoint: Read-write endpoint of the failover group instance. - :paramtype read_write_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint - :keyword read_only_endpoint: Read-only endpoint of the failover group instance. - :paramtype read_only_endpoint: ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint - :keyword partner_regions: Partner region information for the failover group. - :paramtype partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] - :keyword managed_instance_pairs: List of managed instance pairs in the failover group. - :paramtype managed_instance_pairs: list[~azure.mgmt.sql.models.ManagedInstancePairInfo] - """ - super().__init__(**kwargs) - self.secondary_type = secondary_type - self.read_write_endpoint = read_write_endpoint - self.read_only_endpoint = read_only_endpoint - self.replication_role: Optional[Union[str, "_models.InstanceFailoverGroupReplicationRole"]] = None - self.replication_state: Optional[str] = None - self.partner_regions = partner_regions - self.managed_instance_pairs = managed_instance_pairs - - -class InstanceFailoverGroupListResult(_serialization.Model): - """A list of instance failover groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.InstanceFailoverGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[InstanceFailoverGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.InstanceFailoverGroup"]] = None - self.next_link: Optional[str] = None - - -class InstanceFailoverGroupReadOnlyEndpoint(_serialization.Model): - """Read-only endpoint of the failover group instance. - - :ivar failover_policy: Failover policy of the read-only endpoint for the failover group. Known - values are: "Disabled" and "Enabled". - :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - """ - - _attribute_map = { - "failover_policy": {"key": "failoverPolicy", "type": "str"}, - } - - def __init__( - self, *, failover_policy: Optional[Union[str, "_models.ReadOnlyEndpointFailoverPolicy"]] = None, **kwargs: Any - ) -> None: - """ - :keyword failover_policy: Failover policy of the read-only endpoint for the failover group. - Known values are: "Disabled" and "Enabled". - :paramtype failover_policy: str or ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - """ - super().__init__(**kwargs) - self.failover_policy = failover_policy - - -class InstanceFailoverGroupReadWriteEndpoint(_serialization.Model): - """Read-write endpoint of the failover group instance. - - All required parameters must be populated in order to send to server. - - :ivar failover_policy: Failover policy of the read-write endpoint for the failover group. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. - Known values are: "Manual" and "Automatic". - :vartype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :ivar failover_with_data_loss_grace_period_minutes: Grace period before failover with data loss - is attempted for the read-write endpoint. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. - :vartype failover_with_data_loss_grace_period_minutes: int - """ - - _validation = { - "failover_policy": {"required": True}, - } - - _attribute_map = { - "failover_policy": {"key": "failoverPolicy", "type": "str"}, - "failover_with_data_loss_grace_period_minutes": { - "key": "failoverWithDataLossGracePeriodMinutes", - "type": "int", - }, - } - - def __init__( - self, - *, - failover_policy: Union[str, "_models.ReadWriteEndpointFailoverPolicy"], - failover_with_data_loss_grace_period_minutes: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword failover_policy: Failover policy of the read-write endpoint for the failover group. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is required. Required. - Known values are: "Manual" and "Automatic". - :paramtype failover_policy: str or ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :keyword failover_with_data_loss_grace_period_minutes: Grace period before failover with data - loss is attempted for the read-write endpoint. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. - :paramtype failover_with_data_loss_grace_period_minutes: int - """ - super().__init__(**kwargs) - self.failover_policy = failover_policy - self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes - - -class InstancePool(TrackedResource): - """An Azure SQL instance pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar subnet_id: Resource ID of the subnet to place this instance pool in. - :vartype subnet_id: str - :ivar v_cores: Count of vCores belonging to this instance pool. - :vartype v_cores: int - :ivar license_type: The license type. Possible values are 'LicenseIncluded' (price for SQL - license is included) and 'BasePrice' (without SQL license price). Known values are: - "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType - :ivar dns_zone: The Dns Zone that the managed instance pool is in. - :vartype dns_zone: str - :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :vartype maintenance_configuration_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "dns_zone": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "subnet_id": {"key": "properties.subnetId", "type": "str"}, - "v_cores": {"key": "properties.vCores", "type": "int"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "dns_zone": {"key": "properties.dnsZone", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - subnet_id: Optional[str] = None, - v_cores: Optional[int] = None, - license_type: Optional[Union[str, "_models.InstancePoolLicenseType"]] = None, - maintenance_configuration_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword subnet_id: Resource ID of the subnet to place this instance pool in. - :paramtype subnet_id: str - :keyword v_cores: Count of vCores belonging to this instance pool. - :paramtype v_cores: int - :keyword license_type: The license type. Possible values are 'LicenseIncluded' (price for SQL - license is included) and 'BasePrice' (without SQL license price). Known values are: - "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType - :keyword maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :paramtype maintenance_configuration_id: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.subnet_id = subnet_id - self.v_cores = v_cores - self.license_type = license_type - self.dns_zone: Optional[str] = None - self.maintenance_configuration_id = maintenance_configuration_id - - -class InstancePoolEditionCapability(_serialization.Model): - """The instance pool capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The instance pool version name. - :vartype name: str - :ivar supported_families: The supported families. - :vartype supported_families: list[~azure.mgmt.sql.models.InstancePoolFamilyCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_families": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_families": {"key": "supportedFamilies", "type": "[InstancePoolFamilyCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_families: Optional[list["_models.InstancePoolFamilyCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class InstancePoolFamilyCapability(_serialization.Model): - """The instance pool family capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Family name. - :vartype name: str - :ivar supported_license_types: List of supported license types. - :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] - :ivar supported_vcores_values: List of supported virtual cores values. - :vartype supported_vcores_values: list[~azure.mgmt.sql.models.InstancePoolVcoresCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_license_types": {"readonly": True}, - "supported_vcores_values": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_license_types": {"key": "supportedLicenseTypes", "type": "[LicenseTypeCapability]"}, - "supported_vcores_values": {"key": "supportedVcoresValues", "type": "[InstancePoolVcoresCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = None - self.supported_vcores_values: Optional[list["_models.InstancePoolVcoresCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class InstancePoolListResult(_serialization.Model): - """A list of Azure SQL instance pools. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.InstancePool] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[InstancePool]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.InstancePool"]] = None - self.next_link: Optional[str] = None - - -class InstancePoolOperation(ProxyResource): - """A instance pool operation. - - 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 instance_pool_name: The name of the instance pool the operation is being performed on. - :vartype instance_pool_name: str - :ivar operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", - "Failed", "CancelInProgress", and "Cancelled". - :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar error_type: Error type (e.g. None, User). Known values are: "None" and "User". - :vartype error_type: str or ~azure.mgmt.sql.models.ErrorType - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "instance_pool_name": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "error_type": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "instance_pool_name": {"key": "properties.instancePoolName", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "error_type": {"key": "properties.errorType", "type": "str"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.instance_pool_name: Optional[str] = None - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.percent_complete: Optional[int] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.error_type: Optional[Union[str, "_models.ErrorType"]] = None - self.estimated_completion_time: Optional[datetime.datetime] = None - self.description: Optional[str] = None - self.is_cancellable: Optional[bool] = None - - -class InstancePoolOperationListResult(_serialization.Model): - """The response to a list instance pool operations request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.InstancePoolOperation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[InstancePoolOperation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.InstancePoolOperation"]] = None - self.next_link: Optional[str] = None - - -class InstancePoolUpdate(_serialization.Model): - """An update to an Instance pool. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar subnet_id: Resource ID of the subnet to place this instance pool in. - :vartype subnet_id: str - :ivar v_cores: Count of vCores belonging to this instance pool. - :vartype v_cores: int - :ivar license_type: The license type. Possible values are 'LicenseIncluded' (price for SQL - license is included) and 'BasePrice' (without SQL license price). Known values are: - "LicenseIncluded" and "BasePrice". - :vartype license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType - :ivar dns_zone: The Dns Zone that the managed instance pool is in. - :vartype dns_zone: str - :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :vartype maintenance_configuration_id: str - """ - - _validation = { - "dns_zone": {"readonly": True}, - } - - _attribute_map = { - "sku": {"key": "sku", "type": "Sku"}, - "tags": {"key": "tags", "type": "{str}"}, - "subnet_id": {"key": "properties.subnetId", "type": "str"}, - "v_cores": {"key": "properties.vCores", "type": "int"}, - "license_type": {"key": "properties.licenseType", "type": "str"}, - "dns_zone": {"key": "properties.dnsZone", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - } - - def __init__( - self, - *, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - subnet_id: Optional[str] = None, - v_cores: Optional[int] = None, - license_type: Optional[Union[str, "_models.InstancePoolLicenseType"]] = None, - maintenance_configuration_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword subnet_id: Resource ID of the subnet to place this instance pool in. - :paramtype subnet_id: str - :keyword v_cores: Count of vCores belonging to this instance pool. - :paramtype v_cores: int - :keyword license_type: The license type. Possible values are 'LicenseIncluded' (price for SQL - license is included) and 'BasePrice' (without SQL license price). Known values are: - "LicenseIncluded" and "BasePrice". - :paramtype license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType - :keyword maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :paramtype maintenance_configuration_id: str - """ - super().__init__(**kwargs) - self.sku = sku - self.tags = tags - self.subnet_id = subnet_id - self.v_cores = v_cores - self.license_type = license_type - self.dns_zone: Optional[str] = None - self.maintenance_configuration_id = maintenance_configuration_id - - -class InstancePoolVcoresCapability(_serialization.Model): - """The managed instance virtual cores capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The virtual cores identifier. - :vartype name: str - :ivar value: The virtual cores value. - :vartype value: int - :ivar storage_limit: Storage limit. - :vartype storage_limit: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "value": {"readonly": True}, - "storage_limit": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "int"}, - "storage_limit": {"key": "storageLimit", "type": "MaxSizeCapability"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.value: Optional[int] = None - self.storage_limit: Optional["_models.MaxSizeCapability"] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class IPv6FirewallRule(ProxyResourceWithWritableName): - """An IPv6 server firewall rule. - - 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 start_i_pv6_address: The start IP address of the firewall rule. Must be IPv6 format. - :vartype start_i_pv6_address: str - :ivar end_i_pv6_address: The end IP address of the firewall rule. Must be IPv6 format. Must be - greater than or equal to startIpv6Address. - :vartype end_i_pv6_address: str - """ - - _validation = { - "id": {"readonly": True}, - "type": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "start_i_pv6_address": {"key": "properties.startIPv6Address", "type": "str"}, - "end_i_pv6_address": {"key": "properties.endIPv6Address", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - start_i_pv6_address: Optional[str] = None, - end_i_pv6_address: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Resource name. - :paramtype name: str - :keyword start_i_pv6_address: The start IP address of the firewall rule. Must be IPv6 format. - :paramtype start_i_pv6_address: str - :keyword end_i_pv6_address: The end IP address of the firewall rule. Must be IPv6 format. Must - be greater than or equal to startIpv6Address. - :paramtype end_i_pv6_address: str - """ - super().__init__(name=name, **kwargs) - self.start_i_pv6_address = start_i_pv6_address - self.end_i_pv6_address = end_i_pv6_address - - -class IPv6FirewallRuleListResult(_serialization.Model): - """The response to a list IPv6 firewall rules request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.IPv6FirewallRule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[IPv6FirewallRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.IPv6FirewallRule"]] = None - self.next_link: Optional[str] = None - - -class Job(ProxyResource): - """A job. - - 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 description: User-defined description of the job. - :vartype description: str - :ivar version: The job version number. - :vartype version: int - :ivar schedule: Schedule properties of the job. - :vartype schedule: ~azure.mgmt.sql.models.JobSchedule - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "version": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "description": {"key": "properties.description", "type": "str"}, - "version": {"key": "properties.version", "type": "int"}, - "schedule": {"key": "properties.schedule", "type": "JobSchedule"}, - } - - def __init__( - self, *, description: str = "", schedule: Optional["_models.JobSchedule"] = None, **kwargs: Any - ) -> None: - """ - :keyword description: User-defined description of the job. - :paramtype description: str - :keyword schedule: Schedule properties of the job. - :paramtype schedule: ~azure.mgmt.sql.models.JobSchedule - """ - super().__init__(**kwargs) - self.description = description - self.version: Optional[int] = None - self.schedule = schedule - - -class JobAgent(TrackedResource): - """An Azure SQL job agent. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar identity: The identity of the job agent. - :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity - :ivar database_id: Resource ID of the database to store job metadata in. - :vartype database_id: str - :ivar state: The state of the job agent. Known values are: "Creating", "Ready", "Updating", - "Deleting", and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.JobAgentState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "JobAgentIdentity"}, - "database_id": {"key": "properties.databaseId", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - sku: Optional["_models.Sku"] = None, - identity: Optional["_models.JobAgentIdentity"] = None, - database_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword identity: The identity of the job agent. - :paramtype identity: ~azure.mgmt.sql.models.JobAgentIdentity - :keyword database_id: Resource ID of the database to store job metadata in. - :paramtype database_id: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.identity = identity - self.database_id = database_id - self.state: Optional[Union[str, "_models.JobAgentState"]] = None - - -class JobAgentEditionCapability(_serialization.Model): - """The job agent edition capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The job agent edition name. - :vartype name: str - :ivar supported_service_level_objectives: The list of supported service level objectives for - the edition. - :vartype supported_service_level_objectives: - list[~azure.mgmt.sql.models.JobAgentServiceLevelObjectiveCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_service_level_objectives": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_service_level_objectives": { - "key": "supportedServiceLevelObjectives", - "type": "[JobAgentServiceLevelObjectiveCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_service_level_objectives: Optional[list["_models.JobAgentServiceLevelObjectiveCapability"]] = ( - None - ) - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class JobAgentIdentity(_serialization.Model): - """Azure Active Directory identity configuration for a resource. - - All required parameters must be populated in order to send to server. - - :ivar tenant_id: The job agent identity tenant id. - :vartype tenant_id: str - :ivar type: The job agent identity type. Required. Known values are: "None", "SystemAssigned", - "UserAssigned", and "SystemAssignedUserAssigned". - :vartype type: str or ~azure.mgmt.sql.models.JobAgentIdentityType - :ivar user_assigned_identities: The resource ids of the user assigned identities to use. - :vartype user_assigned_identities: dict[str, - ~azure.mgmt.sql.models.JobAgentUserAssignedIdentity] - """ - - _validation = { - "type": {"required": True}, - } - - _attribute_map = { - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{JobAgentUserAssignedIdentity}"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.JobAgentIdentityType"], - tenant_id: Optional[str] = None, - user_assigned_identities: Optional[dict[str, "_models.JobAgentUserAssignedIdentity"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword tenant_id: The job agent identity tenant id. - :paramtype tenant_id: str - :keyword type: The job agent identity type. Required. Known values are: "None", - "SystemAssigned", "UserAssigned", and "SystemAssignedUserAssigned". - :paramtype type: str or ~azure.mgmt.sql.models.JobAgentIdentityType - :keyword user_assigned_identities: The resource ids of the user assigned identities to use. - :paramtype user_assigned_identities: dict[str, - ~azure.mgmt.sql.models.JobAgentUserAssignedIdentity] - """ - super().__init__(**kwargs) - self.tenant_id = tenant_id - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class JobAgentListResult(_serialization.Model): - """A list of Azure SQL job agents. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobAgent] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobAgent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobAgent"]] = None - self.next_link: Optional[str] = None - - -class JobAgentServiceLevelObjectiveCapability(_serialization.Model): - """The job agent service level objective capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The service objective name. - :vartype name: str - :ivar sku: The sku. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "sku": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "sku": {"key": "sku", "type": "Sku"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.sku: Optional["_models.Sku"] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class JobAgentUpdate(_serialization.Model): - """An update to an Azure SQL job agent. - - :ivar identity: Managed identity assigned to job agent. - :vartype identity: ~azure.mgmt.sql.models.JobAgentIdentity - :ivar sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - """ - - _attribute_map = { - "identity": {"key": "identity", "type": "JobAgentIdentity"}, - "sku": {"key": "sku", "type": "Sku"}, - "tags": {"key": "tags", "type": "{str}"}, - } - - def __init__( - self, - *, - identity: Optional["_models.JobAgentIdentity"] = None, - sku: Optional["_models.Sku"] = None, - tags: Optional[dict[str, str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword identity: Managed identity assigned to job agent. - :paramtype identity: ~azure.mgmt.sql.models.JobAgentIdentity - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(**kwargs) - self.identity = identity - self.sku = sku - self.tags = tags - - -class JobAgentUserAssignedIdentity(_serialization.Model): - """Azure Active Directory identity configuration for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The Azure Active Directory principal id. - :vartype principal_id: str - :ivar client_id: The Azure Active Directory client id. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - - -class JobAgentVersionCapability(_serialization.Model): - """The job agent version capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The job agent version name. - :vartype name: str - :ivar supported_editions: The list of supported editions. - :vartype supported_editions: list[~azure.mgmt.sql.models.JobAgentEditionCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_editions": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_editions": {"key": "supportedEditions", "type": "[JobAgentEditionCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_editions: Optional[list["_models.JobAgentEditionCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class JobCredential(ProxyResource): - """A stored credential that can be used by a job to connect to target databases. - - 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 username: The credential user name. - :vartype username: str - :ivar password: The credential password. - :vartype password: str - """ - - _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"}, - "username": {"key": "properties.username", "type": "str"}, - "password": {"key": "properties.password", "type": "str"}, - } - - def __init__(self, *, username: Optional[str] = None, password: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword username: The credential user name. - :paramtype username: str - :keyword password: The credential password. - :paramtype password: str - """ - super().__init__(**kwargs) - self.username = username - self.password = password - - -class JobCredentialListResult(_serialization.Model): - """A list of job credentials. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobCredential] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobCredential]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobCredential"]] = None - self.next_link: Optional[str] = None - - -class JobExecution(ProxyResource): - """An execution of a job. - - 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 job_version: The job version number. - :vartype job_version: int - :ivar step_name: The job step name. - :vartype step_name: str - :ivar step_id: The job step id. - :vartype step_id: int - :ivar job_execution_id: The unique identifier of the job execution. - :vartype job_execution_id: str - :ivar lifecycle: The detailed state of the job execution. Known values are: "Created", - "InProgress", "WaitingForChildJobExecutions", "WaitingForRetry", "Succeeded", - "SucceededWithSkipped", "Failed", "TimedOut", "Canceled", and "Skipped". - :vartype lifecycle: str or ~azure.mgmt.sql.models.JobExecutionLifecycle - :ivar provisioning_state: The ARM provisioning state of the job execution. Known values are: - "Created", "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState - :ivar create_time: The time that the job execution was created. - :vartype create_time: ~datetime.datetime - :ivar start_time: The time that the job execution started. - :vartype start_time: ~datetime.datetime - :ivar end_time: The time that the job execution completed. - :vartype end_time: ~datetime.datetime - :ivar current_attempts: Number of times the job execution has been attempted. - :vartype current_attempts: int - :ivar current_attempt_start_time: Start time of the current attempt. - :vartype current_attempt_start_time: ~datetime.datetime - :ivar last_message: The last status or error message. - :vartype last_message: str - :ivar target: The target that this execution is executed on. - :vartype target: ~azure.mgmt.sql.models.JobExecutionTarget - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "job_version": {"readonly": True}, - "step_name": {"readonly": True}, - "step_id": {"readonly": True}, - "job_execution_id": {"readonly": True}, - "lifecycle": {"readonly": True}, - "provisioning_state": {"readonly": True}, - "create_time": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "current_attempt_start_time": {"readonly": True}, - "last_message": {"readonly": True}, - "target": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "job_version": {"key": "properties.jobVersion", "type": "int"}, - "step_name": {"key": "properties.stepName", "type": "str"}, - "step_id": {"key": "properties.stepId", "type": "int"}, - "job_execution_id": {"key": "properties.jobExecutionId", "type": "str"}, - "lifecycle": {"key": "properties.lifecycle", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "create_time": {"key": "properties.createTime", "type": "iso-8601"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "current_attempts": {"key": "properties.currentAttempts", "type": "int"}, - "current_attempt_start_time": {"key": "properties.currentAttemptStartTime", "type": "iso-8601"}, - "last_message": {"key": "properties.lastMessage", "type": "str"}, - "target": {"key": "properties.target", "type": "JobExecutionTarget"}, - } - - def __init__(self, *, current_attempts: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword current_attempts: Number of times the job execution has been attempted. - :paramtype current_attempts: int - """ - super().__init__(**kwargs) - self.job_version: Optional[int] = None - self.step_name: Optional[str] = None - self.step_id: Optional[int] = None - self.job_execution_id: Optional[str] = None - self.lifecycle: Optional[Union[str, "_models.JobExecutionLifecycle"]] = None - self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None - self.create_time: Optional[datetime.datetime] = None - self.start_time: Optional[datetime.datetime] = None - self.end_time: Optional[datetime.datetime] = None - self.current_attempts = current_attempts - self.current_attempt_start_time: Optional[datetime.datetime] = None - self.last_message: Optional[str] = None - self.target: Optional["_models.JobExecutionTarget"] = None - - -class JobExecutionListResult(_serialization.Model): - """A list of job executions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobExecution] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobExecution]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobExecution"]] = None - self.next_link: Optional[str] = None - - -class JobExecutionTarget(_serialization.Model): - """The target that a job execution is executed on. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar type: The type of the target. Known values are: "TargetGroup", "SqlDatabase", - "SqlElasticPool", "SqlShardMap", and "SqlServer". - :vartype type: str or ~azure.mgmt.sql.models.JobTargetType - :ivar server_name: The server name. - :vartype server_name: str - :ivar database_name: The database name. - :vartype database_name: str - """ - - _validation = { - "type": {"readonly": True}, - "server_name": {"readonly": True}, - "database_name": {"readonly": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "server_name": {"key": "serverName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type: Optional[Union[str, "_models.JobTargetType"]] = None - self.server_name: Optional[str] = None - self.database_name: Optional[str] = None - - -class JobListResult(_serialization.Model): - """A list of jobs. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.Job] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Job]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Job"]] = None - self.next_link: Optional[str] = None - - -class JobPrivateEndpoint(ProxyResource): - """A job agent private endpoint. - - 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 target_server_azure_resource_id: ARM resource id of the server the private endpoint will - target. - :vartype target_server_azure_resource_id: str - :ivar private_endpoint_id: Private endpoint id of the private endpoint. - :vartype private_endpoint_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "private_endpoint_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "target_server_azure_resource_id": {"key": "properties.targetServerAzureResourceId", "type": "str"}, - "private_endpoint_id": {"key": "properties.privateEndpointId", "type": "str"}, - } - - def __init__(self, *, target_server_azure_resource_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword target_server_azure_resource_id: ARM resource id of the server the private endpoint - will target. - :paramtype target_server_azure_resource_id: str - """ - super().__init__(**kwargs) - self.target_server_azure_resource_id = target_server_azure_resource_id - self.private_endpoint_id: Optional[str] = None - - -class JobPrivateEndpointListResult(_serialization.Model): - """A list of job agent private endpoints. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobPrivateEndpoint] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobPrivateEndpoint]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobPrivateEndpoint"]] = None - self.next_link: Optional[str] = None - - -class JobSchedule(_serialization.Model): - """Scheduling properties of a job. - - :ivar start_time: Schedule start time. - :vartype start_time: ~datetime.datetime - :ivar end_time: Schedule end time. - :vartype end_time: ~datetime.datetime - :ivar type: Schedule interval type. Known values are: "Once" and "Recurring". - :vartype type: str or ~azure.mgmt.sql.models.JobScheduleType - :ivar enabled: Whether or not the schedule is enabled. - :vartype enabled: bool - :ivar interval: Value of the schedule's recurring interval, if the ScheduleType is recurring. - ISO8601 duration format. - :vartype interval: str - """ - - _attribute_map = { - "start_time": {"key": "startTime", "type": "iso-8601"}, - "end_time": {"key": "endTime", "type": "iso-8601"}, - "type": {"key": "type", "type": "str"}, - "enabled": {"key": "enabled", "type": "bool"}, - "interval": {"key": "interval", "type": "str"}, - } - - def __init__( - self, - *, - start_time: datetime.datetime = "0001-01-01T16:00:00-08:00", - end_time: datetime.datetime = "9999-12-31T03:59:59-08:00", - type: Union[str, "_models.JobScheduleType"] = "Once", - enabled: Optional[bool] = None, - interval: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword start_time: Schedule start time. - :paramtype start_time: ~datetime.datetime - :keyword end_time: Schedule end time. - :paramtype end_time: ~datetime.datetime - :keyword type: Schedule interval type. Known values are: "Once" and "Recurring". - :paramtype type: str or ~azure.mgmt.sql.models.JobScheduleType - :keyword enabled: Whether or not the schedule is enabled. - :paramtype enabled: bool - :keyword interval: Value of the schedule's recurring interval, if the ScheduleType is - recurring. ISO8601 duration format. - :paramtype interval: str - """ - super().__init__(**kwargs) - self.start_time = start_time - self.end_time = end_time - self.type = type - self.enabled = enabled - self.interval = interval - - -class JobStep(ProxyResource): - """A job step. - - 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 step_id: The job step's index within the job. If not specified when creating the job - step, it will be created as the last step. If not specified when updating the job step, the - step id is not modified. - :vartype step_id: int - :ivar target_group: The resource ID of the target group that the job step will be executed on. - :vartype target_group: str - :ivar credential: The resource ID of the job credential that will be used to connect to the - targets. - :vartype credential: str - :ivar action: The action payload of the job step. - :vartype action: ~azure.mgmt.sql.models.JobStepAction - :ivar output: Output destination properties of the job step. - :vartype output: ~azure.mgmt.sql.models.JobStepOutput - :ivar execution_options: Execution options for the job step. - :vartype execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions - """ - - _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"}, - "step_id": {"key": "properties.stepId", "type": "int"}, - "target_group": {"key": "properties.targetGroup", "type": "str"}, - "credential": {"key": "properties.credential", "type": "str"}, - "action": {"key": "properties.action", "type": "JobStepAction"}, - "output": {"key": "properties.output", "type": "JobStepOutput"}, - "execution_options": {"key": "properties.executionOptions", "type": "JobStepExecutionOptions"}, - } - - def __init__( - self, - *, - step_id: Optional[int] = None, - target_group: Optional[str] = None, - credential: Optional[str] = None, - action: Optional["_models.JobStepAction"] = None, - output: Optional["_models.JobStepOutput"] = None, - execution_options: Optional["_models.JobStepExecutionOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword step_id: The job step's index within the job. If not specified when creating the job - step, it will be created as the last step. If not specified when updating the job step, the - step id is not modified. - :paramtype step_id: int - :keyword target_group: The resource ID of the target group that the job step will be executed - on. - :paramtype target_group: str - :keyword credential: The resource ID of the job credential that will be used to connect to the - targets. - :paramtype credential: str - :keyword action: The action payload of the job step. - :paramtype action: ~azure.mgmt.sql.models.JobStepAction - :keyword output: Output destination properties of the job step. - :paramtype output: ~azure.mgmt.sql.models.JobStepOutput - :keyword execution_options: Execution options for the job step. - :paramtype execution_options: ~azure.mgmt.sql.models.JobStepExecutionOptions - """ - super().__init__(**kwargs) - self.step_id = step_id - self.target_group = target_group - self.credential = credential - self.action = action - self.output = output - self.execution_options = execution_options - - -class JobStepAction(_serialization.Model): - """The action to be executed by a job step. - - All required parameters must be populated in order to send to server. - - :ivar type: Type of action being executed by the job step. "TSql" - :vartype type: str or ~azure.mgmt.sql.models.JobStepActionType - :ivar source: The source of the action to execute. "Inline" - :vartype source: str or ~azure.mgmt.sql.models.JobStepActionSource - :ivar value: The action value, for example the text of the T-SQL script to execute. Required. - :vartype value: str - """ - - _validation = { - "value": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "source": {"key": "source", "type": "str"}, - "value": {"key": "value", "type": "str"}, - } - - def __init__( - self, - *, - value: str, - type: Union[str, "_models.JobStepActionType"] = "TSql", - source: Union[str, "_models.JobStepActionSource"] = "Inline", - **kwargs: Any - ) -> None: - """ - :keyword type: Type of action being executed by the job step. "TSql" - :paramtype type: str or ~azure.mgmt.sql.models.JobStepActionType - :keyword source: The source of the action to execute. "Inline" - :paramtype source: str or ~azure.mgmt.sql.models.JobStepActionSource - :keyword value: The action value, for example the text of the T-SQL script to execute. - Required. - :paramtype value: str - """ - super().__init__(**kwargs) - self.type = type - self.source = source - self.value = value - - -class JobStepExecutionOptions(_serialization.Model): - """The execution options of a job step. - - :ivar timeout_seconds: Execution timeout for the job step. - :vartype timeout_seconds: int - :ivar retry_attempts: Maximum number of times the job step will be reattempted if the first - attempt fails. - :vartype retry_attempts: int - :ivar initial_retry_interval_seconds: Initial delay between retries for job step execution. - :vartype initial_retry_interval_seconds: int - :ivar maximum_retry_interval_seconds: The maximum amount of time to wait between retries for - job step execution. - :vartype maximum_retry_interval_seconds: int - :ivar retry_interval_backoff_multiplier: The backoff multiplier for the time between retries. - :vartype retry_interval_backoff_multiplier: float - """ - - _attribute_map = { - "timeout_seconds": {"key": "timeoutSeconds", "type": "int"}, - "retry_attempts": {"key": "retryAttempts", "type": "int"}, - "initial_retry_interval_seconds": {"key": "initialRetryIntervalSeconds", "type": "int"}, - "maximum_retry_interval_seconds": {"key": "maximumRetryIntervalSeconds", "type": "int"}, - "retry_interval_backoff_multiplier": {"key": "retryIntervalBackoffMultiplier", "type": "float"}, - } - - def __init__( - self, - *, - timeout_seconds: int = 43200, - retry_attempts: int = 10, - initial_retry_interval_seconds: int = 1, - maximum_retry_interval_seconds: int = 120, - retry_interval_backoff_multiplier: float = 2, - **kwargs: Any - ) -> None: - """ - :keyword timeout_seconds: Execution timeout for the job step. - :paramtype timeout_seconds: int - :keyword retry_attempts: Maximum number of times the job step will be reattempted if the first - attempt fails. - :paramtype retry_attempts: int - :keyword initial_retry_interval_seconds: Initial delay between retries for job step execution. - :paramtype initial_retry_interval_seconds: int - :keyword maximum_retry_interval_seconds: The maximum amount of time to wait between retries for - job step execution. - :paramtype maximum_retry_interval_seconds: int - :keyword retry_interval_backoff_multiplier: The backoff multiplier for the time between - retries. - :paramtype retry_interval_backoff_multiplier: float - """ - super().__init__(**kwargs) - self.timeout_seconds = timeout_seconds - self.retry_attempts = retry_attempts - self.initial_retry_interval_seconds = initial_retry_interval_seconds - self.maximum_retry_interval_seconds = maximum_retry_interval_seconds - self.retry_interval_backoff_multiplier = retry_interval_backoff_multiplier - - -class JobStepListResult(_serialization.Model): - """A list of job steps. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobStep] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobStep]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobStep"]] = None - self.next_link: Optional[str] = None - - -class JobStepOutput(_serialization.Model): - """The output configuration of a job step. - - All required parameters must be populated in order to send to server. - - :ivar type: The output destination type. "SqlDatabase" - :vartype type: str or ~azure.mgmt.sql.models.JobStepOutputType - :ivar subscription_id: The output destination subscription id. - :vartype subscription_id: str - :ivar resource_group_name: The output destination resource group. - :vartype resource_group_name: str - :ivar server_name: The output destination server name. Required. - :vartype server_name: str - :ivar database_name: The output destination database. Required. - :vartype database_name: str - :ivar schema_name: The output destination schema. - :vartype schema_name: str - :ivar table_name: The output destination table. Required. - :vartype table_name: str - :ivar credential: The resource ID of the credential to use to connect to the output - destination. - :vartype credential: str - """ - - _validation = { - "server_name": {"required": True}, - "database_name": {"required": True}, - "table_name": {"required": True}, - } - - _attribute_map = { - "type": {"key": "type", "type": "str"}, - "subscription_id": {"key": "subscriptionId", "type": "str"}, - "resource_group_name": {"key": "resourceGroupName", "type": "str"}, - "server_name": {"key": "serverName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "schema_name": {"key": "schemaName", "type": "str"}, - "table_name": {"key": "tableName", "type": "str"}, - "credential": {"key": "credential", "type": "str"}, - } - - def __init__( - self, - *, - server_name: str, - database_name: str, - table_name: str, - type: Union[str, "_models.JobStepOutputType"] = "SqlDatabase", - subscription_id: Optional[str] = None, - resource_group_name: Optional[str] = None, - schema_name: str = "dbo", - credential: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword type: The output destination type. "SqlDatabase" - :paramtype type: str or ~azure.mgmt.sql.models.JobStepOutputType - :keyword subscription_id: The output destination subscription id. - :paramtype subscription_id: str - :keyword resource_group_name: The output destination resource group. - :paramtype resource_group_name: str - :keyword server_name: The output destination server name. Required. - :paramtype server_name: str - :keyword database_name: The output destination database. Required. - :paramtype database_name: str - :keyword schema_name: The output destination schema. - :paramtype schema_name: str - :keyword table_name: The output destination table. Required. - :paramtype table_name: str - :keyword credential: The resource ID of the credential to use to connect to the output - destination. - :paramtype credential: str - """ - super().__init__(**kwargs) - self.type = type - self.subscription_id = subscription_id - self.resource_group_name = resource_group_name - self.server_name = server_name - self.database_name = database_name - self.schema_name = schema_name - self.table_name = table_name - self.credential = credential - - -class JobTarget(_serialization.Model): - """A job target, for example a specific database or a container of databases that is evaluated - during job execution. - - All required parameters must be populated in order to send to server. - - :ivar membership_type: Whether the target is included or excluded from the group. Known values - are: "Include" and "Exclude". - :vartype membership_type: str or ~azure.mgmt.sql.models.JobTargetGroupMembershipType - :ivar type: The target type. Required. Known values are: "TargetGroup", "SqlDatabase", - "SqlElasticPool", "SqlShardMap", and "SqlServer". - :vartype type: str or ~azure.mgmt.sql.models.JobTargetType - :ivar server_name: The target server name. - :vartype server_name: str - :ivar database_name: The target database name. - :vartype database_name: str - :ivar elastic_pool_name: The target elastic pool name. - :vartype elastic_pool_name: str - :ivar shard_map_name: The target shard map. - :vartype shard_map_name: str - :ivar refresh_credential: The resource ID of the credential that is used during job execution - to connect to the target and determine the list of databases inside the target. - :vartype refresh_credential: str - """ - - _validation = { - "type": {"required": True}, - } - - _attribute_map = { - "membership_type": {"key": "membershipType", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "server_name": {"key": "serverName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "elastic_pool_name": {"key": "elasticPoolName", "type": "str"}, - "shard_map_name": {"key": "shardMapName", "type": "str"}, - "refresh_credential": {"key": "refreshCredential", "type": "str"}, - } - - def __init__( - self, - *, - type: Union[str, "_models.JobTargetType"], - membership_type: Union[str, "_models.JobTargetGroupMembershipType"] = "Include", - server_name: Optional[str] = None, - database_name: Optional[str] = None, - elastic_pool_name: Optional[str] = None, - shard_map_name: Optional[str] = None, - refresh_credential: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword membership_type: Whether the target is included or excluded from the group. Known - values are: "Include" and "Exclude". - :paramtype membership_type: str or ~azure.mgmt.sql.models.JobTargetGroupMembershipType - :keyword type: The target type. Required. Known values are: "TargetGroup", "SqlDatabase", - "SqlElasticPool", "SqlShardMap", and "SqlServer". - :paramtype type: str or ~azure.mgmt.sql.models.JobTargetType - :keyword server_name: The target server name. - :paramtype server_name: str - :keyword database_name: The target database name. - :paramtype database_name: str - :keyword elastic_pool_name: The target elastic pool name. - :paramtype elastic_pool_name: str - :keyword shard_map_name: The target shard map. - :paramtype shard_map_name: str - :keyword refresh_credential: The resource ID of the credential that is used during job - execution to connect to the target and determine the list of databases inside the target. - :paramtype refresh_credential: str - """ - super().__init__(**kwargs) - self.membership_type = membership_type - self.type = type - self.server_name = server_name - self.database_name = database_name - self.elastic_pool_name = elastic_pool_name - self.shard_map_name = shard_map_name - self.refresh_credential = refresh_credential - - -class JobTargetGroup(ProxyResource): - """A group of job targets. - - 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 members: Members of the target group. - :vartype members: list[~azure.mgmt.sql.models.JobTarget] - """ - - _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"}, - "members": {"key": "properties.members", "type": "[JobTarget]"}, - } - - def __init__(self, *, members: Optional[list["_models.JobTarget"]] = None, **kwargs: Any) -> None: - """ - :keyword members: Members of the target group. - :paramtype members: list[~azure.mgmt.sql.models.JobTarget] - """ - super().__init__(**kwargs) - self.members = members - - -class JobTargetGroupListResult(_serialization.Model): - """A list of target groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobTargetGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobTargetGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobTargetGroup"]] = None - self.next_link: Optional[str] = None - - -class JobVersion(ProxyResource): - """A job version. - - 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 - """ - - -class JobVersionListResult(_serialization.Model): - """A list of job versions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.JobVersion] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[JobVersion]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.JobVersion"]] = None - self.next_link: Optional[str] = None - - -class LedgerDigestUploads(ProxyResource): - """Azure SQL Database ledger digest upload settings. - - 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 digest_storage_endpoint: The digest storage endpoint, which must be either an Azure blob - storage endpoint or an URI for Azure Confidential Ledger. - :vartype digest_storage_endpoint: str - :ivar state: Specifies the state of ledger digest upload. Known values are: "Enabled" and - "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.LedgerDigestUploadsState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "digest_storage_endpoint": {"key": "properties.digestStorageEndpoint", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__(self, *, digest_storage_endpoint: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword digest_storage_endpoint: The digest storage endpoint, which must be either an Azure - blob storage endpoint or an URI for Azure Confidential Ledger. - :paramtype digest_storage_endpoint: str - """ - super().__init__(**kwargs) - self.digest_storage_endpoint = digest_storage_endpoint - self.state: Optional[Union[str, "_models.LedgerDigestUploadsState"]] = None - - -class LedgerDigestUploadsListResult(_serialization.Model): - """A list of ledger digest upload settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.LedgerDigestUploads] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[LedgerDigestUploads]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.LedgerDigestUploads"]] = None - self.next_link: Optional[str] = None - - -class LicenseTypeCapability(_serialization.Model): - """The license type capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: License type identifier. - :vartype name: str - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class LocationCapabilities(_serialization.Model): - """The location capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The location name. - :vartype name: str - :ivar supported_server_versions: The list of supported server versions. - :vartype supported_server_versions: list[~azure.mgmt.sql.models.ServerVersionCapability] - :ivar supported_managed_instance_versions: The list of supported managed instance versions. - :vartype supported_managed_instance_versions: - list[~azure.mgmt.sql.models.ManagedInstanceVersionCapability] - :ivar supported_job_agent_versions: The list of supported job agent versions. - :vartype supported_job_agent_versions: list[~azure.mgmt.sql.models.JobAgentVersionCapability] - :ivar is_zone_resilient_provisioning_allowed: Whether or not the subscription is allowed to - provision zone resilient resources. - :vartype is_zone_resilient_provisioning_allowed: bool - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_server_versions": {"readonly": True}, - "supported_managed_instance_versions": {"readonly": True}, - "supported_job_agent_versions": {"readonly": True}, - "is_zone_resilient_provisioning_allowed": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_server_versions": {"key": "supportedServerVersions", "type": "[ServerVersionCapability]"}, - "supported_managed_instance_versions": { - "key": "supportedManagedInstanceVersions", - "type": "[ManagedInstanceVersionCapability]", - }, - "supported_job_agent_versions": {"key": "supportedJobAgentVersions", "type": "[JobAgentVersionCapability]"}, - "is_zone_resilient_provisioning_allowed": {"key": "isZoneResilientProvisioningAllowed", "type": "bool"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_server_versions: Optional[list["_models.ServerVersionCapability"]] = None - self.supported_managed_instance_versions: Optional[list["_models.ManagedInstanceVersionCapability"]] = None - self.supported_job_agent_versions: Optional[list["_models.JobAgentVersionCapability"]] = None - self.is_zone_resilient_provisioning_allowed: Optional[bool] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class LogicalDatabaseTransparentDataEncryption(ProxyResource): - """A logical database transparent data encryption scan state. - - 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 state: Specifies the state of the transparent data encryption. Known values are: - "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState - :ivar scan_state: Specifies the encryption scan state of the transparent data encryption. Known - values are: "None", "Resume", "Running", "Suspend", "Aborted", and "Completed". - :vartype scan_state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionScanState - """ - - _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"}, - "state": {"key": "properties.state", "type": "str"}, - "scan_state": {"key": "properties.scanState", "type": "str"}, - } - - def __init__( - self, - *, - state: Optional[Union[str, "_models.TransparentDataEncryptionState"]] = None, - scan_state: Optional[Union[str, "_models.TransparentDataEncryptionScanState"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the transparent data encryption. Known values are: - "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState - :keyword scan_state: Specifies the encryption scan state of the transparent data encryption. - Known values are: "None", "Resume", "Running", "Suspend", "Aborted", and "Completed". - :paramtype scan_state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionScanState - """ - super().__init__(**kwargs) - self.state = state - self.scan_state = scan_state - - -class LogicalDatabaseTransparentDataEncryptionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of transparent data encryption scan objects. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[LogicalDatabaseTransparentDataEncryption]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.LogicalDatabaseTransparentDataEncryption"]] = None - self.next_link: Optional[str] = None - - -class LogicalServerAdvancedThreatProtectionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the server's Advanced Threat Protection configurations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerAdvancedThreatProtection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerAdvancedThreatProtection"]] = None - self.next_link: Optional[str] = None - - -class LogicalServerSecurityAlertPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the server's security alert policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerSecurityAlertPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerSecurityAlertPolicy"]] = None - self.next_link: Optional[str] = None - - -class LogSizeCapability(_serialization.Model): - """The log size capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar limit: The log size limit (see 'unit' for the units). - :vartype limit: int - :ivar unit: The units that the limit is expressed in. Known values are: "Megabytes", - "Gigabytes", "Terabytes", "Petabytes", and "Percent". - :vartype unit: str or ~azure.mgmt.sql.models.LogSizeUnit - """ - - _validation = { - "limit": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "limit": {"key": "limit", "type": "int"}, - "unit": {"key": "unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.limit: Optional[int] = None - self.unit: Optional[Union[str, "_models.LogSizeUnit"]] = None - - -class LongTermRetentionBackup(ProxyResource): - """A long term retention backup. - - 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 server_name: The server name that the backup database belong to. - :vartype server_name: str - :ivar server_create_time: The create time of the server. - :vartype server_create_time: ~datetime.datetime - :ivar database_name: The name of the database the backup belong to. - :vartype database_name: str - :ivar database_deletion_time: The delete time of the database. - :vartype database_deletion_time: ~datetime.datetime - :ivar backup_time: The time the backup was taken. - :vartype backup_time: ~datetime.datetime - :ivar backup_expiration_time: The time the long term retention backup will expire. - :vartype backup_expiration_time: ~datetime.datetime - :ivar backup_storage_redundancy: The storage redundancy type of the backup. Known values are: - "Geo", "Local", "Zone", and "GeoZone". - :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar requested_backup_storage_redundancy: The storage redundancy type of the backup. Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar is_backup_immutable: The setting whether the LTR backup is immutable. - :vartype is_backup_immutable: bool - :ivar time_based_immutability: The setting for whether or not time-based immutability is - enabled for the LTR backup. When time-based immutability is enabled and locked, the backup - cannot be deleted until BackupExpirationTime. Known values are: "Enabled" and "Disabled". - :vartype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability - :ivar time_based_immutability_mode: The time-based immutability mode. Only applicable if - time-based immutability is enabled. Known values are: "Locked" and "Unlocked". - :vartype time_based_immutability_mode: str or ~azure.mgmt.sql.models.TimeBasedImmutabilityMode - :ivar legal_hold_immutability: The setting for whether LegalHold is enabled or disabled on the - LTR backup. When LegalHold is enabled, the backup cannot be deleted until the LegalHold is - removed. Known values are: "Enabled" and "Disabled". - :vartype legal_hold_immutability: str or ~azure.mgmt.sql.models.SetLegalHoldImmutability - :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backup. Known values - are: "Hot" and "Archive". - :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "server_name": {"readonly": True}, - "server_create_time": {"readonly": True}, - "database_name": {"readonly": True}, - "database_deletion_time": {"readonly": True}, - "backup_time": {"readonly": True}, - "backup_expiration_time": {"readonly": True}, - "backup_storage_redundancy": {"readonly": True}, - "backup_storage_access_tier": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "server_create_time": {"key": "properties.serverCreateTime", "type": "iso-8601"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "database_deletion_time": {"key": "properties.databaseDeletionTime", "type": "iso-8601"}, - "backup_time": {"key": "properties.backupTime", "type": "iso-8601"}, - "backup_expiration_time": {"key": "properties.backupExpirationTime", "type": "iso-8601"}, - "backup_storage_redundancy": {"key": "properties.backupStorageRedundancy", "type": "str"}, - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - "is_backup_immutable": {"key": "properties.isBackupImmutable", "type": "bool"}, - "time_based_immutability": {"key": "properties.timeBasedImmutability", "type": "str"}, - "time_based_immutability_mode": {"key": "properties.timeBasedImmutabilityMode", "type": "str"}, - "legal_hold_immutability": {"key": "properties.legalHoldImmutability", "type": "str"}, - "backup_storage_access_tier": {"key": "properties.backupStorageAccessTier", "type": "str"}, - } - - def __init__( - self, - *, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - is_backup_immutable: Optional[bool] = None, - time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = None, - time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = None, - legal_hold_immutability: Optional[Union[str, "_models.SetLegalHoldImmutability"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword requested_backup_storage_redundancy: The storage redundancy type of the backup. Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword is_backup_immutable: The setting whether the LTR backup is immutable. - :paramtype is_backup_immutable: bool - :keyword time_based_immutability: The setting for whether or not time-based immutability is - enabled for the LTR backup. When time-based immutability is enabled and locked, the backup - cannot be deleted until BackupExpirationTime. Known values are: "Enabled" and "Disabled". - :paramtype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability - :keyword time_based_immutability_mode: The time-based immutability mode. Only applicable if - time-based immutability is enabled. Known values are: "Locked" and "Unlocked". - :paramtype time_based_immutability_mode: str or - ~azure.mgmt.sql.models.TimeBasedImmutabilityMode - :keyword legal_hold_immutability: The setting for whether LegalHold is enabled or disabled on - the LTR backup. When LegalHold is enabled, the backup cannot be deleted until the LegalHold is - removed. Known values are: "Enabled" and "Disabled". - :paramtype legal_hold_immutability: str or ~azure.mgmt.sql.models.SetLegalHoldImmutability - """ - super().__init__(**kwargs) - self.server_name: Optional[str] = None - self.server_create_time: Optional[datetime.datetime] = None - self.database_name: Optional[str] = None - self.database_deletion_time: Optional[datetime.datetime] = None - self.backup_time: Optional[datetime.datetime] = None - self.backup_expiration_time: Optional[datetime.datetime] = None - self.backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - self.is_backup_immutable = is_backup_immutable - self.time_based_immutability = time_based_immutability - self.time_based_immutability_mode = time_based_immutability_mode - self.legal_hold_immutability = legal_hold_immutability - self.backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None - - -class LongTermRetentionBackupListResult(_serialization.Model): - """A list of long term retention backups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.LongTermRetentionBackup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[LongTermRetentionBackup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.LongTermRetentionBackup"]] = None - self.next_link: Optional[str] = None - - -class LongTermRetentionBackupOperationResult(ProxyResource): - """A LongTermRetentionBackup 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 operation_type: Operation type. - :vartype operation_type: str - :ivar from_backup_resource_id: Source backup resource id. - :vartype from_backup_resource_id: str - :ivar to_backup_resource_id: Target backup resource id. - :vartype to_backup_resource_id: str - :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype target_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar status: Operation status. - :vartype status: str - :ivar message: Progress message. - :vartype message: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "request_id": {"readonly": True}, - "operation_type": {"readonly": True}, - "from_backup_resource_id": {"readonly": True}, - "to_backup_resource_id": {"readonly": True}, - "target_backup_storage_redundancy": {"readonly": True}, - "status": {"readonly": True}, - "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"}, - "operation_type": {"key": "properties.operationType", "type": "str"}, - "from_backup_resource_id": {"key": "properties.fromBackupResourceId", "type": "str"}, - "to_backup_resource_id": {"key": "properties.toBackupResourceId", "type": "str"}, - "target_backup_storage_redundancy": {"key": "properties.targetBackupStorageRedundancy", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "message": {"key": "properties.message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.request_id: Optional[str] = None - self.operation_type: Optional[str] = None - self.from_backup_resource_id: Optional[str] = None - self.to_backup_resource_id: Optional[str] = None - self.target_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.status: Optional[str] = None - self.message: Optional[str] = None - - -class LongTermRetentionPolicy(ProxyResource): - """A long term retention policy. - - 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 time_based_immutability: The setting for whether to enable time-based immutability for - future backups. When set, future backups will have TimeBasedImmutability enabled. Known values - are: "Enabled" and "Disabled". - :vartype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability - :ivar time_based_immutability_mode: The setting for time-based immutability mode for future - backup (Value can be either Locked or UnLocked. Only effective if TimeBasedImmutability is - enabled). Caution: Immutability of LTR backup cannot be removed if TimeBasedImmutabilityMode is - Locked. Known values are: "Locked" and "Unlocked". - :vartype time_based_immutability_mode: str or ~azure.mgmt.sql.models.TimeBasedImmutabilityMode - :ivar weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. - :vartype weekly_retention: str - :ivar monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 format. - :vartype monthly_retention: str - :ivar yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. - :vartype yearly_retention: str - :ivar week_of_year: The week of year to take the yearly backup in an ISO 8601 format. - :vartype week_of_year: int - """ - - _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"}, - "time_based_immutability": {"key": "properties.timeBasedImmutability", "type": "str"}, - "time_based_immutability_mode": {"key": "properties.timeBasedImmutabilityMode", "type": "str"}, - "weekly_retention": {"key": "properties.weeklyRetention", "type": "str"}, - "monthly_retention": {"key": "properties.monthlyRetention", "type": "str"}, - "yearly_retention": {"key": "properties.yearlyRetention", "type": "str"}, - "week_of_year": {"key": "properties.weekOfYear", "type": "int"}, - } - - def __init__( - self, - *, - time_based_immutability: Optional[Union[str, "_models.TimeBasedImmutability"]] = None, - time_based_immutability_mode: Optional[Union[str, "_models.TimeBasedImmutabilityMode"]] = None, - weekly_retention: Optional[str] = None, - monthly_retention: Optional[str] = None, - yearly_retention: Optional[str] = None, - week_of_year: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword time_based_immutability: The setting for whether to enable time-based immutability for - future backups. When set, future backups will have TimeBasedImmutability enabled. Known values - are: "Enabled" and "Disabled". - :paramtype time_based_immutability: str or ~azure.mgmt.sql.models.TimeBasedImmutability - :keyword time_based_immutability_mode: The setting for time-based immutability mode for future - backup (Value can be either Locked or UnLocked. Only effective if TimeBasedImmutability is - enabled). Caution: Immutability of LTR backup cannot be removed if TimeBasedImmutabilityMode is - Locked. Known values are: "Locked" and "Unlocked". - :paramtype time_based_immutability_mode: str or - ~azure.mgmt.sql.models.TimeBasedImmutabilityMode - :keyword weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. - :paramtype weekly_retention: str - :keyword monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 - format. - :paramtype monthly_retention: str - :keyword yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. - :paramtype yearly_retention: str - :keyword week_of_year: The week of year to take the yearly backup in an ISO 8601 format. - :paramtype week_of_year: int - """ - super().__init__(**kwargs) - self.time_based_immutability = time_based_immutability - self.time_based_immutability_mode = time_based_immutability_mode - self.weekly_retention = weekly_retention - self.monthly_retention = monthly_retention - self.yearly_retention = yearly_retention - self.week_of_year = week_of_year - - -class LongTermRetentionPolicyListResult(_serialization.Model): - """A list of long term retention policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[LongTermRetentionPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.LongTermRetentionPolicy"]] = None - self.next_link: Optional[str] = None - - -class MaintenanceConfigurationCapability(_serialization.Model): - """The maintenance configuration capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Maintenance configuration name. - :vartype name: str - :ivar zone_redundant: Whether or not zone redundancy is supported for the maintenance - configuration. - :vartype zone_redundant: bool - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.zone_redundant: Optional[bool] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class MaintenanceWindowOptions(ProxyResource): - """Maintenance window options. - - 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 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}. - :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 - :ivar default_duration_in_minutes: Default duration for maintenance window. - :vartype default_duration_in_minutes: int - :ivar min_cycles: Minimum number of maintenance windows cycles to be set on the database. - :vartype min_cycles: int - :ivar time_granularity_in_minutes: Time granularity in minutes for maintenance windows. - :vartype time_granularity_in_minutes: int - :ivar allow_multiple_maintenance_windows_per_cycle: Whether we allow multiple maintenance - windows per cycle. - :vartype allow_multiple_maintenance_windows_per_cycle: bool - """ - - _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"}, - "is_enabled": {"key": "properties.isEnabled", "type": "bool"}, - "maintenance_window_cycles": { - "key": "properties.maintenanceWindowCycles", - "type": "[MaintenanceWindowTimeRange]", - }, - "min_duration_in_minutes": {"key": "properties.minDurationInMinutes", "type": "int"}, - "default_duration_in_minutes": {"key": "properties.defaultDurationInMinutes", "type": "int"}, - "min_cycles": {"key": "properties.minCycles", "type": "int"}, - "time_granularity_in_minutes": {"key": "properties.timeGranularityInMinutes", "type": "int"}, - "allow_multiple_maintenance_windows_per_cycle": { - "key": "properties.allowMultipleMaintenanceWindowsPerCycle", - "type": "bool", - }, - } - - def __init__( - self, - *, - is_enabled: Optional[bool] = None, - maintenance_window_cycles: Optional[list["_models.MaintenanceWindowTimeRange"]] = None, - min_duration_in_minutes: Optional[int] = None, - default_duration_in_minutes: Optional[int] = None, - min_cycles: Optional[int] = None, - time_granularity_in_minutes: Optional[int] = None, - allow_multiple_maintenance_windows_per_cycle: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :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}. - :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 - :keyword default_duration_in_minutes: Default duration for maintenance window. - :paramtype default_duration_in_minutes: int - :keyword min_cycles: Minimum number of maintenance windows cycles to be set on the database. - :paramtype min_cycles: int - :keyword time_granularity_in_minutes: Time granularity in minutes for maintenance windows. - :paramtype time_granularity_in_minutes: int - :keyword allow_multiple_maintenance_windows_per_cycle: Whether we allow multiple maintenance - windows per cycle. - :paramtype allow_multiple_maintenance_windows_per_cycle: bool - """ - super().__init__(**kwargs) - self.is_enabled = is_enabled - self.maintenance_window_cycles = maintenance_window_cycles - self.min_duration_in_minutes = min_duration_in_minutes - self.default_duration_in_minutes = default_duration_in_minutes - self.min_cycles = min_cycles - self.time_granularity_in_minutes = time_granularity_in_minutes - self.allow_multiple_maintenance_windows_per_cycle = allow_multiple_maintenance_windows_per_cycle - - -class MaintenanceWindows(ProxyResource): - """Maintenance windows. - - 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 time_ranges: - :vartype time_ranges: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] - """ - - _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"}, - "time_ranges": {"key": "properties.timeRanges", "type": "[MaintenanceWindowTimeRange]"}, - } - - def __init__( - self, *, time_ranges: Optional[list["_models.MaintenanceWindowTimeRange"]] = None, **kwargs: Any - ) -> None: - """ - :keyword time_ranges: - :paramtype time_ranges: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] - """ - super().__init__(**kwargs) - self.time_ranges = time_ranges - - -class MaintenanceWindowTimeRange(_serialization.Model): - """Maintenance window time range. - - :ivar day_of_week: Day of maintenance window. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype day_of_week: str or ~azure.mgmt.sql.models.DayOfWeek - :ivar start_time: Start time minutes offset from 12am. - :vartype start_time: str - :ivar duration: Duration of maintenance window in minutes. - :vartype duration: str - """ - - _attribute_map = { - "day_of_week": {"key": "dayOfWeek", "type": "str"}, - "start_time": {"key": "startTime", "type": "str"}, - "duration": {"key": "duration", "type": "str"}, - } - - def __init__( - self, - *, - day_of_week: Optional[Union[str, "_models.DayOfWeek"]] = None, - start_time: Optional[str] = None, - duration: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword day_of_week: Day of maintenance window. Known values are: "Sunday", "Monday", - "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype day_of_week: str or ~azure.mgmt.sql.models.DayOfWeek - :keyword start_time: Start time minutes offset from 12am. - :paramtype start_time: str - :keyword duration: Duration of maintenance window in minutes. - :paramtype duration: str - """ - super().__init__(**kwargs) - self.day_of_week = day_of_week - self.start_time = start_time - self.duration = duration - - -class ManagedBackupShortTermRetentionPolicy(ProxyResource): - """A short term retention policy. - - 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 retention_days: The backup retention period in days. This is how many days Point-in-Time - Restore will be supported. - :vartype retention_days: int - """ - - _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"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - } - - def __init__(self, *, retention_days: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword retention_days: The backup retention period in days. This is how many days - Point-in-Time Restore will be supported. - :paramtype retention_days: int - """ - super().__init__(**kwargs) - self.retention_days = retention_days - - -class ManagedBackupShortTermRetentionPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of short term retention policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedBackupShortTermRetentionPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedBackupShortTermRetentionPolicy"]] = None - self.next_link: Optional[str] = None - - -class ManagedDatabase(TrackedResource): - """A managed database resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar collation: Collation of the managed database. - :vartype collation: str - :ivar status: Status of the database. Known values are: "Online", "Offline", "Shutdown", - "Creating", "Inaccessible", "Restoring", "Updating", "Stopping", "Stopped", "Starting", - "DbMoving", and "DbCopying". - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: ~datetime.datetime - :ivar earliest_restore_point: Earliest restore point in time for point in time restore. - :vartype earliest_restore_point: ~datetime.datetime - :ivar restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is - required. Specifies the point in time (ISO8601 format) of the source database that will be - restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: str - :ivar catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :ivar create_mode: Managed database create mode. PointInTimeRestore: Create a database by - restoring a point in time backup of an existing database. SourceDatabaseName, - SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a - database by restoring from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a - geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database - resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a - long term retention backup (longTermRetentionBackupResourceId required). Known values are: - "Default", "RestoreExternalBackup", "PointInTimeRestore", "Recovery", and - "RestoreLongTermRetentionBackup". - :vartype create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :ivar storage_container_uri: Conditional. If createMode is RestoreExternalBackup, this value is - required. Specifies the uri of the storage container where backups for this restore are stored. - :vartype storage_container_uri: str - :ivar source_database_id: The resource identifier of the source database associated with create - operation of this database. - :vartype source_database_id: str - :ivar cross_subscription_source_database_id: The resource identifier of the cross-subscription - source database associated with create operation of this database. - :vartype cross_subscription_source_database_id: str - :ivar restorable_dropped_database_id: The restorable dropped database resource id to restore - when creating this database. - :vartype restorable_dropped_database_id: str - :ivar cross_subscription_restorable_dropped_database_id: The restorable cross-subscription - dropped database resource id to restore when creating this database. - :vartype cross_subscription_restorable_dropped_database_id: str - :ivar storage_container_identity: Conditional. If createMode is RestoreExternalBackup, this - value is used. Specifies the identity used for storage container authentication. Can be - 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is - assumed. - :vartype storage_container_identity: str - :ivar storage_container_sas_token: Conditional. If createMode is RestoreExternalBackup and - storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage - container sas token. - :vartype storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that this managed database - belongs to. - :vartype failover_group_id: str - :ivar recoverable_database_id: The resource identifier of the recoverable database associated - with create operation of this database. - :vartype recoverable_database_id: str - :ivar long_term_retention_backup_resource_id: The name of the Long Term Retention backup to be - used for restore of this managed database. - :vartype long_term_retention_backup_resource_id: str - :ivar auto_complete_restore: Whether to auto complete restore of this managed database. - :vartype auto_complete_restore: bool - :ivar last_backup_name: Last backup file name for restore of this managed database. - :vartype last_backup_name: str - :ivar cross_subscription_target_managed_instance_id: Target managed instance id used in - cross-subscription restore. - :vartype cross_subscription_target_managed_instance_id: str - :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables - in the database are ledger tables. Note: the value of this property cannot be changed after the - database has been created. - :vartype is_ledger_on: bool - :ivar extended_accessibility_info: Additional observability and troubleshooting information for - databases in ‘Inaccessible’ state. - :vartype extended_accessibility_info: - ~azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "status": {"readonly": True}, - "creation_date": {"readonly": True}, - "earliest_restore_point": {"readonly": True}, - "default_secondary_location": {"readonly": True}, - "failover_group_id": {"readonly": True}, - "extended_accessibility_info": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "collation": {"key": "properties.collation", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "earliest_restore_point": {"key": "properties.earliestRestorePoint", "type": "iso-8601"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "default_secondary_location": {"key": "properties.defaultSecondaryLocation", "type": "str"}, - "catalog_collation": {"key": "properties.catalogCollation", "type": "str"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "storage_container_uri": {"key": "properties.storageContainerUri", "type": "str"}, - "source_database_id": {"key": "properties.sourceDatabaseId", "type": "str"}, - "cross_subscription_source_database_id": {"key": "properties.crossSubscriptionSourceDatabaseId", "type": "str"}, - "restorable_dropped_database_id": {"key": "properties.restorableDroppedDatabaseId", "type": "str"}, - "cross_subscription_restorable_dropped_database_id": { - "key": "properties.crossSubscriptionRestorableDroppedDatabaseId", - "type": "str", - }, - "storage_container_identity": {"key": "properties.storageContainerIdentity", "type": "str"}, - "storage_container_sas_token": {"key": "properties.storageContainerSasToken", "type": "str"}, - "failover_group_id": {"key": "properties.failoverGroupId", "type": "str"}, - "recoverable_database_id": {"key": "properties.recoverableDatabaseId", "type": "str"}, - "long_term_retention_backup_resource_id": { - "key": "properties.longTermRetentionBackupResourceId", - "type": "str", - }, - "auto_complete_restore": {"key": "properties.autoCompleteRestore", "type": "bool"}, - "last_backup_name": {"key": "properties.lastBackupName", "type": "str"}, - "cross_subscription_target_managed_instance_id": { - "key": "properties.crossSubscriptionTargetManagedInstanceId", - "type": "str", - }, - "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, - "extended_accessibility_info": { - "key": "properties.extendedAccessibilityInfo", - "type": "ManagedDatabaseExtendedAccessibilityInfo", - }, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - collation: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, - create_mode: Optional[Union[str, "_models.ManagedDatabaseCreateMode"]] = None, - storage_container_uri: Optional[str] = None, - source_database_id: Optional[str] = None, - cross_subscription_source_database_id: Optional[str] = None, - restorable_dropped_database_id: Optional[str] = None, - cross_subscription_restorable_dropped_database_id: Optional[str] = None, - storage_container_identity: Optional[str] = None, - storage_container_sas_token: Optional[str] = None, - recoverable_database_id: Optional[str] = None, - long_term_retention_backup_resource_id: Optional[str] = None, - auto_complete_restore: Optional[bool] = None, - last_backup_name: Optional[str] = None, - cross_subscription_target_managed_instance_id: Optional[str] = None, - is_ledger_on: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword collation: Collation of the managed database. - :paramtype collation: str - :keyword restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is - required. Specifies the point in time (ISO8601 format) of the source database that will be - restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :paramtype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :keyword create_mode: Managed database create mode. PointInTimeRestore: Create a database by - restoring a point in time backup of an existing database. SourceDatabaseName, - SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a - database by restoring from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a - geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database - resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a - long term retention backup (longTermRetentionBackupResourceId required). Known values are: - "Default", "RestoreExternalBackup", "PointInTimeRestore", "Recovery", and - "RestoreLongTermRetentionBackup". - :paramtype create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :keyword storage_container_uri: Conditional. If createMode is RestoreExternalBackup, this value - is required. Specifies the uri of the storage container where backups for this restore are - stored. - :paramtype storage_container_uri: str - :keyword source_database_id: The resource identifier of the source database associated with - create operation of this database. - :paramtype source_database_id: str - :keyword cross_subscription_source_database_id: The resource identifier of the - cross-subscription source database associated with create operation of this database. - :paramtype cross_subscription_source_database_id: str - :keyword restorable_dropped_database_id: The restorable dropped database resource id to restore - when creating this database. - :paramtype restorable_dropped_database_id: str - :keyword cross_subscription_restorable_dropped_database_id: The restorable cross-subscription - dropped database resource id to restore when creating this database. - :paramtype cross_subscription_restorable_dropped_database_id: str - :keyword storage_container_identity: Conditional. If createMode is RestoreExternalBackup, this - value is used. Specifies the identity used for storage container authentication. Can be - 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is - assumed. - :paramtype storage_container_identity: str - :keyword storage_container_sas_token: Conditional. If createMode is RestoreExternalBackup and - storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage - container sas token. - :paramtype storage_container_sas_token: str - :keyword recoverable_database_id: The resource identifier of the recoverable database - associated with create operation of this database. - :paramtype recoverable_database_id: str - :keyword long_term_retention_backup_resource_id: The name of the Long Term Retention backup to - be used for restore of this managed database. - :paramtype long_term_retention_backup_resource_id: str - :keyword auto_complete_restore: Whether to auto complete restore of this managed database. - :paramtype auto_complete_restore: bool - :keyword last_backup_name: Last backup file name for restore of this managed database. - :paramtype last_backup_name: str - :keyword cross_subscription_target_managed_instance_id: Target managed instance id used in - cross-subscription restore. - :paramtype cross_subscription_target_managed_instance_id: str - :keyword is_ledger_on: Whether or not this database is a ledger database, which means all - tables in the database are ledger tables. Note: the value of this property cannot be changed - after the database has been created. - :paramtype is_ledger_on: bool - """ - super().__init__(location=location, tags=tags, **kwargs) - self.collation = collation - self.status: Optional[Union[str, "_models.ManagedDatabaseStatus"]] = None - self.creation_date: Optional[datetime.datetime] = None - self.earliest_restore_point: Optional[datetime.datetime] = None - self.restore_point_in_time = restore_point_in_time - self.default_secondary_location: Optional[str] = None - self.catalog_collation = catalog_collation - self.create_mode = create_mode - self.storage_container_uri = storage_container_uri - self.source_database_id = source_database_id - self.cross_subscription_source_database_id = cross_subscription_source_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.cross_subscription_restorable_dropped_database_id = cross_subscription_restorable_dropped_database_id - self.storage_container_identity = storage_container_identity - self.storage_container_sas_token = storage_container_sas_token - self.failover_group_id: Optional[str] = None - self.recoverable_database_id = recoverable_database_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.auto_complete_restore = auto_complete_restore - self.last_backup_name = last_backup_name - self.cross_subscription_target_managed_instance_id = cross_subscription_target_managed_instance_id - self.is_ledger_on = is_ledger_on - self.extended_accessibility_info: Optional["_models.ManagedDatabaseExtendedAccessibilityInfo"] = None - - -class ManagedDatabaseAdvancedThreatProtection(ProxyResource): - """A managed database Advanced Threat Protection. - - 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 system_data: SystemData of AdvancedThreatProtectionResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.AdvancedThreatProtectionState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.creation_time: Optional[datetime.datetime] = None - - -class ManagedDatabaseAdvancedThreatProtectionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the managed database's Advanced Threat Protection settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedDatabaseAdvancedThreatProtection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedDatabaseAdvancedThreatProtection"]] = None - self.next_link: Optional[str] = None - - -class ManagedDatabaseExtendedAccessibilityInfo(_serialization.Model): - """Managed Database Extended Accessibility Information. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar inaccessibility_reason_error_code: SQL Server error code connected to the inaccessibility - root cause. Required. - :vartype inaccessibility_reason_error_code: str - :ivar inaccessibility_reason_description: Root cause explanation and mitigation action. - Required. - :vartype inaccessibility_reason_description: str - :ivar inaccessibility_reason_kind: Root cause kind. Allowed values are - “TransparentDataEncryption”, “DatabaseReplication”, and “Unknown”. Required. Known values are: - "Unknown", "TransparentDataEncryption", and "DatabaseReplication". - :vartype inaccessibility_reason_kind: str or ~azure.mgmt.sql.models.InaccessibilityReason - :ivar inaccessibility_reason_tde_key_uri: For the root cause kind “TransparentDataEncryption”, - the CMK URI. - :vartype inaccessibility_reason_tde_key_uri: str - """ - - _validation = { - "inaccessibility_reason_error_code": {"required": True, "readonly": True}, - "inaccessibility_reason_description": {"required": True, "readonly": True}, - "inaccessibility_reason_kind": {"required": True, "readonly": True}, - "inaccessibility_reason_tde_key_uri": {"readonly": True}, - } - - _attribute_map = { - "inaccessibility_reason_error_code": {"key": "inaccessibilityReasonErrorCode", "type": "str"}, - "inaccessibility_reason_description": {"key": "inaccessibilityReasonDescription", "type": "str"}, - "inaccessibility_reason_kind": {"key": "inaccessibilityReasonKind", "type": "str"}, - "inaccessibility_reason_tde_key_uri": {"key": "inaccessibilityReasonTdeKeyUri", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.inaccessibility_reason_error_code: Optional[str] = None - self.inaccessibility_reason_description: Optional[str] = None - self.inaccessibility_reason_kind: Optional[Union[str, "_models.InaccessibilityReason"]] = None - self.inaccessibility_reason_tde_key_uri: Optional[str] = None - - -class ManagedDatabaseListResult(_serialization.Model): - """A list of managed databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedDatabase"]] = None - self.next_link: Optional[str] = None - - -class ManagedDatabaseMoveDefinition(_serialization.Model): - """Contains the information necessary to perform a managed database move. - - All required parameters must be populated in order to send to server. - - :ivar destination_managed_database_id: The destination managed database ID. Required. - :vartype destination_managed_database_id: str - """ - - _validation = { - "destination_managed_database_id": {"required": True}, - } - - _attribute_map = { - "destination_managed_database_id": {"key": "destinationManagedDatabaseId", "type": "str"}, - } - - def __init__(self, *, destination_managed_database_id: str, **kwargs: Any) -> None: - """ - :keyword destination_managed_database_id: The destination managed database ID. Required. - :paramtype destination_managed_database_id: str - """ - super().__init__(**kwargs) - self.destination_managed_database_id = destination_managed_database_id - - -class ManagedDatabaseMoveOperationListResult(_serialization.Model): - """List of managed database move operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedDatabaseMoveOperationResult]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedDatabaseMoveOperationResult"]] = None - self.next_link: Optional[str] = None - - -class ManagedDatabaseMoveOperationResult(ProxyResource): - """A managed database move operation. - - 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 operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", - "Failed", "CancelInProgress", and "Cancelled". - :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState - :ivar operation_mode: Operation mode. Known values are: "Move" and "Copy". - :vartype operation_mode: str or ~azure.mgmt.sql.models.MoveOperationMode - :ivar source_managed_instance_name: Source Managed Instance name. - :vartype source_managed_instance_name: str - :ivar target_managed_instance_name: Target Managed Instance name. - :vartype target_managed_instance_name: str - :ivar source_managed_instance_id: Source Managed Instance resource id. - :vartype source_managed_instance_id: str - :ivar target_managed_instance_id: Target Managed instance resource id. - :vartype target_managed_instance_id: str - :ivar source_database_name: Source database name. - :vartype source_database_name: str - :ivar target_database_name: Target database name. - :vartype target_database_name: str - :ivar is_cancellable: Is move operation cancellable. - :vartype is_cancellable: bool - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "operation_mode": {"readonly": True}, - "source_managed_instance_name": {"readonly": True}, - "target_managed_instance_name": {"readonly": True}, - "source_managed_instance_id": {"readonly": True}, - "target_managed_instance_id": {"readonly": True}, - "source_database_name": {"readonly": True}, - "target_database_name": {"readonly": True}, - "is_cancellable": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "operation_mode": {"key": "properties.operationMode", "type": "str"}, - "source_managed_instance_name": {"key": "properties.sourceManagedInstanceName", "type": "str"}, - "target_managed_instance_name": {"key": "properties.targetManagedInstanceName", "type": "str"}, - "source_managed_instance_id": {"key": "properties.sourceManagedInstanceId", "type": "str"}, - "target_managed_instance_id": {"key": "properties.targetManagedInstanceId", "type": "str"}, - "source_database_name": {"key": "properties.sourceDatabaseName", "type": "str"}, - "target_database_name": {"key": "properties.targetDatabaseName", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None - self.operation_mode: Optional[Union[str, "_models.MoveOperationMode"]] = None - self.source_managed_instance_name: Optional[str] = None - self.target_managed_instance_name: Optional[str] = None - self.source_managed_instance_id: Optional[str] = None - self.target_managed_instance_id: Optional[str] = None - self.source_database_name: Optional[str] = None - self.target_database_name: Optional[str] = None - self.is_cancellable: Optional[bool] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.is_user_error: Optional[bool] = None - - -class ManagedDatabaseRestoreDetailsBackupSetProperties(_serialization.Model): # pylint: disable=name-too-long - """The managed database's restore details backup set properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar status: Backup set status. - :vartype status: str - :ivar first_stripe_name: First stripe name. - :vartype first_stripe_name: str - :ivar number_of_stripes: Number of stripes. - :vartype number_of_stripes: int - :ivar backup_size_mb: Backup size. - :vartype backup_size_mb: int - :ivar restore_started_timestamp_utc: Last restored file time. - :vartype restore_started_timestamp_utc: ~datetime.datetime - :ivar restore_finished_timestamp_utc: Last restored file time. - :vartype restore_finished_timestamp_utc: ~datetime.datetime - """ - - _validation = { - "status": {"readonly": True}, - "first_stripe_name": {"readonly": True}, - "number_of_stripes": {"readonly": True}, - "backup_size_mb": {"readonly": True}, - "restore_started_timestamp_utc": {"readonly": True}, - "restore_finished_timestamp_utc": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "first_stripe_name": {"key": "firstStripeName", "type": "str"}, - "number_of_stripes": {"key": "numberOfStripes", "type": "int"}, - "backup_size_mb": {"key": "backupSizeMB", "type": "int"}, - "restore_started_timestamp_utc": {"key": "restoreStartedTimestampUtc", "type": "iso-8601"}, - "restore_finished_timestamp_utc": {"key": "restoreFinishedTimestampUtc", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status: Optional[str] = None - self.first_stripe_name: Optional[str] = None - self.number_of_stripes: Optional[int] = None - self.backup_size_mb: Optional[int] = None - self.restore_started_timestamp_utc: Optional[datetime.datetime] = None - self.restore_finished_timestamp_utc: Optional[datetime.datetime] = None - - -class ManagedDatabaseRestoreDetailsResult(ProxyResource): - """A managed database restore details. - - 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 type_properties_type: Restore type. - :vartype type_properties_type: str - :ivar status: Restore status. - :vartype status: str - :ivar block_reason: The reason why restore is in Blocked state. - :vartype block_reason: str - :ivar last_uploaded_file_name: Last uploaded file name. - :vartype last_uploaded_file_name: str - :ivar last_uploaded_file_time: Last uploaded file time. - :vartype last_uploaded_file_time: ~datetime.datetime - :ivar last_restored_file_name: Last restored file name. - :vartype last_restored_file_name: str - :ivar last_restored_file_time: Last restored file time. - :vartype last_restored_file_time: ~datetime.datetime - :ivar percent_completed: Percent completed. - :vartype percent_completed: int - :ivar current_restored_size_mb: Current restored size MB. - :vartype current_restored_size_mb: int - :ivar current_restore_plan_size_mb: Current restore plan size MB. - :vartype current_restore_plan_size_mb: int - :ivar current_backup_type: Current backup type. - :vartype current_backup_type: str - :ivar current_restoring_file_name: Current restoring file name. - :vartype current_restoring_file_name: str - :ivar number_of_files_detected: Number of files detected. - :vartype number_of_files_detected: int - :ivar number_of_files_queued: Number of files queued. - :vartype number_of_files_queued: int - :ivar number_of_files_skipped: Number of files skipped. - :vartype number_of_files_skipped: int - :ivar number_of_files_restoring: Number of files restoring. - :vartype number_of_files_restoring: int - :ivar number_of_files_restored: Number of files restored. - :vartype number_of_files_restored: int - :ivar number_of_files_unrestorable: Number of files unrestorable. - :vartype number_of_files_unrestorable: int - :ivar full_backup_sets: Full backup sets. - :vartype full_backup_sets: - list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] - :ivar diff_backup_sets: Diff backup sets. - :vartype diff_backup_sets: - list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] - :ivar log_backup_sets: Log backup sets. - :vartype log_backup_sets: - list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsBackupSetProperties] - :ivar unrestorable_files: Unrestorable files. - :vartype unrestorable_files: - list[~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "type_properties_type": {"readonly": True}, - "status": {"readonly": True}, - "block_reason": {"readonly": True}, - "last_uploaded_file_name": {"readonly": True}, - "last_uploaded_file_time": {"readonly": True}, - "last_restored_file_name": {"readonly": True}, - "last_restored_file_time": {"readonly": True}, - "percent_completed": {"readonly": True}, - "current_restored_size_mb": {"readonly": True}, - "current_restore_plan_size_mb": {"readonly": True}, - "current_backup_type": {"readonly": True}, - "current_restoring_file_name": {"readonly": True}, - "number_of_files_detected": {"readonly": True}, - "number_of_files_queued": {"readonly": True}, - "number_of_files_skipped": {"readonly": True}, - "number_of_files_restoring": {"readonly": True}, - "number_of_files_restored": {"readonly": True}, - "number_of_files_unrestorable": {"readonly": True}, - "full_backup_sets": {"readonly": True}, - "diff_backup_sets": {"readonly": True}, - "log_backup_sets": {"readonly": True}, - "unrestorable_files": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "block_reason": {"key": "properties.blockReason", "type": "str"}, - "last_uploaded_file_name": {"key": "properties.lastUploadedFileName", "type": "str"}, - "last_uploaded_file_time": {"key": "properties.lastUploadedFileTime", "type": "iso-8601"}, - "last_restored_file_name": {"key": "properties.lastRestoredFileName", "type": "str"}, - "last_restored_file_time": {"key": "properties.lastRestoredFileTime", "type": "iso-8601"}, - "percent_completed": {"key": "properties.percentCompleted", "type": "int"}, - "current_restored_size_mb": {"key": "properties.currentRestoredSizeMB", "type": "int"}, - "current_restore_plan_size_mb": {"key": "properties.currentRestorePlanSizeMB", "type": "int"}, - "current_backup_type": {"key": "properties.currentBackupType", "type": "str"}, - "current_restoring_file_name": {"key": "properties.currentRestoringFileName", "type": "str"}, - "number_of_files_detected": {"key": "properties.numberOfFilesDetected", "type": "int"}, - "number_of_files_queued": {"key": "properties.numberOfFilesQueued", "type": "int"}, - "number_of_files_skipped": {"key": "properties.numberOfFilesSkipped", "type": "int"}, - "number_of_files_restoring": {"key": "properties.numberOfFilesRestoring", "type": "int"}, - "number_of_files_restored": {"key": "properties.numberOfFilesRestored", "type": "int"}, - "number_of_files_unrestorable": {"key": "properties.numberOfFilesUnrestorable", "type": "int"}, - "full_backup_sets": { - "key": "properties.fullBackupSets", - "type": "[ManagedDatabaseRestoreDetailsBackupSetProperties]", - }, - "diff_backup_sets": { - "key": "properties.diffBackupSets", - "type": "[ManagedDatabaseRestoreDetailsBackupSetProperties]", - }, - "log_backup_sets": { - "key": "properties.logBackupSets", - "type": "[ManagedDatabaseRestoreDetailsBackupSetProperties]", - }, - "unrestorable_files": { - "key": "properties.unrestorableFiles", - "type": "[ManagedDatabaseRestoreDetailsUnrestorableFileProperties]", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.type_properties_type: Optional[str] = None - self.status: Optional[str] = None - self.block_reason: Optional[str] = None - self.last_uploaded_file_name: Optional[str] = None - self.last_uploaded_file_time: Optional[datetime.datetime] = None - self.last_restored_file_name: Optional[str] = None - self.last_restored_file_time: Optional[datetime.datetime] = None - self.percent_completed: Optional[int] = None - self.current_restored_size_mb: Optional[int] = None - self.current_restore_plan_size_mb: Optional[int] = None - self.current_backup_type: Optional[str] = None - self.current_restoring_file_name: Optional[str] = None - self.number_of_files_detected: Optional[int] = None - self.number_of_files_queued: Optional[int] = None - self.number_of_files_skipped: Optional[int] = None - self.number_of_files_restoring: Optional[int] = None - self.number_of_files_restored: Optional[int] = None - self.number_of_files_unrestorable: Optional[int] = None - self.full_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = None - self.diff_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = None - self.log_backup_sets: Optional[list["_models.ManagedDatabaseRestoreDetailsBackupSetProperties"]] = None - self.unrestorable_files: Optional[list["_models.ManagedDatabaseRestoreDetailsUnrestorableFileProperties"]] = ( - None - ) - - -class ManagedDatabaseRestoreDetailsUnrestorableFileProperties(_serialization.Model): # pylint: disable=name-too-long - """The managed database's restore details unrestorable file properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: File name. - :vartype name: str - """ - - _validation = { - "name": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - - -class ManagedDatabaseSecurityAlertPolicy(ProxyResource): - """A managed database security alert policy. - - 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 state: Specifies the state of the policy, whether it is enabled or disabled or a policy - has not been applied yet on the specific database. Known values are: "New", "Enabled", and - "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState - :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :vartype disabled_alerts: list[str] - :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :vartype email_addresses: list[str] - :ivar email_account_admins: Specifies that the alert is sent to the account administrators. - :vartype email_account_admins: bool - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :vartype storage_account_access_key: str - :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. - :vartype retention_days: int - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "disabled_alerts": {"key": "properties.disabledAlerts", "type": "[str]"}, - "email_addresses": {"key": "properties.emailAddresses", "type": "[str]"}, - "email_account_admins": {"key": "properties.emailAccountAdmins", "type": "bool"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, - *, - state: Optional[Union[str, "_models.SecurityAlertPolicyState"]] = None, - disabled_alerts: Optional[list[str]] = None, - email_addresses: Optional[list[str]] = None, - email_account_admins: Optional[bool] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - retention_days: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the policy, whether it is enabled or disabled or a - policy has not been applied yet on the specific database. Known values are: "New", "Enabled", - and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState - :keyword disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :paramtype disabled_alerts: list[str] - :keyword email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :paramtype email_addresses: list[str] - :keyword email_account_admins: Specifies that the alert is sent to the account administrators. - :paramtype email_account_admins: bool - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :paramtype storage_account_access_key: str - :keyword retention_days: Specifies the number of days to keep in the Threat Detection audit - logs. - :paramtype retention_days: int - """ - super().__init__(**kwargs) - self.state = state - self.disabled_alerts = disabled_alerts - self.email_addresses = email_addresses - self.email_account_admins = email_account_admins - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.retention_days = retention_days - self.creation_time: Optional[datetime.datetime] = None - - -class ManagedDatabaseSecurityAlertPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the managed database's security alert policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedDatabaseSecurityAlertPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedDatabaseSecurityAlertPolicy"]] = None - self.next_link: Optional[str] = None - - -class ManagedDatabaseStartMoveDefinition(_serialization.Model): - """Contains the information necessary to start a managed database move. - - All required parameters must be populated in order to send to server. - - :ivar destination_managed_database_id: The destination managed database ID. Required. - :vartype destination_managed_database_id: str - :ivar operation_mode: The move operation mode. Known values are: "Move" and "Copy". - :vartype operation_mode: str or ~azure.mgmt.sql.models.MoveOperationMode - """ - - _validation = { - "destination_managed_database_id": {"required": True}, - } - - _attribute_map = { - "destination_managed_database_id": {"key": "destinationManagedDatabaseId", "type": "str"}, - "operation_mode": {"key": "operationMode", "type": "str"}, - } - - def __init__( - self, - *, - destination_managed_database_id: str, - operation_mode: Optional[Union[str, "_models.MoveOperationMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword destination_managed_database_id: The destination managed database ID. Required. - :paramtype destination_managed_database_id: str - :keyword operation_mode: The move operation mode. Known values are: "Move" and "Copy". - :paramtype operation_mode: str or ~azure.mgmt.sql.models.MoveOperationMode - """ - super().__init__(**kwargs) - self.destination_managed_database_id = destination_managed_database_id - self.operation_mode = operation_mode - - -class ManagedDatabaseUpdate(_serialization.Model): - """An managed database update. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar collation: Collation of the managed database. - :vartype collation: str - :ivar status: Status of the database. Known values are: "Online", "Offline", "Shutdown", - "Creating", "Inaccessible", "Restoring", "Updating", "Stopping", "Stopped", "Starting", - "DbMoving", and "DbCopying". - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: ~datetime.datetime - :ivar earliest_restore_point: Earliest restore point in time for point in time restore. - :vartype earliest_restore_point: ~datetime.datetime - :ivar restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is - required. Specifies the point in time (ISO8601 format) of the source database that will be - restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: str - :ivar catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :vartype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :ivar create_mode: Managed database create mode. PointInTimeRestore: Create a database by - restoring a point in time backup of an existing database. SourceDatabaseName, - SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a - database by restoring from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a - geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database - resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a - long term retention backup (longTermRetentionBackupResourceId required). Known values are: - "Default", "RestoreExternalBackup", "PointInTimeRestore", "Recovery", and - "RestoreLongTermRetentionBackup". - :vartype create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :ivar storage_container_uri: Conditional. If createMode is RestoreExternalBackup, this value is - required. Specifies the uri of the storage container where backups for this restore are stored. - :vartype storage_container_uri: str - :ivar source_database_id: The resource identifier of the source database associated with create - operation of this database. - :vartype source_database_id: str - :ivar cross_subscription_source_database_id: The resource identifier of the cross-subscription - source database associated with create operation of this database. - :vartype cross_subscription_source_database_id: str - :ivar restorable_dropped_database_id: The restorable dropped database resource id to restore - when creating this database. - :vartype restorable_dropped_database_id: str - :ivar cross_subscription_restorable_dropped_database_id: The restorable cross-subscription - dropped database resource id to restore when creating this database. - :vartype cross_subscription_restorable_dropped_database_id: str - :ivar storage_container_identity: Conditional. If createMode is RestoreExternalBackup, this - value is used. Specifies the identity used for storage container authentication. Can be - 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is - assumed. - :vartype storage_container_identity: str - :ivar storage_container_sas_token: Conditional. If createMode is RestoreExternalBackup and - storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage - container sas token. - :vartype storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that this managed database - belongs to. - :vartype failover_group_id: str - :ivar recoverable_database_id: The resource identifier of the recoverable database associated - with create operation of this database. - :vartype recoverable_database_id: str - :ivar long_term_retention_backup_resource_id: The name of the Long Term Retention backup to be - used for restore of this managed database. - :vartype long_term_retention_backup_resource_id: str - :ivar auto_complete_restore: Whether to auto complete restore of this managed database. - :vartype auto_complete_restore: bool - :ivar last_backup_name: Last backup file name for restore of this managed database. - :vartype last_backup_name: str - :ivar cross_subscription_target_managed_instance_id: Target managed instance id used in - cross-subscription restore. - :vartype cross_subscription_target_managed_instance_id: str - :ivar is_ledger_on: Whether or not this database is a ledger database, which means all tables - in the database are ledger tables. Note: the value of this property cannot be changed after the - database has been created. - :vartype is_ledger_on: bool - :ivar extended_accessibility_info: Additional observability and troubleshooting information for - databases in ‘Inaccessible’ state. - :vartype extended_accessibility_info: - ~azure.mgmt.sql.models.ManagedDatabaseExtendedAccessibilityInfo - """ - - _validation = { - "status": {"readonly": True}, - "creation_date": {"readonly": True}, - "earliest_restore_point": {"readonly": True}, - "default_secondary_location": {"readonly": True}, - "failover_group_id": {"readonly": True}, - "extended_accessibility_info": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "collation": {"key": "properties.collation", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "earliest_restore_point": {"key": "properties.earliestRestorePoint", "type": "iso-8601"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "default_secondary_location": {"key": "properties.defaultSecondaryLocation", "type": "str"}, - "catalog_collation": {"key": "properties.catalogCollation", "type": "str"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - "storage_container_uri": {"key": "properties.storageContainerUri", "type": "str"}, - "source_database_id": {"key": "properties.sourceDatabaseId", "type": "str"}, - "cross_subscription_source_database_id": {"key": "properties.crossSubscriptionSourceDatabaseId", "type": "str"}, - "restorable_dropped_database_id": {"key": "properties.restorableDroppedDatabaseId", "type": "str"}, - "cross_subscription_restorable_dropped_database_id": { - "key": "properties.crossSubscriptionRestorableDroppedDatabaseId", - "type": "str", - }, - "storage_container_identity": {"key": "properties.storageContainerIdentity", "type": "str"}, - "storage_container_sas_token": {"key": "properties.storageContainerSasToken", "type": "str"}, - "failover_group_id": {"key": "properties.failoverGroupId", "type": "str"}, - "recoverable_database_id": {"key": "properties.recoverableDatabaseId", "type": "str"}, - "long_term_retention_backup_resource_id": { - "key": "properties.longTermRetentionBackupResourceId", - "type": "str", - }, - "auto_complete_restore": {"key": "properties.autoCompleteRestore", "type": "bool"}, - "last_backup_name": {"key": "properties.lastBackupName", "type": "str"}, - "cross_subscription_target_managed_instance_id": { - "key": "properties.crossSubscriptionTargetManagedInstanceId", - "type": "str", - }, - "is_ledger_on": {"key": "properties.isLedgerOn", "type": "bool"}, - "extended_accessibility_info": { - "key": "properties.extendedAccessibilityInfo", - "type": "ManagedDatabaseExtendedAccessibilityInfo", - }, - } - - def __init__( - self, - *, - tags: Optional[dict[str, str]] = None, - collation: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - catalog_collation: Optional[Union[str, "_models.CatalogCollationType"]] = None, - create_mode: Optional[Union[str, "_models.ManagedDatabaseCreateMode"]] = None, - storage_container_uri: Optional[str] = None, - source_database_id: Optional[str] = None, - cross_subscription_source_database_id: Optional[str] = None, - restorable_dropped_database_id: Optional[str] = None, - cross_subscription_restorable_dropped_database_id: Optional[str] = None, - storage_container_identity: Optional[str] = None, - storage_container_sas_token: Optional[str] = None, - recoverable_database_id: Optional[str] = None, - long_term_retention_backup_resource_id: Optional[str] = None, - auto_complete_restore: Optional[bool] = None, - last_backup_name: Optional[str] = None, - cross_subscription_target_managed_instance_id: Optional[str] = None, - is_ledger_on: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword collation: Collation of the managed database. - :paramtype collation: str - :keyword restore_point_in_time: Conditional. If createMode is PointInTimeRestore, this value is - required. Specifies the point in time (ISO8601 format) of the source database that will be - restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword catalog_collation: Collation of the metadata catalog. Known values are: - "DATABASE_DEFAULT" and "SQL_Latin1_General_CP1_CI_AS". - :paramtype catalog_collation: str or ~azure.mgmt.sql.models.CatalogCollationType - :keyword create_mode: Managed database create mode. PointInTimeRestore: Create a database by - restoring a point in time backup of an existing database. SourceDatabaseName, - SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a - database by restoring from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a - geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database - resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a - long term retention backup (longTermRetentionBackupResourceId required). Known values are: - "Default", "RestoreExternalBackup", "PointInTimeRestore", "Recovery", and - "RestoreLongTermRetentionBackup". - :paramtype create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :keyword storage_container_uri: Conditional. If createMode is RestoreExternalBackup, this value - is required. Specifies the uri of the storage container where backups for this restore are - stored. - :paramtype storage_container_uri: str - :keyword source_database_id: The resource identifier of the source database associated with - create operation of this database. - :paramtype source_database_id: str - :keyword cross_subscription_source_database_id: The resource identifier of the - cross-subscription source database associated with create operation of this database. - :paramtype cross_subscription_source_database_id: str - :keyword restorable_dropped_database_id: The restorable dropped database resource id to restore - when creating this database. - :paramtype restorable_dropped_database_id: str - :keyword cross_subscription_restorable_dropped_database_id: The restorable cross-subscription - dropped database resource id to restore when creating this database. - :paramtype cross_subscription_restorable_dropped_database_id: str - :keyword storage_container_identity: Conditional. If createMode is RestoreExternalBackup, this - value is used. Specifies the identity used for storage container authentication. Can be - 'SharedAccessSignature' or 'ManagedIdentity'; if not specified 'SharedAccessSignature' is - assumed. - :paramtype storage_container_identity: str - :keyword storage_container_sas_token: Conditional. If createMode is RestoreExternalBackup and - storageContainerIdentity is not ManagedIdentity, this value is required. Specifies the storage - container sas token. - :paramtype storage_container_sas_token: str - :keyword recoverable_database_id: The resource identifier of the recoverable database - associated with create operation of this database. - :paramtype recoverable_database_id: str - :keyword long_term_retention_backup_resource_id: The name of the Long Term Retention backup to - be used for restore of this managed database. - :paramtype long_term_retention_backup_resource_id: str - :keyword auto_complete_restore: Whether to auto complete restore of this managed database. - :paramtype auto_complete_restore: bool - :keyword last_backup_name: Last backup file name for restore of this managed database. - :paramtype last_backup_name: str - :keyword cross_subscription_target_managed_instance_id: Target managed instance id used in - cross-subscription restore. - :paramtype cross_subscription_target_managed_instance_id: str - :keyword is_ledger_on: Whether or not this database is a ledger database, which means all - tables in the database are ledger tables. Note: the value of this property cannot be changed - after the database has been created. - :paramtype is_ledger_on: bool - """ - super().__init__(**kwargs) - self.tags = tags - self.collation = collation - self.status: Optional[Union[str, "_models.ManagedDatabaseStatus"]] = None - self.creation_date: Optional[datetime.datetime] = None - self.earliest_restore_point: Optional[datetime.datetime] = None - self.restore_point_in_time = restore_point_in_time - self.default_secondary_location: Optional[str] = None - self.catalog_collation = catalog_collation - self.create_mode = create_mode - self.storage_container_uri = storage_container_uri - self.source_database_id = source_database_id - self.cross_subscription_source_database_id = cross_subscription_source_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.cross_subscription_restorable_dropped_database_id = cross_subscription_restorable_dropped_database_id - self.storage_container_identity = storage_container_identity - self.storage_container_sas_token = storage_container_sas_token - self.failover_group_id: Optional[str] = None - self.recoverable_database_id = recoverable_database_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.auto_complete_restore = auto_complete_restore - self.last_backup_name = last_backup_name - self.cross_subscription_target_managed_instance_id = cross_subscription_target_managed_instance_id - self.is_ledger_on = is_ledger_on - self.extended_accessibility_info: Optional["_models.ManagedDatabaseExtendedAccessibilityInfo"] = None - - -class ManagedInstance(TrackedResource): - """An Azure SQL managed instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The Azure Active Directory identity of the managed instance. - :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity - :ivar sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, - Standard-series); GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, - Premium-series memory optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM - (Business Critical, Premium-series); BC_G8IH (Business Critical, Premium-series memory - optimized). - :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 managed_instance_create_mode: Specifies the mode of database creation. - - Default: Regular instance creation. - - Restore: Creates an instance by restoring a set of backups to specific point in time. - RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: "Default" - and "PointInTimeRestore". - :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 - :ivar administrator_login_password: The administrator login password (required for managed - instance creation). - :vartype administrator_login_password: str - :ivar subnet_id: Subnet resource ID for the managed instance. - :vartype subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :ivar license_type: 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). 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: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, - 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service tier. - :vartype v_cores: int - :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. - 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_iops: 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_iops: int - :ivar storage_throughput_mbps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :vartype storage_throughput_mbps: int - :ivar memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and - maximum value depend on the number of vCores and service tier. Read more about resource limits: - https://aka.ms/mi-resource-limits-api. - :vartype memory_size_in_gb: int - :ivar collation: Collation of the managed instance. - :vartype collation: str - :ivar dns_zone: The Dns Zone that the managed instance is in. - :vartype dns_zone: str - :ivar dns_zone_partner: The resource id of another managed instance whose DNS zone this managed - instance will share after creation. - :vartype dns_zone_partner: str - :ivar public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. - :vartype public_data_endpoint_enabled: bool - :ivar source_managed_instance_id: The resource identifier of the source managed instance - associated with create operation of this instance. - :vartype source_managed_instance_id: str - :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar proxy_override: Connection type used for connecting to the instance. Known values are: - "Proxy", "Redirect", and "Default". - :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. 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 PowerShell. An example of valid timezone id is - "Pacific Standard Time" or "W. Europe Standard Time". - :vartype timezone_id: str - :ivar instance_pool_id: The Id of the instance pool this managed server belongs to. - :vartype instance_pool_id: str - :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :vartype maintenance_configuration_id: str - :ivar private_endpoint_connections: List of private endpoint connections on a managed instance. - :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] - :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - :vartype minimal_tls_version: str - :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), - Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known values are: "Geo", - "Local", "Zone", and "GeoZone". - :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups - for this instance. The options are Local (LocallyRedundantStorage), Zone - (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar zone_redundant: Whether or not the zone-redundancy is enabled. - :vartype zone_redundant: bool - :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used - by default. - :vartype primary_user_assigned_identity_id: str - :ivar key_id: A CMK URI of the key to use for encryption. - :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator can be utilized during instance - creation and for instance updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :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: Pricing model of Managed Instance. Known values are: "Regular" and - "Freemium". - :vartype pricing_model: str or ~azure.mgmt.sql.models.PricingModel - :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", "SQLServer2022", and "SQLServer2025". - :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat - :ivar requested_logical_availability_zone: Specifies the logical availability zone Managed - Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". - :vartype requested_logical_availability_zone: str or - ~azure.mgmt.sql.models.AvailabilityZoneType - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "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 = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "sku": {"key": "sku", "type": "Sku"}, - "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_iops": {"key": "properties.storageIOps", "type": "int"}, - "storage_throughput_mbps": {"key": "properties.storageThroughputMBps", "type": "int"}, - "memory_size_in_gb": {"key": "properties.memorySizeInGB", "type": "int"}, - "collation": {"key": "properties.collation", "type": "str"}, - "dns_zone": {"key": "properties.dnsZone", "type": "str"}, - "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, - "public_data_endpoint_enabled": {"key": "properties.publicDataEndpointEnabled", "type": "bool"}, - "source_managed_instance_id": {"key": "properties.sourceManagedInstanceId", "type": "str"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "proxy_override": {"key": "properties.proxyOverride", "type": "str"}, - "timezone_id": {"key": "properties.timezoneId", "type": "str"}, - "instance_pool_id": {"key": "properties.instancePoolId", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[ManagedInstancePecProperty]", - }, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "current_backup_storage_redundancy": {"key": "properties.currentBackupStorageRedundancy", "type": "str"}, - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "primary_user_assigned_identity_id": {"key": "properties.primaryUserAssignedIdentityId", "type": "str"}, - "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"}, - "requested_logical_availability_zone": {"key": "properties.requestedLogicalAvailabilityZone", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - 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_iops: Optional[int] = None, - storage_throughput_mbps: Optional[int] = None, - memory_size_in_gb: Optional[int] = None, - collation: Optional[str] = None, - dns_zone_partner: Optional[str] = None, - public_data_endpoint_enabled: Optional[bool] = None, - source_managed_instance_id: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - proxy_override: Optional[Union[str, "_models.ManagedInstanceProxyOverride"]] = None, - timezone_id: Optional[str] = None, - instance_pool_id: Optional[str] = None, - maintenance_configuration_id: Optional[str] = None, - minimal_tls_version: Optional[str] = None, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - zone_redundant: Optional[bool] = None, - primary_user_assigned_identity_id: Optional[str] = None, - key_id: Optional[str] = None, - administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = None, - service_principal: Optional["_models.ServicePrincipal"] = None, - pricing_model: Optional[Union[str, "_models.PricingModel"]] = None, - authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, - database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, - requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: The Azure Active Directory identity of the managed instance. - :paramtype identity: ~azure.mgmt.sql.models.ResourceIdentity - :keyword sku: Managed instance SKU. Allowed values for sku.name: GP_Gen5 (General Purpose, - Standard-series); GP_G8IM (General Purpose, Premium-series); GP_G8IH (General Purpose, - Premium-series memory optimized); BC_Gen5 (Business Critical, Standard-Series); BC_G8IM - (Business Critical, Premium-series); BC_G8IH (Business Critical, Premium-series memory - optimized). - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword managed_instance_create_mode: Specifies the mode of database creation. - - Default: Regular instance creation. - - Restore: Creates an instance by restoring a set of backups to specific point in time. - 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 - :keyword administrator_login_password: The administrator login password (required for managed - instance creation). - :paramtype administrator_login_password: str - :keyword subnet_id: Subnet resource ID for the managed instance. - :paramtype subnet_id: str - :keyword license_type: 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). 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: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, - 48, 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service - tier. - :paramtype v_cores: int - :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. - 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_iops: 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_iops: int - :keyword storage_throughput_mbps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :paramtype storage_throughput_mbps: int - :keyword memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum - and maximum value depend on the number of vCores and service tier. Read more about resource - limits: https://aka.ms/mi-resource-limits-api. - :paramtype memory_size_in_gb: 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 - managed instance will share after creation. - :paramtype dns_zone_partner: str - :keyword public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. - :paramtype public_data_endpoint_enabled: bool - :keyword source_managed_instance_id: The resource identifier of the source managed instance - associated with create operation of this instance. - :paramtype source_managed_instance_id: str - :keyword restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword proxy_override: Connection type used for connecting to the instance. Known values are: - "Proxy", "Redirect", and "Default". - :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. 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 PowerShell. An example of valid timezone id is - "Pacific Standard Time" or "W. Europe Standard Time". - :paramtype timezone_id: str - :keyword instance_pool_id: The Id of the instance pool this managed server belongs to. - :paramtype instance_pool_id: str - :keyword maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :paramtype maintenance_configuration_id: str - :keyword minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - :paramtype minimal_tls_version: str - :keyword requested_backup_storage_redundancy: The storage account type to be used to store - backups for this instance. The options are Local (LocallyRedundantStorage), Zone - (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword zone_redundant: Whether or not the zone-redundancy is enabled. - :paramtype zone_redundant: bool - :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be - used by default. - :paramtype primary_user_assigned_identity_id: str - :keyword key_id: A CMK URI of the key to use for encryption. - :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator can be utilized during - instance creation and for instance updates, except for the azureADOnlyAuthentication property. - To update the azureADOnlyAuthentication property, individual API must be used. - :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: Pricing model of Managed Instance. Known values are: "Regular" and - "Freemium". - :paramtype pricing_model: str or ~azure.mgmt.sql.models.PricingModel - :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", "SQLServer2022", and "SQLServer2025". - :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat - :keyword requested_logical_availability_zone: Specifies the logical availability zone Managed - Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". - :paramtype requested_logical_availability_zone: str or - ~azure.mgmt.sql.models.AvailabilityZoneType - """ - super().__init__(location=location, tags=tags, **kwargs) - self.identity = identity - self.sku = sku - self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None - self.managed_instance_create_mode = managed_instance_create_mode - self.fully_qualified_domain_name: Optional[str] = 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: Optional[str] = None - self.license_type = license_type - self.hybrid_secondary_usage = hybrid_secondary_usage - self.hybrid_secondary_usage_detected: Optional[Union[str, "_models.HybridSecondaryUsageDetected"]] = None - self.v_cores = v_cores - self.storage_size_in_gb = storage_size_in_gb - self.storage_iops = storage_iops - self.storage_throughput_mbps = storage_throughput_mbps - self.memory_size_in_gb = memory_size_in_gb - self.collation = collation - self.dns_zone: Optional[str] = None - self.dns_zone_partner = dns_zone_partner - self.public_data_endpoint_enabled = public_data_endpoint_enabled - self.source_managed_instance_id = source_managed_instance_id - self.restore_point_in_time = restore_point_in_time - self.proxy_override = proxy_override - self.timezone_id = timezone_id - self.instance_pool_id = instance_pool_id - self.maintenance_configuration_id = maintenance_configuration_id - self.private_endpoint_connections: Optional[list["_models.ManagedInstancePecProperty"]] = None - self.minimal_tls_version = minimal_tls_version - self.current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - self.zone_redundant = zone_redundant - self.primary_user_assigned_identity_id = primary_user_assigned_identity_id - self.key_id = key_id - self.administrators = administrators - self.service_principal = service_principal - self.virtual_cluster_id: Optional[str] = None - self.external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = None - self.pricing_model = pricing_model - self.create_time: Optional[datetime.datetime] = None - self.authentication_metadata = authentication_metadata - self.database_format = database_format - self.requested_logical_availability_zone = requested_logical_availability_zone - - -class ManagedInstanceAdministrator(ProxyResource): - """An Azure SQL managed instance administrator. - - 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 administrator_type: Type of the managed instance administrator. "ActiveDirectory" - :vartype administrator_type: str or ~azure.mgmt.sql.models.ManagedInstanceAdministratorType - :ivar login: Login name of the managed instance administrator. - :vartype login: str - :ivar sid: SID (object ID) of the managed instance administrator. - :vartype sid: str - :ivar tenant_id: Tenant ID of the managed instance administrator. - :vartype tenant_id: str - """ - - _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"}, - "administrator_type": {"key": "properties.administratorType", "type": "str"}, - "login": {"key": "properties.login", "type": "str"}, - "sid": {"key": "properties.sid", "type": "str"}, - "tenant_id": {"key": "properties.tenantId", "type": "str"}, - } - - def __init__( - self, - *, - administrator_type: Optional[Union[str, "_models.ManagedInstanceAdministratorType"]] = None, - login: Optional[str] = None, - sid: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword administrator_type: Type of the managed instance administrator. "ActiveDirectory" - :paramtype administrator_type: str or ~azure.mgmt.sql.models.ManagedInstanceAdministratorType - :keyword login: Login name of the managed instance administrator. - :paramtype login: str - :keyword sid: SID (object ID) of the managed instance administrator. - :paramtype sid: str - :keyword tenant_id: Tenant ID of the managed instance administrator. - :paramtype tenant_id: str - """ - super().__init__(**kwargs) - self.administrator_type = administrator_type - self.login = login - self.sid = sid - self.tenant_id = tenant_id - - -class ManagedInstanceAdministratorListResult(_serialization.Model): - """A list of managed instance administrators. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceAdministrator]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceAdministrator"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceAdvancedThreatProtection(ProxyResource): - """A managed instance Advanced Threat Protection. - - 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 system_data: SystemData of AdvancedThreatProtectionResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.AdvancedThreatProtectionState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.creation_time: Optional[datetime.datetime] = None - - -class ManagedInstanceAdvancedThreatProtectionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the managed instance's Advanced Threat Protection settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceAdvancedThreatProtection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceAdvancedThreatProtection"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceAzureADOnlyAuthentication(ProxyResource): - """Azure Active Directory only authentication. - - 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 azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :vartype azure_ad_only_authentication: bool - """ - - _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"}, - "azure_ad_only_authentication": {"key": "properties.azureADOnlyAuthentication", "type": "bool"}, - } - - def __init__(self, *, azure_ad_only_authentication: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :paramtype azure_ad_only_authentication: bool - """ - super().__init__(**kwargs) - self.azure_ad_only_authentication = azure_ad_only_authentication - - -class ManagedInstanceAzureADOnlyAuthListResult(_serialization.Model): - """A list of active directory only authentications. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceAzureADOnlyAuthentication]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceAzureADOnlyAuthentication"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceDtc(ProxyResource): - """SQL Managed Instance DTC. - - 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 dtc_enabled: Active status of managed instance DTC. - :vartype dtc_enabled: bool - :ivar security_settings: Security settings of managed instance DTC. - :vartype security_settings: ~azure.mgmt.sql.models.ManagedInstanceDtcSecuritySettings - :ivar external_dns_suffix_search_list: External dns suffix search list of managed instance DTC. - :vartype external_dns_suffix_search_list: list[str] - :ivar dtc_host_name_dns_suffix: Host name dns suffix of managed instance DTC. - :vartype dtc_host_name_dns_suffix: str - :ivar provisioning_state: Provisioning state of managed instance DTC. Known values are: - "Created", "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "dtc_host_name_dns_suffix": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "dtc_enabled": {"key": "properties.dtcEnabled", "type": "bool"}, - "security_settings": {"key": "properties.securitySettings", "type": "ManagedInstanceDtcSecuritySettings"}, - "external_dns_suffix_search_list": {"key": "properties.externalDnsSuffixSearchList", "type": "[str]"}, - "dtc_host_name_dns_suffix": {"key": "properties.dtcHostNameDnsSuffix", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - dtc_enabled: Optional[bool] = None, - security_settings: Optional["_models.ManagedInstanceDtcSecuritySettings"] = None, - external_dns_suffix_search_list: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword dtc_enabled: Active status of managed instance DTC. - :paramtype dtc_enabled: bool - :keyword security_settings: Security settings of managed instance DTC. - :paramtype security_settings: ~azure.mgmt.sql.models.ManagedInstanceDtcSecuritySettings - :keyword external_dns_suffix_search_list: External dns suffix search list of managed instance - DTC. - :paramtype external_dns_suffix_search_list: list[str] - """ - super().__init__(**kwargs) - self.dtc_enabled = dtc_enabled - self.security_settings = security_settings - self.external_dns_suffix_search_list = external_dns_suffix_search_list - self.dtc_host_name_dns_suffix: Optional[str] = None - self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None - - -class ManagedInstanceDtcListResult(_serialization.Model): - """A list of managed instance's DTCs. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceDtc] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceDtc]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceDtc"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceDtcSecuritySettings(_serialization.Model): - """The Security Settings of managed instance DTC. - - :ivar transaction_manager_communication_settings: Transaction Manager communication settings of - managed instance DTC. - :vartype transaction_manager_communication_settings: - ~azure.mgmt.sql.models.ManagedInstanceDtcTransactionManagerCommunicationSettings - :ivar xa_transactions_enabled: Allow XA Transactions to managed instance DTC. - :vartype xa_transactions_enabled: bool - :ivar sna_lu6_point2_transactions_enabled: Allow SNA LU 6.2 Transactions to managed instance - DTC. - :vartype sna_lu6_point2_transactions_enabled: bool - :ivar xa_transactions_default_timeout: Default timeout for XA Transactions (in seconds). - :vartype xa_transactions_default_timeout: int - :ivar xa_transactions_maximum_timeout: Maximum timeout for XA Transactions (in seconds). - :vartype xa_transactions_maximum_timeout: int - """ - - _attribute_map = { - "transaction_manager_communication_settings": { - "key": "transactionManagerCommunicationSettings", - "type": "ManagedInstanceDtcTransactionManagerCommunicationSettings", - }, - "xa_transactions_enabled": {"key": "xaTransactionsEnabled", "type": "bool"}, - "sna_lu6_point2_transactions_enabled": {"key": "snaLu6point2TransactionsEnabled", "type": "bool"}, - "xa_transactions_default_timeout": {"key": "xaTransactionsDefaultTimeout", "type": "int"}, - "xa_transactions_maximum_timeout": {"key": "xaTransactionsMaximumTimeout", "type": "int"}, - } - - def __init__( - self, - *, - transaction_manager_communication_settings: Optional[ - "_models.ManagedInstanceDtcTransactionManagerCommunicationSettings" - ] = None, - xa_transactions_enabled: Optional[bool] = None, - sna_lu6_point2_transactions_enabled: Optional[bool] = None, - xa_transactions_default_timeout: Optional[int] = None, - xa_transactions_maximum_timeout: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword transaction_manager_communication_settings: Transaction Manager communication settings - of managed instance DTC. - :paramtype transaction_manager_communication_settings: - ~azure.mgmt.sql.models.ManagedInstanceDtcTransactionManagerCommunicationSettings - :keyword xa_transactions_enabled: Allow XA Transactions to managed instance DTC. - :paramtype xa_transactions_enabled: bool - :keyword sna_lu6_point2_transactions_enabled: Allow SNA LU 6.2 Transactions to managed instance - DTC. - :paramtype sna_lu6_point2_transactions_enabled: bool - :keyword xa_transactions_default_timeout: Default timeout for XA Transactions (in seconds). - :paramtype xa_transactions_default_timeout: int - :keyword xa_transactions_maximum_timeout: Maximum timeout for XA Transactions (in seconds). - :paramtype xa_transactions_maximum_timeout: int - """ - super().__init__(**kwargs) - self.transaction_manager_communication_settings = transaction_manager_communication_settings - self.xa_transactions_enabled = xa_transactions_enabled - self.sna_lu6_point2_transactions_enabled = sna_lu6_point2_transactions_enabled - self.xa_transactions_default_timeout = xa_transactions_default_timeout - self.xa_transactions_maximum_timeout = xa_transactions_maximum_timeout - - -class ManagedInstanceDtcTransactionManagerCommunicationSettings(_serialization.Model): # pylint: disable=name-too-long - """The Transaction Manager Communication Settings of managed instance DTC. - - :ivar allow_inbound_enabled: Allow Inbound traffic to managed instance DTC. - :vartype allow_inbound_enabled: bool - :ivar allow_outbound_enabled: Allow Outbound traffic of managed instance DTC. - :vartype allow_outbound_enabled: bool - :ivar authentication: Authentication type of managed instance DTC. - :vartype authentication: str - """ - - _attribute_map = { - "allow_inbound_enabled": {"key": "allowInboundEnabled", "type": "bool"}, - "allow_outbound_enabled": {"key": "allowOutboundEnabled", "type": "bool"}, - "authentication": {"key": "authentication", "type": "str"}, - } - - def __init__( - self, - *, - allow_inbound_enabled: Optional[bool] = None, - allow_outbound_enabled: Optional[bool] = None, - authentication: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword allow_inbound_enabled: Allow Inbound traffic to managed instance DTC. - :paramtype allow_inbound_enabled: bool - :keyword allow_outbound_enabled: Allow Outbound traffic of managed instance DTC. - :paramtype allow_outbound_enabled: bool - :keyword authentication: Authentication type of managed instance DTC. - :paramtype authentication: str - """ - super().__init__(**kwargs) - self.allow_inbound_enabled = allow_inbound_enabled - self.allow_outbound_enabled = allow_outbound_enabled - self.authentication = authentication - - -class ManagedInstanceEditionCapability(_serialization.Model): - """The managed server capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The managed server version name. - :vartype 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 supported_families: The supported families. - :vartype supported_families: list[~azure.mgmt.sql.models.ManagedInstanceFamilyCapability] - :ivar supported_storage_capabilities: The list of supported storage capabilities for this - edition. - :vartype supported_storage_capabilities: list[~azure.mgmt.sql.models.StorageCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "is_general_purpose_v2": {"readonly": True}, - "supported_families": {"readonly": True}, - "supported_storage_capabilities": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "is_general_purpose_v2": {"key": "isGeneralPurposeV2", "type": "bool"}, - "supported_families": {"key": "supportedFamilies", "type": "[ManagedInstanceFamilyCapability]"}, - "supported_storage_capabilities": {"key": "supportedStorageCapabilities", "type": "[StorageCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.is_general_purpose_v2: Optional[bool] = None - self.supported_families: Optional[list["_models.ManagedInstanceFamilyCapability"]] = None - self.supported_storage_capabilities: Optional[list["_models.StorageCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ManagedInstanceEncryptionProtector(ProxyResource): - """The managed instance encryption protector. - - 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 kind: Kind of encryption protector. This is metadata used for the Azure portal - experience. - :vartype kind: str - :ivar server_key_name: The name of the managed instance key. - :vartype server_key_name: str - :ivar server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - Known values are: "ServiceManaged" and "AzureKeyVault". - :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :ivar uri: The URI of the server key. - :vartype uri: str - :ivar thumbprint: Thumbprint of the server key. - :vartype thumbprint: str - :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :vartype auto_rotation_enabled: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "uri": {"readonly": True}, - "thumbprint": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "server_key_name": {"key": "properties.serverKeyName", "type": "str"}, - "server_key_type": {"key": "properties.serverKeyType", "type": "str"}, - "uri": {"key": "properties.uri", "type": "str"}, - "thumbprint": {"key": "properties.thumbprint", "type": "str"}, - "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - server_key_name: Optional[str] = None, - server_key_type: Optional[Union[str, "_models.ServerKeyType"]] = None, - auto_rotation_enabled: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword server_key_name: The name of the managed instance key. - :paramtype server_key_name: str - :keyword server_key_type: The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. - Known values are: "ServiceManaged" and "AzureKeyVault". - :paramtype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :keyword auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :paramtype auto_rotation_enabled: bool - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.server_key_name = server_key_name - self.server_key_type = server_key_type - self.uri: Optional[str] = None - self.thumbprint: Optional[str] = None - self.auto_rotation_enabled = auto_rotation_enabled - - -class ManagedInstanceEncryptionProtectorListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of managed instance encryption protectors. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceEncryptionProtector]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceEncryptionProtector"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceExternalAdministrator(_serialization.Model): - """Properties of a active directory administrator. - - :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" - :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :ivar principal_type: Principal Type of the sever administrator. Known values are: "User", - "Group", and "Application". - :vartype principal_type: str or ~azure.mgmt.sql.models.PrincipalType - :ivar login: Login name of the server administrator. - :vartype login: str - :ivar sid: SID (object ID) of the server administrator. - :vartype sid: str - :ivar tenant_id: Tenant ID of the administrator. - :vartype tenant_id: str - :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :vartype azure_ad_only_authentication: bool - """ - - _attribute_map = { - "administrator_type": {"key": "administratorType", "type": "str"}, - "principal_type": {"key": "principalType", "type": "str"}, - "login": {"key": "login", "type": "str"}, - "sid": {"key": "sid", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "azure_ad_only_authentication": {"key": "azureADOnlyAuthentication", "type": "bool"}, - } - - def __init__( - self, - *, - administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, - principal_type: Optional[Union[str, "_models.PrincipalType"]] = None, - login: Optional[str] = None, - sid: Optional[str] = None, - tenant_id: Optional[str] = None, - azure_ad_only_authentication: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword administrator_type: Type of the sever administrator. "ActiveDirectory" - :paramtype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :keyword principal_type: Principal Type of the sever administrator. Known values are: "User", - "Group", and "Application". - :paramtype principal_type: str or ~azure.mgmt.sql.models.PrincipalType - :keyword login: Login name of the server administrator. - :paramtype login: str - :keyword sid: SID (object ID) of the server administrator. - :paramtype sid: str - :keyword tenant_id: Tenant ID of the administrator. - :paramtype tenant_id: str - :keyword azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :paramtype azure_ad_only_authentication: bool - """ - super().__init__(**kwargs) - self.administrator_type = administrator_type - self.principal_type = principal_type - self.login = login - self.sid = sid - self.tenant_id = tenant_id - self.azure_ad_only_authentication = azure_ad_only_authentication - - -class ManagedInstanceFamilyCapability(_serialization.Model): - """The managed server family capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Family name. - :vartype name: str - :ivar sku: SKU name. - :vartype sku: str - :ivar zone_redundant: Whether or not zone redundancy is supported for the family. - :vartype zone_redundant: bool - :ivar supported_license_types: List of supported license types. - :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] - :ivar supported_vcores_values: List of supported virtual cores values. - :vartype supported_vcores_values: list[~azure.mgmt.sql.models.ManagedInstanceVcoresCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "sku": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "supported_license_types": {"readonly": True}, - "supported_vcores_values": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "sku": {"key": "sku", "type": "str"}, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "supported_license_types": {"key": "supportedLicenseTypes", "type": "[LicenseTypeCapability]"}, - "supported_vcores_values": {"key": "supportedVcoresValues", "type": "[ManagedInstanceVcoresCapability]"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.sku: Optional[str] = None - self.zone_redundant: Optional[bool] = None - self.supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = None - self.supported_vcores_values: Optional[list["_models.ManagedInstanceVcoresCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ManagedInstanceKey(ProxyResource): - """A managed instance key. - - 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 kind: Kind of encryption protector. This is metadata used for the Azure portal - experience. - :vartype kind: str - :ivar server_key_type: The key type like 'ServiceManaged', 'AzureKeyVault'. Known values are: - "ServiceManaged" and "AzureKeyVault". - :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :ivar uri: The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is required. - :vartype uri: str - :ivar thumbprint: Thumbprint of the key. - :vartype thumbprint: str - :ivar creation_date: The key creation date. - :vartype creation_date: ~datetime.datetime - :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :vartype auto_rotation_enabled: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "thumbprint": {"readonly": True}, - "creation_date": {"readonly": True}, - "auto_rotation_enabled": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "server_key_type": {"key": "properties.serverKeyType", "type": "str"}, - "uri": {"key": "properties.uri", "type": "str"}, - "thumbprint": {"key": "properties.thumbprint", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, - } - - def __init__( - self, - *, - server_key_type: Optional[Union[str, "_models.ServerKeyType"]] = None, - uri: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword server_key_type: The key type like 'ServiceManaged', 'AzureKeyVault'. Known values - are: "ServiceManaged" and "AzureKeyVault". - :paramtype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :keyword uri: The URI of the key. If the ServerKeyType is AzureKeyVault, then the URI is - required. - :paramtype uri: str - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.server_key_type = server_key_type - self.uri = uri - self.thumbprint: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.auto_rotation_enabled: Optional[bool] = None - - -class ManagedInstanceKeyListResult(_serialization.Model): - """A list of managed instance keys. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceKey] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceKey]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceKey"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceListResult(_serialization.Model): - """A list of managed instances. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstance] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstance]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstance"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceLongTermRetentionBackup(ProxyResource): - """A long term retention backup for a managed database. - - 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 managed_instance_name: The managed instance that the backup database belongs to. - :vartype managed_instance_name: str - :ivar managed_instance_create_time: The create time of the instance. - :vartype managed_instance_create_time: ~datetime.datetime - :ivar database_name: The name of the database the backup belong to. - :vartype database_name: str - :ivar database_deletion_time: The delete time of the database. - :vartype database_deletion_time: ~datetime.datetime - :ivar backup_time: The time the backup was taken. - :vartype backup_time: ~datetime.datetime - :ivar backup_expiration_time: The time the long term retention backup will expire. - :vartype backup_expiration_time: ~datetime.datetime - :ivar backup_storage_redundancy: The storage redundancy type of the backup. Known values are: - "Geo", "Local", "Zone", and "GeoZone". - :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar backup_storage_access_tier: The BackupStorageAccessTier for the LTR backup. Known values - are: "Hot" and "Archive". - :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "managed_instance_name": {"readonly": True}, - "managed_instance_create_time": {"readonly": True}, - "database_name": {"readonly": True}, - "database_deletion_time": {"readonly": True}, - "backup_time": {"readonly": True}, - "backup_expiration_time": {"readonly": True}, - "backup_storage_redundancy": {"readonly": True}, - "backup_storage_access_tier": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "managed_instance_name": {"key": "properties.managedInstanceName", "type": "str"}, - "managed_instance_create_time": {"key": "properties.managedInstanceCreateTime", "type": "iso-8601"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "database_deletion_time": {"key": "properties.databaseDeletionTime", "type": "iso-8601"}, - "backup_time": {"key": "properties.backupTime", "type": "iso-8601"}, - "backup_expiration_time": {"key": "properties.backupExpirationTime", "type": "iso-8601"}, - "backup_storage_redundancy": {"key": "properties.backupStorageRedundancy", "type": "str"}, - "backup_storage_access_tier": {"key": "properties.backupStorageAccessTier", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.managed_instance_name: Optional[str] = None - self.managed_instance_create_time: Optional[datetime.datetime] = None - self.database_name: Optional[str] = None - self.database_deletion_time: Optional[datetime.datetime] = None - self.backup_time: Optional[datetime.datetime] = None - self.backup_expiration_time: Optional[datetime.datetime] = None - self.backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None - - -class ManagedInstanceLongTermRetentionBackupListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of long term retention backups for managed database(s). - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceLongTermRetentionBackup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceLongTermRetentionBackup"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceLongTermRetentionPolicy(ProxyResource): - """A long term retention policy. - - 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 backup_storage_access_tier: The BackupStorageAccessTier for the LTR backups. Known values - are: "Hot" and "Archive". - :vartype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier - :ivar weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. - :vartype weekly_retention: str - :ivar monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 format. - :vartype monthly_retention: str - :ivar yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. - :vartype yearly_retention: str - :ivar week_of_year: The week of year to take the yearly backup in an ISO 8601 format. - :vartype week_of_year: int - """ - - _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"}, - "backup_storage_access_tier": {"key": "properties.backupStorageAccessTier", "type": "str"}, - "weekly_retention": {"key": "properties.weeklyRetention", "type": "str"}, - "monthly_retention": {"key": "properties.monthlyRetention", "type": "str"}, - "yearly_retention": {"key": "properties.yearlyRetention", "type": "str"}, - "week_of_year": {"key": "properties.weekOfYear", "type": "int"}, - } - - def __init__( - self, - *, - backup_storage_access_tier: Optional[Union[str, "_models.BackupStorageAccessTier"]] = None, - weekly_retention: Optional[str] = None, - monthly_retention: Optional[str] = None, - yearly_retention: Optional[str] = None, - week_of_year: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_storage_access_tier: The BackupStorageAccessTier for the LTR backups. Known - values are: "Hot" and "Archive". - :paramtype backup_storage_access_tier: str or ~azure.mgmt.sql.models.BackupStorageAccessTier - :keyword weekly_retention: The weekly retention policy for an LTR backup in an ISO 8601 format. - :paramtype weekly_retention: str - :keyword monthly_retention: The monthly retention policy for an LTR backup in an ISO 8601 - format. - :paramtype monthly_retention: str - :keyword yearly_retention: The yearly retention policy for an LTR backup in an ISO 8601 format. - :paramtype yearly_retention: str - :keyword week_of_year: The week of year to take the yearly backup in an ISO 8601 format. - :paramtype week_of_year: int - """ - super().__init__(**kwargs) - self.backup_storage_access_tier = backup_storage_access_tier - self.weekly_retention = weekly_retention - self.monthly_retention = monthly_retention - self.yearly_retention = yearly_retention - self.week_of_year = week_of_year - - -class ManagedInstanceLongTermRetentionPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of long term retention policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceLongTermRetentionPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceLongTermRetentionPolicy"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceMaintenanceConfigurationCapability(_serialization.Model): # pylint: disable=name-too-long - """The maintenance configuration capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Maintenance configuration name. - :vartype name: str - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ManagedInstanceOperation(ProxyResource): - """A managed instance operation. - - 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 managed_instance_name: The name of the managed instance the operation is being performed - on. - :vartype managed_instance_name: str - :ivar operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", - "Failed", "CancelInProgress", and "Cancelled". - :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - :ivar operation_parameters: The operation parameters. - :vartype operation_parameters: ~azure.mgmt.sql.models.ManagedInstanceOperationParametersPair - :ivar operation_steps: The operation steps. - :vartype operation_steps: ~azure.mgmt.sql.models.ManagedInstanceOperationSteps - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "managed_instance_name": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - "operation_parameters": {"readonly": True}, - "operation_steps": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "managed_instance_name": {"key": "properties.managedInstanceName", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - "operation_parameters": { - "key": "properties.operationParameters", - "type": "ManagedInstanceOperationParametersPair", - }, - "operation_steps": {"key": "properties.operationSteps", "type": "ManagedInstanceOperationSteps"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.managed_instance_name: Optional[str] = None - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.percent_complete: Optional[int] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.is_user_error: Optional[bool] = None - self.estimated_completion_time: Optional[datetime.datetime] = None - self.description: Optional[str] = None - self.is_cancellable: Optional[bool] = None - self.operation_parameters: Optional["_models.ManagedInstanceOperationParametersPair"] = None - self.operation_steps: Optional["_models.ManagedInstanceOperationSteps"] = None - - -class ManagedInstanceOperationListResult(_serialization.Model): - """The response to a list managed instance operations request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceOperation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceOperation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceOperation"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceOperationParametersPair(_serialization.Model): - """The parameters of a managed instance operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar current_parameters: The current parameters. - :vartype current_parameters: ~azure.mgmt.sql.models.UpsertManagedServerOperationParameters - :ivar requested_parameters: The requested parameters. - :vartype requested_parameters: ~azure.mgmt.sql.models.UpsertManagedServerOperationParameters - """ - - _validation = { - "current_parameters": {"readonly": True}, - "requested_parameters": {"readonly": True}, - } - - _attribute_map = { - "current_parameters": {"key": "currentParameters", "type": "UpsertManagedServerOperationParameters"}, - "requested_parameters": {"key": "requestedParameters", "type": "UpsertManagedServerOperationParameters"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.current_parameters: Optional["_models.UpsertManagedServerOperationParameters"] = None - self.requested_parameters: Optional["_models.UpsertManagedServerOperationParameters"] = None - - -class ManagedInstanceOperationSteps(_serialization.Model): - """The steps of a managed instance operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar total_steps: The total number of operation steps. - :vartype total_steps: str - :ivar current_step: The number of current operation steps. - :vartype current_step: int - :ivar steps_list: The operation steps list. - :vartype steps_list: - list[~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDuration] - """ - - _validation = { - "total_steps": {"readonly": True}, - "current_step": {"readonly": True}, - "steps_list": {"readonly": True}, - } - - _attribute_map = { - "total_steps": {"key": "totalSteps", "type": "str"}, - "current_step": {"key": "currentStep", "type": "int"}, - "steps_list": {"key": "stepsList", "type": "[UpsertManagedServerOperationStepWithEstimatesAndDuration]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.total_steps: Optional[str] = None - self.current_step: Optional[int] = None - self.steps_list: Optional[list["_models.UpsertManagedServerOperationStepWithEstimatesAndDuration"]] = None - - -class ManagedInstancePairInfo(_serialization.Model): - """Pairs of Managed Instances in the failover group. - - :ivar primary_managed_instance_id: Id of Primary Managed Instance in pair. - :vartype primary_managed_instance_id: str - :ivar partner_managed_instance_id: Id of Partner Managed Instance in pair. - :vartype partner_managed_instance_id: str - """ - - _attribute_map = { - "primary_managed_instance_id": {"key": "primaryManagedInstanceId", "type": "str"}, - "partner_managed_instance_id": {"key": "partnerManagedInstanceId", "type": "str"}, - } - - def __init__( - self, - *, - primary_managed_instance_id: Optional[str] = None, - partner_managed_instance_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword primary_managed_instance_id: Id of Primary Managed Instance in pair. - :paramtype primary_managed_instance_id: str - :keyword partner_managed_instance_id: Id of Partner Managed Instance in pair. - :paramtype partner_managed_instance_id: str - """ - super().__init__(**kwargs) - self.primary_managed_instance_id = primary_managed_instance_id - self.partner_managed_instance_id = partner_managed_instance_id - - -class ManagedInstancePecProperty(_serialization.Model): - """A private endpoint connection under a managed instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar properties: Private endpoint connection properties. - :vartype properties: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionProperties - """ - - _validation = { - "id": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "properties": {"key": "properties", "type": "ManagedInstancePrivateEndpointConnectionProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.properties: Optional["_models.ManagedInstancePrivateEndpointConnectionProperties"] = None - - -class ManagedInstancePrivateEndpointConnection(ProxyResource): - """A private endpoint connection. - - 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 private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty - :ivar private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the Private Endpoint Connection. - :vartype provisioning_state: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "ManagedInstancePrivateEndpointProperty"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "ManagedInstancePrivateLinkServiceConnectionStateProperty", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.ManagedInstancePrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional[ - "_models.ManagedInstancePrivateLinkServiceConnectionStateProperty" - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: Private endpoint which the connection belongs to. - :paramtype private_endpoint: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty - :keyword private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty - """ - super().__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state: Optional[str] = None - - -class ManagedInstancePrivateEndpointConnectionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of private endpoint connections. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstancePrivateEndpointConnection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstancePrivateEndpointConnection"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstancePrivateEndpointConnectionProperties(_serialization.Model): # pylint: disable=name-too-long - """Properties of a private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty - :ivar private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the Private Endpoint Connection. - :vartype provisioning_state: str - """ - - _validation = { - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "private_endpoint": {"key": "privateEndpoint", "type": "ManagedInstancePrivateEndpointProperty"}, - "private_link_service_connection_state": { - "key": "privateLinkServiceConnectionState", - "type": "ManagedInstancePrivateLinkServiceConnectionStateProperty", - }, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.ManagedInstancePrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional[ - "_models.ManagedInstancePrivateLinkServiceConnectionStateProperty" - ] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: Private endpoint which the connection belongs to. - :paramtype private_endpoint: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty - :keyword private_link_service_connection_state: Connection State of the Private Endpoint - Connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty - """ - super().__init__(**kwargs) - self.private_endpoint = private_endpoint - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state: Optional[str] = None - - -class ManagedInstancePrivateEndpointProperty(_serialization.Model): - """ManagedInstancePrivateEndpointProperty. - - :ivar id: Resource id of the private endpoint. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource id of the private endpoint. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class ManagedInstancePrivateLink(ProxyResource): - """A private link 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 properties: The private link resource group id. - :vartype properties: ~azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "ManagedInstancePrivateLinkProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.properties: Optional["_models.ManagedInstancePrivateLinkProperties"] = None - - -class ManagedInstancePrivateLinkListResult(_serialization.Model): - """A list of private link resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstancePrivateLink] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstancePrivateLink]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstancePrivateLink"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstancePrivateLinkProperties(_serialization.Model): - """Properties of a private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource required zone names. - :vartype required_zone_names: list[str] - """ - - _validation = { - "group_id": {"readonly": True}, - "required_members": {"readonly": True}, - "required_zone_names": {"readonly": True}, - } - - _attribute_map = { - "group_id": {"key": "groupId", "type": "str"}, - "required_members": {"key": "requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "requiredZoneNames", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.group_id: Optional[str] = None - self.required_members: Optional[list[str]] = None - self.required_zone_names: Optional[list[str]] = None - - -class ManagedInstancePrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long - """ManagedInstancePrivateLinkServiceConnectionStateProperty. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar status: The private link service connection status. Required. - :vartype status: str - :ivar description: The private link service connection description. Required. - :vartype description: str - :ivar actions_required: The private link service connection description. - :vartype actions_required: str - """ - - _validation = { - "status": {"required": True}, - "description": {"required": True}, - "actions_required": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, - } - - def __init__(self, *, status: str, description: str, **kwargs: Any) -> None: - """ - :keyword status: The private link service connection status. Required. - :paramtype status: str - :keyword description: The private link service connection description. Required. - :paramtype description: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required: Optional[str] = None - - -class ManagedInstanceQuery(ProxyResource): - """Database query. - - 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 query_text: Query text. - :vartype query_text: str - """ - - _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"}, - "query_text": {"key": "properties.queryText", "type": "str"}, - } - - def __init__(self, *, query_text: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword query_text: Query text. - :paramtype query_text: str - """ - super().__init__(**kwargs) - self.query_text = query_text - - -class ManagedInstanceQueryStatistics(_serialization.Model): - """Execution statistics for one particular query. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.QueryStatistics] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[QueryStatistics]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.QueryStatistics"]] = None - self.next_link: Optional[str] = None - - -class ManagedInstanceUpdate(_serialization.Model): - """An update request for an Azure SQL Database managed instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sku: Managed instance sku. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar identity: Managed instance identity. - :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 managed_instance_create_mode: Specifies the mode of database creation. - - Default: Regular instance creation. - - Restore: Creates an instance by restoring a set of backups to specific point in time. - RestorePointInTime and SourceManagedInstanceId must be specified. Known values are: "Default" - and "PointInTimeRestore". - :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 - :ivar administrator_login_password: The administrator login password (required for managed - instance creation). - :vartype administrator_login_password: str - :ivar subnet_id: Subnet resource ID for the managed instance. - :vartype subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :ivar license_type: 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). 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: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, - 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service tier. - :vartype v_cores: int - :ivar storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. - 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_iops: 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_iops: int - :ivar storage_throughput_mbps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :vartype storage_throughput_mbps: int - :ivar memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum and - maximum value depend on the number of vCores and service tier. Read more about resource limits: - https://aka.ms/mi-resource-limits-api. - :vartype memory_size_in_gb: int - :ivar collation: Collation of the managed instance. - :vartype collation: str - :ivar dns_zone: The Dns Zone that the managed instance is in. - :vartype dns_zone: str - :ivar dns_zone_partner: The resource id of another managed instance whose DNS zone this managed - instance will share after creation. - :vartype dns_zone_partner: str - :ivar public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. - :vartype public_data_endpoint_enabled: bool - :ivar source_managed_instance_id: The resource identifier of the source managed instance - associated with create operation of this instance. - :vartype source_managed_instance_id: str - :ivar restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :vartype restore_point_in_time: ~datetime.datetime - :ivar proxy_override: Connection type used for connecting to the instance. Known values are: - "Proxy", "Redirect", and "Default". - :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. 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 PowerShell. An example of valid timezone id is - "Pacific Standard Time" or "W. Europe Standard Time". - :vartype timezone_id: str - :ivar instance_pool_id: The Id of the instance pool this managed server belongs to. - :vartype instance_pool_id: str - :ivar maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :vartype maintenance_configuration_id: str - :ivar private_endpoint_connections: List of private endpoint connections on a managed instance. - :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] - :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - :vartype minimal_tls_version: str - :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), - Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known values are: "Geo", - "Local", "Zone", and "GeoZone". - :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar requested_backup_storage_redundancy: The storage account type to be used to store backups - for this instance. The options are Local (LocallyRedundantStorage), Zone - (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar zone_redundant: Whether or not the zone-redundancy is enabled. - :vartype zone_redundant: bool - :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used - by default. - :vartype primary_user_assigned_identity_id: str - :ivar key_id: A CMK URI of the key to use for encryption. - :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator can be utilized during instance - creation and for instance updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :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: Pricing model of Managed Instance. Known values are: "Regular" and - "Freemium". - :vartype pricing_model: str or ~azure.mgmt.sql.models.PricingModel - :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", "SQLServer2022", and "SQLServer2025". - :vartype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat - :ivar requested_logical_availability_zone: Specifies the logical availability zone Managed - Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". - :vartype requested_logical_availability_zone: str or - ~azure.mgmt.sql.models.AvailabilityZoneType - """ - - _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 = { - "sku": {"key": "sku", "type": "Sku"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "tags": {"key": "tags", "type": "{str}"}, - "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_iops": {"key": "properties.storageIOps", "type": "int"}, - "storage_throughput_mbps": {"key": "properties.storageThroughputMBps", "type": "int"}, - "memory_size_in_gb": {"key": "properties.memorySizeInGB", "type": "int"}, - "collation": {"key": "properties.collation", "type": "str"}, - "dns_zone": {"key": "properties.dnsZone", "type": "str"}, - "dns_zone_partner": {"key": "properties.dnsZonePartner", "type": "str"}, - "public_data_endpoint_enabled": {"key": "properties.publicDataEndpointEnabled", "type": "bool"}, - "source_managed_instance_id": {"key": "properties.sourceManagedInstanceId", "type": "str"}, - "restore_point_in_time": {"key": "properties.restorePointInTime", "type": "iso-8601"}, - "proxy_override": {"key": "properties.proxyOverride", "type": "str"}, - "timezone_id": {"key": "properties.timezoneId", "type": "str"}, - "instance_pool_id": {"key": "properties.instancePoolId", "type": "str"}, - "maintenance_configuration_id": {"key": "properties.maintenanceConfigurationId", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[ManagedInstancePecProperty]", - }, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "current_backup_storage_redundancy": {"key": "properties.currentBackupStorageRedundancy", "type": "str"}, - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - "zone_redundant": {"key": "properties.zoneRedundant", "type": "bool"}, - "primary_user_assigned_identity_id": {"key": "properties.primaryUserAssignedIdentityId", "type": "str"}, - "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"}, - "requested_logical_availability_zone": {"key": "properties.requestedLogicalAvailabilityZone", "type": "str"}, - } - - def __init__( # pylint: disable=too-many-locals - self, - *, - sku: Optional["_models.Sku"] = None, - 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_iops: Optional[int] = None, - storage_throughput_mbps: Optional[int] = None, - memory_size_in_gb: Optional[int] = None, - collation: Optional[str] = None, - dns_zone_partner: Optional[str] = None, - public_data_endpoint_enabled: Optional[bool] = None, - source_managed_instance_id: Optional[str] = None, - restore_point_in_time: Optional[datetime.datetime] = None, - proxy_override: Optional[Union[str, "_models.ManagedInstanceProxyOverride"]] = None, - timezone_id: Optional[str] = None, - instance_pool_id: Optional[str] = None, - maintenance_configuration_id: Optional[str] = None, - minimal_tls_version: Optional[str] = None, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - zone_redundant: Optional[bool] = None, - primary_user_assigned_identity_id: Optional[str] = None, - key_id: Optional[str] = None, - administrators: Optional["_models.ManagedInstanceExternalAdministrator"] = None, - service_principal: Optional["_models.ServicePrincipal"] = None, - pricing_model: Optional[Union[str, "_models.PricingModel"]] = None, - authentication_metadata: Optional[Union[str, "_models.AuthMetadataLookupModes"]] = None, - database_format: Optional[Union[str, "_models.ManagedInstanceDatabaseFormat"]] = None, - requested_logical_availability_zone: Optional[Union[str, "_models.AvailabilityZoneType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: Managed instance sku. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword identity: Managed instance identity. - :paramtype identity: ~azure.mgmt.sql.models.ResourceIdentity - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword managed_instance_create_mode: Specifies the mode of database creation. - - Default: Regular instance creation. - - Restore: Creates an instance by restoring a set of backups to specific point in time. - 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 - :keyword administrator_login_password: The administrator login password (required for managed - instance creation). - :paramtype administrator_login_password: str - :keyword subnet_id: Subnet resource ID for the managed instance. - :paramtype subnet_id: str - :keyword license_type: 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). 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: 4, 6, 8, 10, 12, 16, 20, 24, 32, 40, - 48, 56, 64, 80, 96, 128. Supported vCores depends on the selected hardware family and service - tier. - :paramtype v_cores: int - :keyword storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum value: 32768. - 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_iops: 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_iops: int - :keyword storage_throughput_mbps: Storage throughput MBps parameter is not supported in the - instance create/update operation. - :paramtype storage_throughput_mbps: int - :keyword memory_size_in_gb: Memory size in GB. Minimum value: 28. Maximum value: 870. Minimum - and maximum value depend on the number of vCores and service tier. Read more about resource - limits: https://aka.ms/mi-resource-limits-api. - :paramtype memory_size_in_gb: 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 - managed instance will share after creation. - :paramtype dns_zone_partner: str - :keyword public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. - :paramtype public_data_endpoint_enabled: bool - :keyword source_managed_instance_id: The resource identifier of the source managed instance - associated with create operation of this instance. - :paramtype source_managed_instance_id: str - :keyword restore_point_in_time: Specifies the point in time (ISO8601 format) of the source - database that will be restored to create the new database. - :paramtype restore_point_in_time: ~datetime.datetime - :keyword proxy_override: Connection type used for connecting to the instance. Known values are: - "Proxy", "Redirect", and "Default". - :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. 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 PowerShell. An example of valid timezone id is - "Pacific Standard Time" or "W. Europe Standard Time". - :paramtype timezone_id: str - :keyword instance_pool_id: The Id of the instance pool this managed server belongs to. - :paramtype instance_pool_id: str - :keyword maintenance_configuration_id: Specifies maintenance configuration id to apply to this - managed instance. - :paramtype maintenance_configuration_id: str - :keyword minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2'. - :paramtype minimal_tls_version: str - :keyword requested_backup_storage_redundancy: The storage account type to be used to store - backups for this instance. The options are Local (LocallyRedundantStorage), Zone - (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Known - values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - :keyword zone_redundant: Whether or not the zone-redundancy is enabled. - :paramtype zone_redundant: bool - :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be - used by default. - :paramtype primary_user_assigned_identity_id: str - :keyword key_id: A CMK URI of the key to use for encryption. - :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator can be utilized during - instance creation and for instance updates, except for the azureADOnlyAuthentication property. - To update the azureADOnlyAuthentication property, individual API must be used. - :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: Pricing model of Managed Instance. Known values are: "Regular" and - "Freemium". - :paramtype pricing_model: str or ~azure.mgmt.sql.models.PricingModel - :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", "SQLServer2022", and "SQLServer2025". - :paramtype database_format: str or ~azure.mgmt.sql.models.ManagedInstanceDatabaseFormat - :keyword requested_logical_availability_zone: Specifies the logical availability zone Managed - Instance is pinned to. Known values are: "NoPreference", "1", "2", and "3". - :paramtype requested_logical_availability_zone: str or - ~azure.mgmt.sql.models.AvailabilityZoneType - """ - super().__init__(**kwargs) - self.sku = sku - self.identity = identity - self.tags = tags - self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None - self.managed_instance_create_mode = managed_instance_create_mode - self.fully_qualified_domain_name: Optional[str] = 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: Optional[str] = None - self.license_type = license_type - self.hybrid_secondary_usage = hybrid_secondary_usage - self.hybrid_secondary_usage_detected: Optional[Union[str, "_models.HybridSecondaryUsageDetected"]] = None - self.v_cores = v_cores - self.storage_size_in_gb = storage_size_in_gb - self.storage_iops = storage_iops - self.storage_throughput_mbps = storage_throughput_mbps - self.memory_size_in_gb = memory_size_in_gb - self.collation = collation - self.dns_zone: Optional[str] = None - self.dns_zone_partner = dns_zone_partner - self.public_data_endpoint_enabled = public_data_endpoint_enabled - self.source_managed_instance_id = source_managed_instance_id - self.restore_point_in_time = restore_point_in_time - self.proxy_override = proxy_override - self.timezone_id = timezone_id - self.instance_pool_id = instance_pool_id - self.maintenance_configuration_id = maintenance_configuration_id - self.private_endpoint_connections: Optional[list["_models.ManagedInstancePecProperty"]] = None - self.minimal_tls_version = minimal_tls_version - self.current_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - self.zone_redundant = zone_redundant - self.primary_user_assigned_identity_id = primary_user_assigned_identity_id - self.key_id = key_id - self.administrators = administrators - self.service_principal = service_principal - self.virtual_cluster_id: Optional[str] = None - self.external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = None - self.pricing_model = pricing_model - self.create_time: Optional[datetime.datetime] = None - self.authentication_metadata = authentication_metadata - self.database_format = database_format - self.requested_logical_availability_zone = requested_logical_availability_zone - - -class ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest(_serialization.Model): # pylint: disable=name-too-long - """Validate azure key vault encryption key. - - All required parameters must be populated in order to send to server. - - :ivar tde_key_uri: The URI of the key. Required. - :vartype tde_key_uri: str - """ - - _validation = { - "tde_key_uri": {"required": True}, - } - - _attribute_map = { - "tde_key_uri": {"key": "tdeKeyUri", "type": "str"}, - } - - def __init__(self, *, tde_key_uri: str, **kwargs: Any) -> None: - """ - :keyword tde_key_uri: The URI of the key. Required. - :paramtype tde_key_uri: str - """ - super().__init__(**kwargs) - self.tde_key_uri = tde_key_uri - - -class ManagedInstanceVcoresCapability(_serialization.Model): - """The managed instance virtual cores capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The virtual cores identifier. - :vartype name: str - :ivar value: The virtual cores value. - :vartype value: int - :ivar supported_memory_limits_mb: Memory limit MB ranges. - :vartype supported_memory_limits_mb: ~azure.mgmt.sql.models.MaxLimitRangeCapability - :ivar supported_memory_sizes_in_gb: Supported memory sizes in GB. - :vartype supported_memory_sizes_in_gb: ~azure.mgmt.sql.models.MaxLimitRangeCapability - :ivar included_max_size: Included size. - :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar supported_storage_sizes: Storage size ranges. - :vartype supported_storage_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] - :ivar included_storage_i_ops: Included storage IOps. - :vartype included_storage_i_ops: int - :ivar supported_storage_i_ops: Storage IOps ranges. - :vartype supported_storage_i_ops: ~azure.mgmt.sql.models.MaxLimitRangeCapability - :ivar iops_min_value_override_factor_per_selected_storage_gb: Min IOps override factor per - selected storage GB. - :vartype iops_min_value_override_factor_per_selected_storage_gb: float - :ivar iops_included_value_override_factor_per_selected_storage_gb: Included IOps override - factor per selected storage GB. - :vartype iops_included_value_override_factor_per_selected_storage_gb: float - :ivar included_storage_throughput_m_bps: Included storage throughput MBps. - :vartype included_storage_throughput_m_bps: int - :ivar supported_storage_throughput_m_bps: Storage throughput MBps ranges. - :vartype supported_storage_throughput_m_bps: ~azure.mgmt.sql.models.MaxLimitRangeCapability - :ivar throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Min throughput MBps - override factor per selected storage GB. - :vartype throughput_m_bps_min_value_override_factor_per_selected_storage_gb: float - :ivar throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Included - throughput MBps override factor per selected storage GB. - :vartype throughput_m_bps_included_value_override_factor_per_selected_storage_gb: float - :ivar instance_pool_supported: True if this service objective is supported for managed - instances in an instance pool. - :vartype instance_pool_supported: bool - :ivar standalone_supported: True if this service objective is supported for standalone managed - instances. - :vartype standalone_supported: bool - :ivar supported_maintenance_configurations: List of supported maintenance configurations. - :vartype supported_maintenance_configurations: - list[~azure.mgmt.sql.models.ManagedInstanceMaintenanceConfigurationCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "value": {"readonly": True}, - "supported_memory_limits_mb": {"readonly": True}, - "supported_memory_sizes_in_gb": {"readonly": True}, - "included_max_size": {"readonly": True}, - "supported_storage_sizes": {"readonly": True}, - "included_storage_i_ops": {"readonly": True}, - "supported_storage_i_ops": {"readonly": True}, - "iops_min_value_override_factor_per_selected_storage_gb": {"readonly": True}, - "iops_included_value_override_factor_per_selected_storage_gb": {"readonly": True}, - "included_storage_throughput_m_bps": {"readonly": True}, - "supported_storage_throughput_m_bps": {"readonly": True}, - "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": {"readonly": True}, - "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": {"readonly": True}, - "instance_pool_supported": {"readonly": True}, - "standalone_supported": {"readonly": True}, - "supported_maintenance_configurations": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "value": {"key": "value", "type": "int"}, - "supported_memory_limits_mb": {"key": "supportedMemoryLimitsMB", "type": "MaxLimitRangeCapability"}, - "supported_memory_sizes_in_gb": {"key": "supportedMemorySizesInGB", "type": "MaxLimitRangeCapability"}, - "included_max_size": {"key": "includedMaxSize", "type": "MaxSizeCapability"}, - "supported_storage_sizes": {"key": "supportedStorageSizes", "type": "[MaxSizeRangeCapability]"}, - "included_storage_i_ops": {"key": "includedStorageIOps", "type": "int"}, - "supported_storage_i_ops": {"key": "supportedStorageIOps", "type": "MaxLimitRangeCapability"}, - "iops_min_value_override_factor_per_selected_storage_gb": { - "key": "iopsMinValueOverrideFactorPerSelectedStorageGB", - "type": "float", - }, - "iops_included_value_override_factor_per_selected_storage_gb": { - "key": "iopsIncludedValueOverrideFactorPerSelectedStorageGB", - "type": "float", - }, - "included_storage_throughput_m_bps": {"key": "includedStorageThroughputMBps", "type": "int"}, - "supported_storage_throughput_m_bps": { - "key": "supportedStorageThroughputMBps", - "type": "MaxLimitRangeCapability", - }, - "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": { - "key": "throughputMBpsMinValueOverrideFactorPerSelectedStorageGB", - "type": "float", - }, - "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": { - "key": "throughputMBpsIncludedValueOverrideFactorPerSelectedStorageGB", - "type": "float", - }, - "instance_pool_supported": {"key": "instancePoolSupported", "type": "bool"}, - "standalone_supported": {"key": "standaloneSupported", "type": "bool"}, - "supported_maintenance_configurations": { - "key": "supportedMaintenanceConfigurations", - "type": "[ManagedInstanceMaintenanceConfigurationCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.value: Optional[int] = None - self.supported_memory_limits_mb: Optional["_models.MaxLimitRangeCapability"] = None - self.supported_memory_sizes_in_gb: Optional["_models.MaxLimitRangeCapability"] = None - self.included_max_size: Optional["_models.MaxSizeCapability"] = None - self.supported_storage_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = None - self.included_storage_i_ops: Optional[int] = None - self.supported_storage_i_ops: Optional["_models.MaxLimitRangeCapability"] = None - self.iops_min_value_override_factor_per_selected_storage_gb: Optional[float] = None - self.iops_included_value_override_factor_per_selected_storage_gb: Optional[float] = None - self.included_storage_throughput_m_bps: Optional[int] = None - self.supported_storage_throughput_m_bps: Optional["_models.MaxLimitRangeCapability"] = None - self.throughput_m_bps_min_value_override_factor_per_selected_storage_gb: Optional[float] = None - self.throughput_m_bps_included_value_override_factor_per_selected_storage_gb: Optional[float] = None - self.instance_pool_supported: Optional[bool] = None - self.standalone_supported: Optional[bool] = None - self.supported_maintenance_configurations: Optional[ - list["_models.ManagedInstanceMaintenanceConfigurationCapability"] - ] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ManagedInstanceVersionCapability(_serialization.Model): - """The managed instance capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The server version name. - :vartype name: str - :ivar supported_editions: The list of supported managed instance editions. - :vartype supported_editions: list[~azure.mgmt.sql.models.ManagedInstanceEditionCapability] - :ivar supported_instance_pool_editions: The list of supported instance pool editions. - :vartype supported_instance_pool_editions: - list[~azure.mgmt.sql.models.InstancePoolEditionCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_editions": {"readonly": True}, - "supported_instance_pool_editions": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_editions": {"key": "supportedEditions", "type": "[ManagedInstanceEditionCapability]"}, - "supported_instance_pool_editions": { - "key": "supportedInstancePoolEditions", - "type": "[InstancePoolEditionCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_editions: Optional[list["_models.ManagedInstanceEditionCapability"]] = None - self.supported_instance_pool_editions: Optional[list["_models.InstancePoolEditionCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ManagedInstanceVulnerabilityAssessment(ProxyResource): - """A managed instance vulnerability assessment. - - 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 storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). - :vartype storage_container_path: str - :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to - the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' - isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not - behind a Vnet or a firewall. - :vartype storage_container_sas_key: str - :ivar storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :vartype storage_account_access_key: str - :ivar recurring_scans: The recurring scans settings. - :vartype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - - _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"}, - "storage_container_path": {"key": "properties.storageContainerPath", "type": "str"}, - "storage_container_sas_key": {"key": "properties.storageContainerSasKey", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "recurring_scans": { - "key": "properties.recurringScans", - "type": "VulnerabilityAssessmentRecurringScansProperties", - }, - } - - def __init__( - self, - *, - storage_container_path: Optional[str] = None, - storage_container_sas_key: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). - :paramtype storage_container_path: str - :keyword storage_container_sas_key: A shared access signature (SAS Key) that has write access - to the blob container specified in 'storageContainerPath' parameter. If - 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. Applies only if - the storage account is not behind a Vnet or a firewall. - :paramtype storage_container_sas_key: str - :keyword storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :paramtype storage_account_access_key: str - :keyword recurring_scans: The recurring scans settings. - :paramtype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - super().__init__(**kwargs) - self.storage_container_path = storage_container_path - self.storage_container_sas_key = storage_container_sas_key - self.storage_account_access_key = storage_account_access_key - self.recurring_scans = recurring_scans - - -class ManagedInstanceVulnerabilityAssessmentListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the ManagedInstance's vulnerability assessments. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedInstanceVulnerabilityAssessment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedInstanceVulnerabilityAssessment"]] = None - self.next_link: Optional[str] = None - - -class ManagedLedgerDigestUploads(ProxyResource): - """Azure SQL Database ledger digest upload settings. - - 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 digest_storage_endpoint: The digest storage endpoint, which must be either an Azure blob - storage endpoint or an URI for Azure Confidential Ledger. - :vartype digest_storage_endpoint: str - :ivar state: Specifies the state of ledger digest upload. Known values are: "Enabled" and - "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "digest_storage_endpoint": {"key": "properties.digestStorageEndpoint", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__(self, *, digest_storage_endpoint: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword digest_storage_endpoint: The digest storage endpoint, which must be either an Azure - blob storage endpoint or an URI for Azure Confidential Ledger. - :paramtype digest_storage_endpoint: str - """ - super().__init__(**kwargs) - self.digest_storage_endpoint = digest_storage_endpoint - self.state: Optional[Union[str, "_models.ManagedLedgerDigestUploadsState"]] = None - - -class ManagedLedgerDigestUploadsListResult(_serialization.Model): - """A list of ledger digest upload settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedLedgerDigestUploads]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedLedgerDigestUploads"]] = None - self.next_link: Optional[str] = None - - -class ManagedServerDnsAlias(ProxyResource): - """A managed server DNS alias. - - 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 azure_dns_record: The fully qualified DNS record for managed server alias. - :vartype azure_dns_record: str - :ivar public_azure_dns_record: The fully qualified public DNS record for managed server alias. - :vartype public_azure_dns_record: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "azure_dns_record": {"readonly": True}, - "public_azure_dns_record": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "azure_dns_record": {"key": "properties.azureDnsRecord", "type": "str"}, - "public_azure_dns_record": {"key": "properties.publicAzureDnsRecord", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.azure_dns_record: Optional[str] = None - self.public_azure_dns_record: Optional[str] = None - - -class ManagedServerDnsAliasAcquisition(_serialization.Model): - """A managed server DNS alias acquisition request. - - All required parameters must be populated in order to send to server. - - :ivar old_managed_server_dns_alias_resource_id: The resource ID of the managed server DNS alias - that will be acquired to point to this managed server instead. Required. - :vartype old_managed_server_dns_alias_resource_id: str - """ - - _validation = { - "old_managed_server_dns_alias_resource_id": {"required": True}, - } - - _attribute_map = { - "old_managed_server_dns_alias_resource_id": {"key": "oldManagedServerDnsAliasResourceId", "type": "str"}, - } - - def __init__(self, *, old_managed_server_dns_alias_resource_id: str, **kwargs: Any) -> None: - """ - :keyword old_managed_server_dns_alias_resource_id: The resource ID of the managed server DNS - alias that will be acquired to point to this managed server instead. Required. - :paramtype old_managed_server_dns_alias_resource_id: str - """ - super().__init__(**kwargs) - self.old_managed_server_dns_alias_resource_id = old_managed_server_dns_alias_resource_id - - -class ManagedServerDnsAliasCreation(_serialization.Model): - """A managed server dns alias creation request. - - :ivar create_dns_record: Whether or not DNS record should be created for this alias. - :vartype create_dns_record: bool - """ - - _attribute_map = { - "create_dns_record": {"key": "createDnsRecord", "type": "bool"}, - } - - def __init__(self, *, create_dns_record: bool = True, **kwargs: Any) -> None: - """ - :keyword create_dns_record: Whether or not DNS record should be created for this alias. - :paramtype create_dns_record: bool - """ - super().__init__(**kwargs) - self.create_dns_record = create_dns_record - - -class ManagedServerDnsAliasListResult(_serialization.Model): - """A list of managed server DNS aliases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedServerDnsAlias]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedServerDnsAlias"]] = None - self.next_link: Optional[str] = None - - -class ManagedServerSecurityAlertPolicy(ProxyResource): - """A managed server security alert policy. - - 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 system_data: SystemData of SecurityAlertPolicyResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the policy, whether it is enabled or disabled or a policy - has not been applied yet on the specific database. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :vartype disabled_alerts: list[str] - :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :vartype email_addresses: list[str] - :ivar email_account_admins: Specifies that the alert is sent to the account administrators. - :vartype email_account_admins: bool - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :vartype storage_account_access_key: str - :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. - :vartype retention_days: int - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "disabled_alerts": {"key": "properties.disabledAlerts", "type": "[str]"}, - "email_addresses": {"key": "properties.emailAddresses", "type": "[str]"}, - "email_account_admins": {"key": "properties.emailAccountAdmins", "type": "bool"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, - *, - state: Optional[Union[str, "_models.SecurityAlertsPolicyState"]] = None, - disabled_alerts: Optional[list[str]] = None, - email_addresses: Optional[list[str]] = None, - email_account_admins: Optional[bool] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - retention_days: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the policy, whether it is enabled or disabled or a - policy has not been applied yet on the specific database. Known values are: "Enabled" and - "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :keyword disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :paramtype disabled_alerts: list[str] - :keyword email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :paramtype email_addresses: list[str] - :keyword email_account_admins: Specifies that the alert is sent to the account administrators. - :paramtype email_account_admins: bool - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :paramtype storage_account_access_key: str - :keyword retention_days: Specifies the number of days to keep in the Threat Detection audit - logs. - :paramtype retention_days: int - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.disabled_alerts = disabled_alerts - self.email_addresses = email_addresses - self.email_account_admins = email_account_admins - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.retention_days = retention_days - self.creation_time: Optional[datetime.datetime] = None - - -class ManagedServerSecurityAlertPolicyListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of the managed Server's security alert policies. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedServerSecurityAlertPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedServerSecurityAlertPolicy"]] = None - self.next_link: Optional[str] = None - - -class ManagedTransparentDataEncryption(ProxyResource): - """A managed database transparent data encryption state. - - 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 state: Specifies the state of the transparent data encryption. Known values are: - "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState - """ - - _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"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.TransparentDataEncryptionState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the transparent data encryption. Known values are: - "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState - """ - super().__init__(**kwargs) - self.state = state - - -class ManagedTransparentDataEncryptionListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of managed transparent data encryptions. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ManagedTransparentDataEncryption]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ManagedTransparentDataEncryption"]] = None - self.next_link: Optional[str] = None - - -class MaxLimitRangeCapability(_serialization.Model): - """The maximum limit range capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar min_value: Minimum value. - :vartype min_value: int - :ivar max_value: Maximum value. - :vartype max_value: int - :ivar scale_size: Scale/step size for discrete values between the minimum value and the maximum - value. - :vartype scale_size: int - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "min_value": {"readonly": True}, - "max_value": {"readonly": True}, - "scale_size": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "min_value": {"key": "minValue", "type": "int"}, - "max_value": {"key": "maxValue", "type": "int"}, - "scale_size": {"key": "scaleSize", "type": "int"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.min_value: Optional[int] = None - self.max_value: Optional[int] = None - self.scale_size: Optional[int] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class MaxSizeCapability(_serialization.Model): - """The maximum size capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar limit: The maximum size limit (see 'unit' for the units). - :vartype limit: int - :ivar unit: The units that the limit is expressed in. Known values are: "Megabytes", - "Gigabytes", "Terabytes", and "Petabytes". - :vartype unit: str or ~azure.mgmt.sql.models.MaxSizeUnit - """ - - _validation = { - "limit": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "limit": {"key": "limit", "type": "int"}, - "unit": {"key": "unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.limit: Optional[int] = None - self.unit: Optional[Union[str, "_models.MaxSizeUnit"]] = None - - -class MaxSizeRangeCapability(_serialization.Model): - """The maximum size range capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar min_value: Minimum value. - :vartype min_value: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar max_value: Maximum value. - :vartype max_value: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar scale_size: Scale/step size for discrete values between the minimum value and the maximum - value. - :vartype scale_size: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar log_size: Size of transaction log. - :vartype log_size: ~azure.mgmt.sql.models.LogSizeCapability - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "min_value": {"readonly": True}, - "max_value": {"readonly": True}, - "scale_size": {"readonly": True}, - "log_size": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "min_value": {"key": "minValue", "type": "MaxSizeCapability"}, - "max_value": {"key": "maxValue", "type": "MaxSizeCapability"}, - "scale_size": {"key": "scaleSize", "type": "MaxSizeCapability"}, - "log_size": {"key": "logSize", "type": "LogSizeCapability"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.min_value: Optional["_models.MaxSizeCapability"] = None - self.max_value: Optional["_models.MaxSizeCapability"] = None - self.scale_size: Optional["_models.MaxSizeCapability"] = None - self.log_size: Optional["_models.LogSizeCapability"] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class MinCapacityCapability(_serialization.Model): - """The min capacity capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Min capacity value. - :vartype value: float - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "value": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "float"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.value: Optional[float] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class Name(_serialization.Model): - """ARM Usage Name. - - :ivar value: Usage name value. - :vartype value: str - :ivar localized_value: Usage name localized value. - :vartype localized_value: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "str"}, - "localized_value": {"key": "localizedValue", "type": "str"}, - } - - def __init__(self, *, value: Optional[str] = None, localized_value: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword value: Usage name value. - :paramtype value: str - :keyword localized_value: Usage name localized value. - :paramtype localized_value: str - """ - super().__init__(**kwargs) - self.value = value - self.localized_value = localized_value - - -class NetworkIsolationSettings(_serialization.Model): - """Contains the ARM resources for which to create private endpoint connection. - - :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC - file. If set, private endpoint connection will be created for the storage account. Must match - storage account used for StorageUri parameter. - :vartype storage_account_resource_id: str - :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :vartype sql_server_resource_id: str - """ - - _attribute_map = { - "storage_account_resource_id": {"key": "storageAccountResourceId", "type": "str"}, - "sql_server_resource_id": {"key": "sqlServerResourceId", "type": "str"}, - } - - def __init__( - self, - *, - storage_account_resource_id: Optional[str] = None, - sql_server_resource_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_account_resource_id: The resource id for the storage account used to store - BACPAC file. If set, private endpoint connection will be created for the storage account. Must - match storage account used for StorageUri parameter. - :paramtype storage_account_resource_id: str - :keyword sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :paramtype sql_server_resource_id: str - """ - super().__init__(**kwargs) - self.storage_account_resource_id = storage_account_resource_id - self.sql_server_resource_id = sql_server_resource_id - - -class NetworkIsolationSettingsAutoGenerated(_serialization.Model): - """Contains the ARM resources for which to create private endpoint connection. - - :ivar storage_account_resource_id: The resource id for the storage account used to store BACPAC - file. If set, private endpoint connection will be created for the storage account. Must match - storage account used for StorageUri parameter. - :vartype storage_account_resource_id: str - :ivar sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :vartype sql_server_resource_id: str - """ - - _attribute_map = { - "storage_account_resource_id": {"key": "storageAccountResourceId", "type": "str"}, - "sql_server_resource_id": {"key": "sqlServerResourceId", "type": "str"}, - } - - def __init__( - self, - *, - storage_account_resource_id: Optional[str] = None, - sql_server_resource_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_account_resource_id: The resource id for the storage account used to store - BACPAC file. If set, private endpoint connection will be created for the storage account. Must - match storage account used for StorageUri parameter. - :paramtype storage_account_resource_id: str - :keyword sql_server_resource_id: The resource id for the SQL server which is the target of this - request. If set, private endpoint connection will be created for the SQL server. Must match - server which is target of the operation. - :paramtype sql_server_resource_id: str - """ - super().__init__(**kwargs) - self.storage_account_resource_id = storage_account_resource_id - self.sql_server_resource_id = sql_server_resource_id - - -class NetworkSecurityPerimeterConfiguration(ProxyResource): - """NSP Configuration for a server. - - 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 provisioning_state: - :vartype provisioning_state: str - :ivar network_security_perimeter: - :vartype network_security_perimeter: ~azure.mgmt.sql.models.NSPConfigPerimeter - :ivar resource_association: - :vartype resource_association: ~azure.mgmt.sql.models.NSPConfigAssociation - :ivar profile: - :vartype profile: ~azure.mgmt.sql.models.NSPConfigProfile - :ivar provisioning_issues: - :vartype provisioning_issues: list[~azure.mgmt.sql.models.NSPProvisioningIssue] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "network_security_perimeter": {"key": "properties.networkSecurityPerimeter", "type": "NSPConfigPerimeter"}, - "resource_association": {"key": "properties.resourceAssociation", "type": "NSPConfigAssociation"}, - "profile": {"key": "properties.profile", "type": "NSPConfigProfile"}, - "provisioning_issues": {"key": "properties.provisioningIssues", "type": "[NSPProvisioningIssue]"}, - } - - def __init__( - self, - *, - network_security_perimeter: Optional["_models.NSPConfigPerimeter"] = None, - resource_association: Optional["_models.NSPConfigAssociation"] = None, - profile: Optional["_models.NSPConfigProfile"] = None, - provisioning_issues: Optional[list["_models.NSPProvisioningIssue"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_security_perimeter: - :paramtype network_security_perimeter: ~azure.mgmt.sql.models.NSPConfigPerimeter - :keyword resource_association: - :paramtype resource_association: ~azure.mgmt.sql.models.NSPConfigAssociation - :keyword profile: - :paramtype profile: ~azure.mgmt.sql.models.NSPConfigProfile - :keyword provisioning_issues: - :paramtype provisioning_issues: list[~azure.mgmt.sql.models.NSPProvisioningIssue] - """ - super().__init__(**kwargs) - self.provisioning_state: Optional[str] = None - self.network_security_perimeter = network_security_perimeter - self.resource_association = resource_association - self.profile = profile - self.provisioning_issues = provisioning_issues - - -class NetworkSecurityPerimeterConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of NSP configurations for a server. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkSecurityPerimeterConfiguration]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.NetworkSecurityPerimeterConfiguration"]] = None - self.next_link: Optional[str] = None - - -class NSPConfigAccessRule(_serialization.Model): - """NSPConfigAccessRule. - - :ivar name: - :vartype name: str - :ivar properties: - :vartype properties: ~azure.mgmt.sql.models.NSPConfigAccessRuleProperties - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "NSPConfigAccessRuleProperties"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["_models.NSPConfigAccessRuleProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: - :paramtype name: str - :keyword properties: - :paramtype properties: ~azure.mgmt.sql.models.NSPConfigAccessRuleProperties - """ - super().__init__(**kwargs) - self.name = name - self.properties = properties - - -class NSPConfigAccessRuleProperties(_serialization.Model): - """NSPConfigAccessRuleProperties. - - :ivar direction: - :vartype direction: str - :ivar address_prefixes: - :vartype address_prefixes: list[str] - :ivar fully_qualified_domain_names: - :vartype fully_qualified_domain_names: list[str] - :ivar subscriptions: - :vartype subscriptions: list[str] - :ivar network_security_perimeters: - :vartype network_security_perimeters: - list[~azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule] - :ivar service_tags: - :vartype service_tags: list[str] - """ - - _attribute_map = { - "direction": {"key": "direction", "type": "str"}, - "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, - "fully_qualified_domain_names": {"key": "fullyQualifiedDomainNames", "type": "[str]"}, - "subscriptions": {"key": "subscriptions", "type": "[str]"}, - "network_security_perimeters": { - "key": "networkSecurityPerimeters", - "type": "[NSPConfigNetworkSecurityPerimeterRule]", - }, - "service_tags": {"key": "serviceTags", "type": "[str]"}, - } - - def __init__( - self, - *, - direction: Optional[str] = None, - address_prefixes: Optional[list[str]] = None, - fully_qualified_domain_names: Optional[list[str]] = None, - subscriptions: Optional[list[str]] = None, - network_security_perimeters: Optional[list["_models.NSPConfigNetworkSecurityPerimeterRule"]] = None, - service_tags: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword direction: - :paramtype direction: str - :keyword address_prefixes: - :paramtype address_prefixes: list[str] - :keyword fully_qualified_domain_names: - :paramtype fully_qualified_domain_names: list[str] - :keyword subscriptions: - :paramtype subscriptions: list[str] - :keyword network_security_perimeters: - :paramtype network_security_perimeters: - list[~azure.mgmt.sql.models.NSPConfigNetworkSecurityPerimeterRule] - :keyword service_tags: - :paramtype service_tags: list[str] - """ - super().__init__(**kwargs) - self.direction = direction - self.address_prefixes = address_prefixes - self.fully_qualified_domain_names = fully_qualified_domain_names - self.subscriptions = subscriptions - self.network_security_perimeters = network_security_perimeters - self.service_tags = service_tags - - -class NSPConfigAssociation(_serialization.Model): - """NSPConfigAssociation. - - :ivar name: - :vartype name: str - :ivar access_mode: - :vartype access_mode: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, access_mode: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: - :paramtype name: str - :keyword access_mode: - :paramtype access_mode: str - """ - super().__init__(**kwargs) - self.name = name - self.access_mode = access_mode - - -class NSPConfigNetworkSecurityPerimeterRule(_serialization.Model): - """NSPConfigNetworkSecurityPerimeterRule. - - :ivar id: - :vartype id: str - :ivar perimeter_guid: - :vartype perimeter_guid: str - :ivar location: - :vartype location: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - perimeter_guid: Optional[str] = None, - location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: - :paramtype id: str - :keyword perimeter_guid: - :paramtype perimeter_guid: str - :keyword location: - :paramtype location: str - """ - super().__init__(**kwargs) - self.id = id - self.perimeter_guid = perimeter_guid - self.location = location - - -class NSPConfigPerimeter(_serialization.Model): - """NSPConfigPerimeter. - - :ivar id: - :vartype id: str - :ivar perimeter_guid: - :vartype perimeter_guid: str - :ivar location: - :vartype location: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - perimeter_guid: Optional[str] = None, - location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: - :paramtype id: str - :keyword perimeter_guid: - :paramtype perimeter_guid: str - :keyword location: - :paramtype location: str - """ - super().__init__(**kwargs) - self.id = id - self.perimeter_guid = perimeter_guid - self.location = location - - -class NSPConfigProfile(_serialization.Model): - """NSPConfigProfile. - - :ivar name: - :vartype name: str - :ivar access_rules_version: - :vartype access_rules_version: str - :ivar access_rules: - :vartype access_rules: list[~azure.mgmt.sql.models.NSPConfigAccessRule] - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_rules_version": {"key": "accessRulesVersion", "type": "str"}, - "access_rules": {"key": "accessRules", "type": "[NSPConfigAccessRule]"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - access_rules_version: Optional[str] = None, - access_rules: Optional[list["_models.NSPConfigAccessRule"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: - :paramtype name: str - :keyword access_rules_version: - :paramtype access_rules_version: str - :keyword access_rules: - :paramtype access_rules: list[~azure.mgmt.sql.models.NSPConfigAccessRule] - """ - super().__init__(**kwargs) - self.name = name - self.access_rules_version = access_rules_version - self.access_rules = access_rules - - -class NSPProvisioningIssue(_serialization.Model): - """NSPProvisioningIssue. - - :ivar name: - :vartype name: str - :ivar properties: - :vartype properties: ~azure.mgmt.sql.models.NSPProvisioningIssueProperties - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "NSPProvisioningIssueProperties"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - properties: Optional["_models.NSPProvisioningIssueProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: - :paramtype name: str - :keyword properties: - :paramtype properties: ~azure.mgmt.sql.models.NSPProvisioningIssueProperties - """ - super().__init__(**kwargs) - self.name = name - self.properties = properties - - -class NSPProvisioningIssueProperties(_serialization.Model): - """NSPProvisioningIssueProperties. - - :ivar issue_type: - :vartype issue_type: str - :ivar severity: - :vartype severity: str - :ivar description: - :vartype description: str - :ivar suggested_resource_ids: - :vartype suggested_resource_ids: list[str] - :ivar suggested_access_rules: - :vartype suggested_access_rules: list[str] - """ - - _attribute_map = { - "issue_type": {"key": "issueType", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "suggested_resource_ids": {"key": "suggestedResourceIds", "type": "[str]"}, - "suggested_access_rules": {"key": "suggestedAccessRules", "type": "[str]"}, - } - - def __init__( - self, - *, - issue_type: Optional[str] = None, - severity: Optional[str] = None, - description: Optional[str] = None, - suggested_resource_ids: Optional[list[str]] = None, - suggested_access_rules: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword issue_type: - :paramtype issue_type: str - :keyword severity: - :paramtype severity: str - :keyword description: - :paramtype description: str - :keyword suggested_resource_ids: - :paramtype suggested_resource_ids: list[str] - :keyword suggested_access_rules: - :paramtype suggested_access_rules: list[str] - """ - super().__init__(**kwargs) - self.issue_type = issue_type - self.severity = severity - self.description = description - self.suggested_resource_ids = suggested_resource_ids - self.suggested_access_rules = suggested_access_rules - - -class Operation(_serialization.Model): - """SQL REST API operation definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the operation being performed on this particular object. - :vartype name: str - :ivar display: The localized display information for this particular operation / action. - :vartype display: ~azure.mgmt.sql.models.OperationDisplay - :ivar origin: The intended executor of the operation. Known values are: "user" and "system". - :vartype origin: str or ~azure.mgmt.sql.models.OperationOrigin - :ivar properties: Additional descriptions for the operation. - :vartype properties: dict[str, JSON] - """ - - _validation = { - "name": {"readonly": True}, - "display": {"readonly": True}, - "origin": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display": {"key": "display", "type": "OperationDisplay"}, - "origin": {"key": "origin", "type": "str"}, - "properties": {"key": "properties", "type": "{object}"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.display: Optional["_models.OperationDisplay"] = None - self.origin: Optional[Union[str, "_models.OperationOrigin"]] = None - self.properties: Optional[dict[str, JSON]] = None - - -class OperationDisplay(_serialization.Model): - """Display metadata associated with the operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar provider: The localized friendly form of the resource provider name. - :vartype provider: str - :ivar resource: The localized friendly form of the resource type related to this - action/operation. - :vartype resource: str - :ivar operation: The localized friendly name for the operation. - :vartype operation: str - :ivar description: The localized friendly description for the operation. - :vartype description: str - """ - - _validation = { - "provider": {"readonly": True}, - "resource": {"readonly": True}, - "operation": {"readonly": True}, - "description": {"readonly": True}, - } - - _attribute_map = { - "provider": {"key": "provider", "type": "str"}, - "resource": {"key": "resource", "type": "str"}, - "operation": {"key": "operation", "type": "str"}, - "description": {"key": "description", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provider: Optional[str] = None - self.resource: Optional[str] = None - self.operation: Optional[str] = None - self.description: Optional[str] = None - - -class OperationListResult(_serialization.Model): - """Result of the request to list SQL operations. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.Operation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Operation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Operation"]] = None - self.next_link: Optional[str] = None - - -class OutboundEnvironmentEndpoint(_serialization.Model): - """An endpoint that the managed instance service requires outbound network access to. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar category: The type of service accessed by the managed instance service, e.g., Azure - Storage, Azure Active Directory, etc. - :vartype category: str - :ivar endpoints: The endpoints that the managed instance service communicates with in order to - function correctly. - :vartype endpoints: list[~azure.mgmt.sql.models.EndpointDependency] - """ - - _validation = { - "category": {"readonly": True}, - "endpoints": {"readonly": True}, - } - - _attribute_map = { - "category": {"key": "category", "type": "str"}, - "endpoints": {"key": "endpoints", "type": "[EndpointDependency]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.category: Optional[str] = None - self.endpoints: Optional[list["_models.EndpointDependency"]] = None - - -class OutboundEnvironmentEndpointCollection(_serialization.Model): - """A collection of endpoints that the managed instance service requires outbound network access - to. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.OutboundEnvironmentEndpoint] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OutboundEnvironmentEndpoint]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.OutboundEnvironmentEndpoint"]] = None - self.next_link: Optional[str] = None - - -class OutboundFirewallRule(ProxyResource): - """An Azure SQL DB Server Outbound Firewall Rule. - - 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 provisioning_state: The state of the outbound rule. - :vartype provisioning_state: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.provisioning_state: Optional[str] = None - - -class OutboundFirewallRuleListResult(_serialization.Model): - """A list of outbound rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.OutboundFirewallRule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[OutboundFirewallRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.OutboundFirewallRule"]] = None - self.next_link: Optional[str] = None - - -class PartnerInfo(_serialization.Model): - """Partner server information for the failover group. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource identifier of the partner server. Required. - :vartype id: str - :ivar location: Geo location of the partner server. - :vartype location: str - :ivar replication_role: Replication role of the partner server. Known values are: "Primary" and - "Secondary". - :vartype replication_role: str or ~azure.mgmt.sql.models.FailoverGroupReplicationRole - """ - - _validation = { - "id": {"required": True}, - "location": {"readonly": True}, - "replication_role": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "replication_role": {"key": "replicationRole", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource identifier of the partner server. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - self.location: Optional[str] = None - self.replication_role: Optional[Union[str, "_models.FailoverGroupReplicationRole"]] = None - - -class PartnerRegionInfo(_serialization.Model): - """Partner region information for the failover group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar location: Geo location of the partner managed instances. - :vartype location: str - :ivar replication_role: Replication role of the partner managed instances. Known values are: - "Primary" and "Secondary". - :vartype replication_role: str or ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - """ - - _validation = { - "replication_role": {"readonly": True}, - } - - _attribute_map = { - "location": {"key": "location", "type": "str"}, - "replication_role": {"key": "replicationRole", "type": "str"}, - } - - def __init__(self, *, location: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword location: Geo location of the partner managed instances. - :paramtype location: str - """ - super().__init__(**kwargs) - self.location = location - self.replication_role: Optional[Union[str, "_models.InstanceFailoverGroupReplicationRole"]] = None - - -class PerDatabaseAutoPauseDelayTimeRange(_serialization.Model): - """Supported auto pause delay time range. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar min_value: Minimum value. - :vartype min_value: int - :ivar max_value: Maximum value. - :vartype max_value: int - :ivar step_size: Step value for discrete values between the minimum value and the maximum - value. - :vartype step_size: int - :ivar default: Default value if no value is provided. - :vartype default: int - :ivar unit: Unit of time that delay is expressed in. "Minutes" - :vartype unit: str or ~azure.mgmt.sql.models.PauseDelayTimeUnit - :ivar do_not_pause_value: Value that is used to not pause (infinite delay before pause). - :vartype do_not_pause_value: int - """ - - _validation = { - "min_value": {"readonly": True}, - "max_value": {"readonly": True}, - "step_size": {"readonly": True}, - "default": {"readonly": True}, - "unit": {"readonly": True}, - "do_not_pause_value": {"readonly": True}, - } - - _attribute_map = { - "min_value": {"key": "minValue", "type": "int"}, - "max_value": {"key": "maxValue", "type": "int"}, - "step_size": {"key": "stepSize", "type": "int"}, - "default": {"key": "default", "type": "int"}, - "unit": {"key": "unit", "type": "str"}, - "do_not_pause_value": {"key": "doNotPauseValue", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.min_value: Optional[int] = None - self.max_value: Optional[int] = None - self.step_size: Optional[int] = None - self.default: Optional[int] = None - self.unit: Optional[Union[str, "_models.PauseDelayTimeUnit"]] = None - self.do_not_pause_value: Optional[int] = None - - -class PerformanceLevelCapability(_serialization.Model): - """The performance level capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Performance level value. - :vartype value: float - :ivar unit: Unit type used to measure performance level. Known values are: "DTU" and "VCores". - :vartype unit: str or ~azure.mgmt.sql.models.PerformanceLevelUnit - """ - - _validation = { - "value": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "float"}, - "unit": {"key": "unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[float] = None - self.unit: Optional[Union[str, "_models.PerformanceLevelUnit"]] = None - - -class PhaseDetails(_serialization.Model): - """The phase details properties of a database operation. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar phase: The operation phase. Known values are: "LogTransitionInProgress", "Copying", - "BuildingHyperscaleComponents", "Catchup", "WaitingForCutover", and "CutoverInProgress". - :vartype phase: str or ~azure.mgmt.sql.models.Phase - :ivar phase_information: The operation phase information. - :vartype phase_information: dict[str, str] - """ - - _validation = { - "phase": {"readonly": True}, - "phase_information": {"readonly": True}, - } - - _attribute_map = { - "phase": {"key": "phase", "type": "str"}, - "phase_information": {"key": "phaseInformation", "type": "{str}"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.phase: Optional[Union[str, "_models.Phase"]] = None - self.phase_information: Optional[dict[str, str]] = None - - -class PrivateEndpointConnection(ProxyResource): - """A private endpoint connection. - - 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 private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty - :ivar group_ids: Group IDs. - :vartype group_ids: list[str] - :ivar private_link_service_connection_state: Connection state of the private endpoint - connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the private endpoint connection. Known values are: - "Approving", "Ready", "Dropping", "Failed", and "Rejecting". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.PrivateEndpointProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "group_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpointProperty"}, - "group_ids": {"key": "properties.groupIds", "type": "[str]"}, - "private_link_service_connection_state": { - "key": "properties.privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionStateProperty", - }, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: Private endpoint which the connection belongs to. - :paramtype private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty - :keyword private_link_service_connection_state: Connection state of the private endpoint - connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty - """ - super().__init__(**kwargs) - self.private_endpoint = private_endpoint - self.group_ids: Optional[list[str]] = None - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointProvisioningState"]] = None - - -class PrivateEndpointConnectionListResult(_serialization.Model): - """A list of private endpoint connections. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.PrivateEndpointConnection] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateEndpointConnection]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.PrivateEndpointConnection"]] = None - self.next_link: Optional[str] = None - - -class PrivateEndpointConnectionProperties(_serialization.Model): - """Properties of a private endpoint connection. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar private_endpoint: Private endpoint which the connection belongs to. - :vartype private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty - :ivar group_ids: Group IDs. - :vartype group_ids: list[str] - :ivar private_link_service_connection_state: Connection state of the private endpoint - connection. - :vartype private_link_service_connection_state: - ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty - :ivar provisioning_state: State of the private endpoint connection. Known values are: - "Approving", "Ready", "Dropping", "Failed", and "Rejecting". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.PrivateEndpointProvisioningState - """ - - _validation = { - "group_ids": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "private_endpoint": {"key": "privateEndpoint", "type": "PrivateEndpointProperty"}, - "group_ids": {"key": "groupIds", "type": "[str]"}, - "private_link_service_connection_state": { - "key": "privateLinkServiceConnectionState", - "type": "PrivateLinkServiceConnectionStateProperty", - }, - "provisioning_state": {"key": "provisioningState", "type": "str"}, - } - - def __init__( - self, - *, - private_endpoint: Optional["_models.PrivateEndpointProperty"] = None, - private_link_service_connection_state: Optional["_models.PrivateLinkServiceConnectionStateProperty"] = None, - **kwargs: Any - ) -> None: - """ - :keyword private_endpoint: Private endpoint which the connection belongs to. - :paramtype private_endpoint: ~azure.mgmt.sql.models.PrivateEndpointProperty - :keyword private_link_service_connection_state: Connection state of the private endpoint - connection. - :paramtype private_link_service_connection_state: - ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateProperty - """ - super().__init__(**kwargs) - self.private_endpoint = private_endpoint - self.group_ids: Optional[list[str]] = None - self.private_link_service_connection_state = private_link_service_connection_state - self.provisioning_state: Optional[Union[str, "_models.PrivateEndpointProvisioningState"]] = None - - -class PrivateEndpointConnectionRequestStatus(_serialization.Model): - """Contains the private endpoint connection requests status. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar private_link_service_id: Resource id for which the private endpoint is created. - :vartype private_link_service_id: str - :ivar private_endpoint_connection_name: The connection name for the private endpoint. - :vartype private_endpoint_connection_name: str - :ivar status: Status of this private endpoint connection. - :vartype status: str - """ - - _validation = { - "private_link_service_id": {"readonly": True}, - "private_endpoint_connection_name": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "private_link_service_id": {"key": "privateLinkServiceId", "type": "str"}, - "private_endpoint_connection_name": {"key": "privateEndpointConnectionName", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.private_link_service_id: Optional[str] = None - self.private_endpoint_connection_name: Optional[str] = None - self.status: Optional[str] = None - - -class PrivateEndpointProperty(_serialization.Model): - """PrivateEndpointProperty. - - :ivar id: Resource id of the private endpoint. - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Resource id of the private endpoint. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class PrivateLinkResource(ProxyResource): - """A private link 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 properties: The private link resource group id. - :vartype properties: ~azure.mgmt.sql.models.PrivateLinkResourceProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "PrivateLinkResourceProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.properties: Optional["_models.PrivateLinkResourceProperties"] = None - - -class PrivateLinkResourceListResult(_serialization.Model): - """A list of private link resources. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.PrivateLinkResource] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[PrivateLinkResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.PrivateLinkResource"]] = None - self.next_link: Optional[str] = None - - -class PrivateLinkResourceProperties(_serialization.Model): - """Properties of a private link resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar group_id: The private link resource group id. - :vartype group_id: str - :ivar required_members: The private link resource required member names. - :vartype required_members: list[str] - :ivar required_zone_names: The private link resource required zone names. - :vartype required_zone_names: list[str] - """ - - _validation = { - "group_id": {"readonly": True}, - "required_members": {"readonly": True}, - "required_zone_names": {"readonly": True}, - } - - _attribute_map = { - "group_id": {"key": "groupId", "type": "str"}, - "required_members": {"key": "requiredMembers", "type": "[str]"}, - "required_zone_names": {"key": "requiredZoneNames", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.group_id: Optional[str] = None - self.required_members: Optional[list[str]] = None - self.required_zone_names: Optional[list[str]] = None - - -class PrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint: disable=name-too-long - """PrivateLinkServiceConnectionStateProperty. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar status: The private link service connection status. Required. Known values are: - "Approved", "Pending", "Rejected", and "Disconnected". - :vartype status: str or ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus - :ivar description: The private link service connection description. Required. - :vartype description: str - :ivar actions_required: The actions required for private link service connection. "None" - :vartype actions_required: str or - ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateActionsRequire - """ - - _validation = { - "status": {"required": True}, - "description": {"required": True}, - "actions_required": {"readonly": True}, - } - - _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, - } - - def __init__( - self, *, status: Union[str, "_models.PrivateLinkServiceConnectionStateStatus"], description: str, **kwargs: Any - ) -> None: - """ - :keyword status: The private link service connection status. Required. Known values are: - "Approved", "Pending", "Rejected", and "Disconnected". - :paramtype status: str or ~azure.mgmt.sql.models.PrivateLinkServiceConnectionStateStatus - :keyword description: The private link service connection description. Required. - :paramtype description: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required: Optional[Union[str, "_models.PrivateLinkServiceConnectionStateActionsRequire"]] = None - - -class QueryCheck(_serialization.Model): - """SQL Vulnerability Assessment query check object. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar query: SQL Vulnerability Assessment rule query. - :vartype query: str - :ivar expected_result: SQL Vulnerability Assessment query expected result. - :vartype expected_result: list[list[str]] - :ivar column_names: SQL Vulnerability Assessment column names of query expected result. - :vartype column_names: list[str] - """ - - _validation = { - "query": {"readonly": True}, - "expected_result": {"readonly": True}, - "column_names": {"readonly": True}, - } - - _attribute_map = { - "query": {"key": "query", "type": "str"}, - "expected_result": {"key": "expectedResult", "type": "[[str]]"}, - "column_names": {"key": "columnNames", "type": "[str]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.query: Optional[str] = None - self.expected_result: Optional[list[list[str]]] = None - self.column_names: Optional[list[str]] = None - - -class QueryMetricInterval(_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: Optional[str] = None - self.interval_type: Optional[Union[str, "_models.QueryTimeGrainType"]] = None - self.execution_count: Optional[int] = None - self.metrics = metrics - - -class QueryMetricProperties(_serialization.Model): - """Properties of a topquery metric in one interval. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name information for the metric. - :vartype name: str - :ivar display_name: The UI appropriate name for the metric. - :vartype display_name: str - :ivar unit: The unit of the metric. Known values are: "percentage", "KB", "microseconds", and - "count". - :vartype unit: str or ~azure.mgmt.sql.models.QueryMetricUnitType - :ivar value: The value of the metric. - :vartype value: float - :ivar min: Metric value when min() aggregate function is used over the interval. - :vartype min: float - :ivar max: Metric value when max() aggregate function is used over the interval. - :vartype max: float - :ivar avg: Metric value when avg() aggregate function is used over the interval. - :vartype avg: float - :ivar sum: Metric value when sum() aggregate function is used over the interval. - :vartype sum: float - :ivar stdev: Metric value when stdev aggregate function is used over the interval. - :vartype stdev: float - """ - - _validation = { - "name": {"readonly": True}, - "display_name": {"readonly": True}, - "unit": {"readonly": True}, - "value": {"readonly": True}, - "min": {"readonly": True}, - "max": {"readonly": True}, - "avg": {"readonly": True}, - "sum": {"readonly": True}, - "stdev": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "display_name": {"key": "displayName", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "value": {"key": "value", "type": "float"}, - "min": {"key": "min", "type": "float"}, - "max": {"key": "max", "type": "float"}, - "avg": {"key": "avg", "type": "float"}, - "sum": {"key": "sum", "type": "float"}, - "stdev": {"key": "stdev", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.display_name: Optional[str] = None - self.unit: Optional[Union[str, "_models.QueryMetricUnitType"]] = None - self.value: Optional[float] = None - self.min: Optional[float] = None - self.max: Optional[float] = None - self.avg: Optional[float] = None - self.sum: Optional[float] = None - self.stdev: Optional[float] = None - - -class QueryStatistics(ProxyResource): - """QueryStatistics. - - 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 database_name: Database name of the database in which this query was executed. - :vartype database_name: str - :ivar query_id: Unique query id (unique within one database). - :vartype query_id: str - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: str - :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.QueryMetricInterval] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "database_name": {"readonly": True}, - "query_id": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "query_id": {"key": "properties.queryId", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "str"}, - "end_time": {"key": "properties.endTime", "type": "str"}, - "intervals": {"key": "properties.intervals", "type": "[QueryMetricInterval]"}, - } - - 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.QueryMetricInterval] - """ - super().__init__(**kwargs) - self.database_name: Optional[str] = None - self.query_id: Optional[str] = None - self.start_time: Optional[str] = None - self.end_time: Optional[str] = None - self.intervals = intervals - - -class QueryStatisticsProperties(_serialization.Model): - """Properties of a query execution statistics. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar database_name: Database name of the database in which this query was executed. - :vartype database_name: str - :ivar query_id: Unique query id (unique within one database). - :vartype query_id: str - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: str - :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.QueryMetricInterval] - """ - - _validation = { - "database_name": {"readonly": True}, - "query_id": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - } - - _attribute_map = { - "database_name": {"key": "databaseName", "type": "str"}, - "query_id": {"key": "queryId", "type": "str"}, - "start_time": {"key": "startTime", "type": "str"}, - "end_time": {"key": "endTime", "type": "str"}, - "intervals": {"key": "intervals", "type": "[QueryMetricInterval]"}, - } - - 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.QueryMetricInterval] - """ - super().__init__(**kwargs) - self.database_name: Optional[str] = None - self.query_id: Optional[str] = None - self.start_time: Optional[str] = None - self.end_time: Optional[str] = None - self.intervals = intervals - - -class ReadScaleCapability(_serialization.Model): - """The read scale capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar max_number_of_replicas: The maximum number of read scale replicas. - :vartype max_number_of_replicas: int - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "max_number_of_replicas": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "max_number_of_replicas": {"key": "maxNumberOfReplicas", "type": "int"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.max_number_of_replicas: Optional[int] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class RecommendedAction(_serialization.Model): - """Database, Server or Elastic Pool Recommended Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar kind: Resource kind. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar recommendation_reason: Gets the reason for recommending this action. e.g., - DuplicateIndex. - :vartype recommendation_reason: str - :ivar valid_since: Gets the time since when this recommended action is valid. - :vartype valid_since: ~datetime.datetime - :ivar last_refresh: Gets time when this recommended action was last refreshed. - :vartype last_refresh: ~datetime.datetime - :ivar state: Gets the info of the current state the recommended action is in. - :vartype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo - :ivar is_executable_action: Gets if this recommended action is actionable by user. - :vartype is_executable_action: bool - :ivar is_revertable_action: Gets if changes applied by this recommended action can be reverted - by user. - :vartype is_revertable_action: bool - :ivar is_archived_action: Gets if this recommended action was suggested some time ago but user - chose to ignore this and system added a new recommended action again. - :vartype is_archived_action: bool - :ivar execute_action_start_time: Gets the time when system started applying this recommended - action on the user resource. e.g., index creation start time. - :vartype execute_action_start_time: ~datetime.datetime - :ivar execute_action_duration: Gets the time taken for applying this recommended action on user - resource. e.g., time taken for index creation. - :vartype execute_action_duration: ~datetime.timedelta - :ivar revert_action_start_time: Gets the time when system started reverting changes of this - recommended action on user resource. e.g., time when index drop is executed. - :vartype revert_action_start_time: ~datetime.datetime - :ivar revert_action_duration: Gets the time taken for reverting changes of this recommended - action on user resource. e.g., time taken for dropping the created index. - :vartype revert_action_duration: ~datetime.timedelta - :ivar execute_action_initiated_by: Gets if approval for applying this recommended action was - given by user/system. Known values are: "User" and "System". - :vartype execute_action_initiated_by: str or - ~azure.mgmt.sql.models.RecommendedActionInitiatedBy - :ivar execute_action_initiated_time: Gets the time when this recommended action was approved - for execution. - :vartype execute_action_initiated_time: ~datetime.datetime - :ivar revert_action_initiated_by: Gets if approval for reverting this recommended action was - given by user/system. Known values are: "User" and "System". - :vartype revert_action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy - :ivar revert_action_initiated_time: Gets the time when this recommended action was approved for - revert. - :vartype revert_action_initiated_time: ~datetime.datetime - :ivar score: Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - - Medium Impact and 3 - High Impact. - :vartype score: int - :ivar implementation_details: Gets the implementation details of this recommended action for - user to apply it manually. - :vartype implementation_details: ~azure.mgmt.sql.models.RecommendedActionImplementationInfo - :ivar error_details: Gets the error details if and why this recommended action is put to error - state. - :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo - :ivar estimated_impact: Gets the estimated impact info for this recommended action e.g., - Estimated CPU gain, Estimated Disk Space change. - :vartype estimated_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] - :ivar observed_impact: Gets the observed/actual impact info for this recommended action e.g., - Actual CPU gain, Actual Disk Space change. - :vartype observed_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] - :ivar time_series: Gets the time series info of metrics for this recommended action e.g., CPU - consumption time series. - :vartype time_series: list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] - :ivar linked_objects: Gets the linked objects, if any. - :vartype linked_objects: list[str] - :ivar details: Gets additional details specific to this recommended action. - :vartype details: dict[str, str] - """ - - _validation = { - "kind": {"readonly": True}, - "location": {"readonly": True}, - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "recommendation_reason": {"readonly": True}, - "valid_since": {"readonly": True}, - "last_refresh": {"readonly": True}, - "is_executable_action": {"readonly": True}, - "is_revertable_action": {"readonly": True}, - "is_archived_action": {"readonly": True}, - "execute_action_start_time": {"readonly": True}, - "execute_action_duration": {"readonly": True}, - "revert_action_start_time": {"readonly": True}, - "revert_action_duration": {"readonly": True}, - "execute_action_initiated_by": {"readonly": True}, - "execute_action_initiated_time": {"readonly": True}, - "revert_action_initiated_by": {"readonly": True}, - "revert_action_initiated_time": {"readonly": True}, - "score": {"readonly": True}, - "implementation_details": {"readonly": True}, - "error_details": {"readonly": True}, - "estimated_impact": {"readonly": True}, - "observed_impact": {"readonly": True}, - "time_series": {"readonly": True}, - "linked_objects": {"readonly": True}, - "details": {"readonly": True}, - } - - _attribute_map = { - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "recommendation_reason": {"key": "properties.recommendationReason", "type": "str"}, - "valid_since": {"key": "properties.validSince", "type": "iso-8601"}, - "last_refresh": {"key": "properties.lastRefresh", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "RecommendedActionStateInfo"}, - "is_executable_action": {"key": "properties.isExecutableAction", "type": "bool"}, - "is_revertable_action": {"key": "properties.isRevertableAction", "type": "bool"}, - "is_archived_action": {"key": "properties.isArchivedAction", "type": "bool"}, - "execute_action_start_time": {"key": "properties.executeActionStartTime", "type": "iso-8601"}, - "execute_action_duration": {"key": "properties.executeActionDuration", "type": "duration"}, - "revert_action_start_time": {"key": "properties.revertActionStartTime", "type": "iso-8601"}, - "revert_action_duration": {"key": "properties.revertActionDuration", "type": "duration"}, - "execute_action_initiated_by": {"key": "properties.executeActionInitiatedBy", "type": "str"}, - "execute_action_initiated_time": {"key": "properties.executeActionInitiatedTime", "type": "iso-8601"}, - "revert_action_initiated_by": {"key": "properties.revertActionInitiatedBy", "type": "str"}, - "revert_action_initiated_time": {"key": "properties.revertActionInitiatedTime", "type": "iso-8601"}, - "score": {"key": "properties.score", "type": "int"}, - "implementation_details": { - "key": "properties.implementationDetails", - "type": "RecommendedActionImplementationInfo", - }, - "error_details": {"key": "properties.errorDetails", "type": "RecommendedActionErrorInfo"}, - "estimated_impact": {"key": "properties.estimatedImpact", "type": "[RecommendedActionImpactRecord]"}, - "observed_impact": {"key": "properties.observedImpact", "type": "[RecommendedActionImpactRecord]"}, - "time_series": {"key": "properties.timeSeries", "type": "[RecommendedActionMetricInfo]"}, - "linked_objects": {"key": "properties.linkedObjects", "type": "[str]"}, - "details": {"key": "properties.details", "type": "{str}"}, - } - - def __init__( # pylint: disable=too-many-locals - self, *, state: Optional["_models.RecommendedActionStateInfo"] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Gets the info of the current state the recommended action is in. - :paramtype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.location: Optional[str] = None - self.id: Optional[str] = None - self.name: Optional[str] = None - self.type: Optional[str] = None - self.recommendation_reason: Optional[str] = None - self.valid_since: Optional[datetime.datetime] = None - self.last_refresh: Optional[datetime.datetime] = None - self.state = state - self.is_executable_action: Optional[bool] = None - self.is_revertable_action: Optional[bool] = None - self.is_archived_action: Optional[bool] = None - self.execute_action_start_time: Optional[datetime.datetime] = None - self.execute_action_duration: Optional[datetime.timedelta] = None - self.revert_action_start_time: Optional[datetime.datetime] = None - self.revert_action_duration: Optional[datetime.timedelta] = None - self.execute_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None - self.execute_action_initiated_time: Optional[datetime.datetime] = None - self.revert_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None - self.revert_action_initiated_time: Optional[datetime.datetime] = None - self.score: Optional[int] = None - self.implementation_details: Optional["_models.RecommendedActionImplementationInfo"] = None - self.error_details: Optional["_models.RecommendedActionErrorInfo"] = None - self.estimated_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None - self.observed_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None - self.time_series: Optional[list["_models.RecommendedActionMetricInfo"]] = None - self.linked_objects: Optional[list[str]] = None - self.details: Optional[dict[str, str]] = None - - -class RecommendedActionAutoGenerated(ProxyResource): - """Database, Server or Elastic Pool Recommended Action. - - 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 kind: Resource kind. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :ivar recommendation_reason: Gets the reason for recommending this action. e.g., - DuplicateIndex. - :vartype recommendation_reason: str - :ivar valid_since: Gets the time since when this recommended action is valid. - :vartype valid_since: ~datetime.datetime - :ivar last_refresh: Gets time when this recommended action was last refreshed. - :vartype last_refresh: ~datetime.datetime - :ivar state: Gets the info of the current state the recommended action is in. - :vartype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo - :ivar is_executable_action: Gets if this recommended action is actionable by user. - :vartype is_executable_action: bool - :ivar is_revertable_action: Gets if changes applied by this recommended action can be reverted - by user. - :vartype is_revertable_action: bool - :ivar is_archived_action: Gets if this recommended action was suggested some time ago but user - chose to ignore this and system added a new recommended action again. - :vartype is_archived_action: bool - :ivar execute_action_start_time: Gets the time when system started applying this recommended - action on the user resource. e.g., index creation start time. - :vartype execute_action_start_time: ~datetime.datetime - :ivar execute_action_duration: Gets the time taken for applying this recommended action on user - resource. e.g., time taken for index creation. - :vartype execute_action_duration: ~datetime.timedelta - :ivar revert_action_start_time: Gets the time when system started reverting changes of this - recommended action on user resource. e.g., time when index drop is executed. - :vartype revert_action_start_time: ~datetime.datetime - :ivar revert_action_duration: Gets the time taken for reverting changes of this recommended - action on user resource. e.g., time taken for dropping the created index. - :vartype revert_action_duration: ~datetime.timedelta - :ivar execute_action_initiated_by: Gets if approval for applying this recommended action was - given by user/system. Known values are: "User" and "System". - :vartype execute_action_initiated_by: str or - ~azure.mgmt.sql.models.RecommendedActionInitiatedBy - :ivar execute_action_initiated_time: Gets the time when this recommended action was approved - for execution. - :vartype execute_action_initiated_time: ~datetime.datetime - :ivar revert_action_initiated_by: Gets if approval for reverting this recommended action was - given by user/system. Known values are: "User" and "System". - :vartype revert_action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy - :ivar revert_action_initiated_time: Gets the time when this recommended action was approved for - revert. - :vartype revert_action_initiated_time: ~datetime.datetime - :ivar score: Gets the impact of this recommended action. Possible values are 1 - Low impact, 2 - - Medium Impact and 3 - High Impact. - :vartype score: int - :ivar implementation_details: Gets the implementation details of this recommended action for - user to apply it manually. - :vartype implementation_details: ~azure.mgmt.sql.models.RecommendedActionImplementationInfo - :ivar error_details: Gets the error details if and why this recommended action is put to error - state. - :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo - :ivar estimated_impact: Gets the estimated impact info for this recommended action e.g., - Estimated CPU gain, Estimated Disk Space change. - :vartype estimated_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] - :ivar observed_impact: Gets the observed/actual impact info for this recommended action e.g., - Actual CPU gain, Actual Disk Space change. - :vartype observed_impact: list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] - :ivar time_series: Gets the time series info of metrics for this recommended action e.g., CPU - consumption time series. - :vartype time_series: list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] - :ivar linked_objects: Gets the linked objects, if any. - :vartype linked_objects: list[str] - :ivar details: Gets additional details specific to this recommended action. - :vartype details: dict[str, str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "location": {"readonly": True}, - "recommendation_reason": {"readonly": True}, - "valid_since": {"readonly": True}, - "last_refresh": {"readonly": True}, - "is_executable_action": {"readonly": True}, - "is_revertable_action": {"readonly": True}, - "is_archived_action": {"readonly": True}, - "execute_action_start_time": {"readonly": True}, - "execute_action_duration": {"readonly": True}, - "revert_action_start_time": {"readonly": True}, - "revert_action_duration": {"readonly": True}, - "execute_action_initiated_by": {"readonly": True}, - "execute_action_initiated_time": {"readonly": True}, - "revert_action_initiated_by": {"readonly": True}, - "revert_action_initiated_time": {"readonly": True}, - "score": {"readonly": True}, - "implementation_details": {"readonly": True}, - "error_details": {"readonly": True}, - "estimated_impact": {"readonly": True}, - "observed_impact": {"readonly": True}, - "time_series": {"readonly": True}, - "linked_objects": {"readonly": True}, - "details": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "recommendation_reason": {"key": "properties.recommendationReason", "type": "str"}, - "valid_since": {"key": "properties.validSince", "type": "iso-8601"}, - "last_refresh": {"key": "properties.lastRefresh", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "RecommendedActionStateInfo"}, - "is_executable_action": {"key": "properties.isExecutableAction", "type": "bool"}, - "is_revertable_action": {"key": "properties.isRevertableAction", "type": "bool"}, - "is_archived_action": {"key": "properties.isArchivedAction", "type": "bool"}, - "execute_action_start_time": {"key": "properties.executeActionStartTime", "type": "iso-8601"}, - "execute_action_duration": {"key": "properties.executeActionDuration", "type": "duration"}, - "revert_action_start_time": {"key": "properties.revertActionStartTime", "type": "iso-8601"}, - "revert_action_duration": {"key": "properties.revertActionDuration", "type": "duration"}, - "execute_action_initiated_by": {"key": "properties.executeActionInitiatedBy", "type": "str"}, - "execute_action_initiated_time": {"key": "properties.executeActionInitiatedTime", "type": "iso-8601"}, - "revert_action_initiated_by": {"key": "properties.revertActionInitiatedBy", "type": "str"}, - "revert_action_initiated_time": {"key": "properties.revertActionInitiatedTime", "type": "iso-8601"}, - "score": {"key": "properties.score", "type": "int"}, - "implementation_details": { - "key": "properties.implementationDetails", - "type": "RecommendedActionImplementationInfo", - }, - "error_details": {"key": "properties.errorDetails", "type": "RecommendedActionErrorInfo"}, - "estimated_impact": {"key": "properties.estimatedImpact", "type": "[RecommendedActionImpactRecord]"}, - "observed_impact": {"key": "properties.observedImpact", "type": "[RecommendedActionImpactRecord]"}, - "time_series": {"key": "properties.timeSeries", "type": "[RecommendedActionMetricInfo]"}, - "linked_objects": {"key": "properties.linkedObjects", "type": "[str]"}, - "details": {"key": "properties.details", "type": "{str}"}, - } - - def __init__( # pylint: disable=too-many-locals - self, *, state: Optional["_models.RecommendedActionStateInfo"] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Gets the info of the current state the recommended action is in. - :paramtype state: ~azure.mgmt.sql.models.RecommendedActionStateInfo - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.location: Optional[str] = None - self.recommendation_reason: Optional[str] = None - self.valid_since: Optional[datetime.datetime] = None - self.last_refresh: Optional[datetime.datetime] = None - self.state = state - self.is_executable_action: Optional[bool] = None - self.is_revertable_action: Optional[bool] = None - self.is_archived_action: Optional[bool] = None - self.execute_action_start_time: Optional[datetime.datetime] = None - self.execute_action_duration: Optional[datetime.timedelta] = None - self.revert_action_start_time: Optional[datetime.datetime] = None - self.revert_action_duration: Optional[datetime.timedelta] = None - self.execute_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None - self.execute_action_initiated_time: Optional[datetime.datetime] = None - self.revert_action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None - self.revert_action_initiated_time: Optional[datetime.datetime] = None - self.score: Optional[int] = None - self.implementation_details: Optional["_models.RecommendedActionImplementationInfo"] = None - self.error_details: Optional["_models.RecommendedActionErrorInfo"] = None - self.estimated_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None - self.observed_impact: Optional[list["_models.RecommendedActionImpactRecord"]] = None - self.time_series: Optional[list["_models.RecommendedActionMetricInfo"]] = None - self.linked_objects: Optional[list[str]] = None - self.details: Optional[dict[str, str]] = None - - -class RecommendedActionErrorInfo(_serialization.Model): - """Contains error information for an Azure SQL Database, Server or Elastic Pool Recommended - Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar error_code: Gets the reason why the recommended action was put to error state. e.g., - DatabaseHasQdsOff, IndexAlreadyExists. - :vartype error_code: str - :ivar is_retryable: Gets whether the error could be ignored and recommended action could be - retried. Possible values are: Yes/No. Known values are: "Yes" and "No". - :vartype is_retryable: str or ~azure.mgmt.sql.models.IsRetryable - """ - - _validation = { - "error_code": {"readonly": True}, - "is_retryable": {"readonly": True}, - } - - _attribute_map = { - "error_code": {"key": "errorCode", "type": "str"}, - "is_retryable": {"key": "isRetryable", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.error_code: Optional[str] = None - self.is_retryable: Optional[Union[str, "_models.IsRetryable"]] = None - - -class RecommendedActionImpactRecord(_serialization.Model): - """Contains information of estimated or observed impact on various metrics for an Azure SQL - Database, Server or Elastic Pool Recommended Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar dimension_name: Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, - NumberOfQueriesAffected. - :vartype dimension_name: str - :ivar unit: Gets the name of the impact dimension. e.g., CPUChange, DiskSpaceChange, - NumberOfQueriesAffected. - :vartype unit: str - :ivar absolute_value: Gets the absolute value of this dimension if applicable. e.g., Number of - Queries affected. - :vartype absolute_value: float - :ivar change_value_absolute: Gets the absolute change in the value of this dimension. e.g., - Absolute Disk space change in Megabytes. - :vartype change_value_absolute: float - :ivar change_value_relative: Gets the relative change in the value of this dimension. e.g., - Relative Disk space change in Percentage. - :vartype change_value_relative: float - """ - - _validation = { - "dimension_name": {"readonly": True}, - "unit": {"readonly": True}, - "absolute_value": {"readonly": True}, - "change_value_absolute": {"readonly": True}, - "change_value_relative": {"readonly": True}, - } - - _attribute_map = { - "dimension_name": {"key": "dimensionName", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "absolute_value": {"key": "absoluteValue", "type": "float"}, - "change_value_absolute": {"key": "changeValueAbsolute", "type": "float"}, - "change_value_relative": {"key": "changeValueRelative", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.dimension_name: Optional[str] = None - self.unit: Optional[str] = None - self.absolute_value: Optional[float] = None - self.change_value_absolute: Optional[float] = None - self.change_value_relative: Optional[float] = None - - -class RecommendedActionImplementationInfo(_serialization.Model): - """Contains information for manual implementation for an Azure SQL Database, Server or Elastic - Pool Recommended Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar method: Gets the method in which this recommended action can be manually implemented. - e.g., TSql, AzurePowerShell. Known values are: "TSql" and "AzurePowerShell". - :vartype method: str or ~azure.mgmt.sql.models.ImplementationMethod - :ivar script: Gets the manual implementation script. e.g., T-SQL script that could be executed - on the database. - :vartype script: str - """ - - _validation = { - "method": {"readonly": True}, - "script": {"readonly": True}, - } - - _attribute_map = { - "method": {"key": "method", "type": "str"}, - "script": {"key": "script", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.method: Optional[Union[str, "_models.ImplementationMethod"]] = None - self.script: Optional[str] = None - - -class RecommendedActionMetricInfo(_serialization.Model): - """Contains time series of various impacted metrics for an Azure SQL Database, Server or Elastic - Pool Recommended Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar metric_name: Gets the name of the metric. e.g., CPU, Number of Queries. - :vartype metric_name: str - :ivar unit: Gets the unit in which metric is measured. e.g., DTU, Frequency. - :vartype unit: str - :ivar time_grain: Gets the duration of time interval for the value given by this MetricInfo. - e.g., PT1H (1 hour). - :vartype time_grain: str - :ivar start_time: Gets the start time of time interval given by this MetricInfo. - :vartype start_time: ~datetime.datetime - :ivar value: Gets the value of the metric in the time interval given by this MetricInfo. - :vartype value: float - """ - - _validation = { - "metric_name": {"readonly": True}, - "unit": {"readonly": True}, - "time_grain": {"readonly": True}, - "start_time": {"readonly": True}, - "value": {"readonly": True}, - } - - _attribute_map = { - "metric_name": {"key": "metricName", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "time_grain": {"key": "timeGrain", "type": "str"}, - "start_time": {"key": "startTime", "type": "iso-8601"}, - "value": {"key": "value", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.metric_name: Optional[str] = None - self.unit: Optional[str] = None - self.time_grain: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.value: Optional[float] = None - - -class RecommendedActionStateInfo(_serialization.Model): - """Contains information of current state for an Azure SQL Database, Server or Elastic Pool - Recommended Action. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar current_value: Current state the recommended action is in. Some commonly used states are: - Active -> recommended action is active and no action has been taken yet. Pending -> - recommended action is approved for and is awaiting execution. Executing -> recommended action - is being applied on the user database. Verifying -> recommended action was applied and is - being verified of its usefulness by the system. Success -> recommended action was applied - and improvement found during verification. Pending Revert -> verification found little or no - improvement so recommended action is queued for revert or user has manually reverted. Reverting - -> changes made while applying recommended action are being reverted on the user database. - Reverted -> successfully reverted the changes made by recommended action on user database. - Ignored -> user explicitly ignored/discarded the recommended action. Required. Known values - are: "Active", "Pending", "Executing", "Verifying", "PendingRevert", "RevertCancelled", - "Reverting", "Reverted", "Ignored", "Expired", "Monitoring", "Resolved", "Success", and - "Error". - :vartype current_value: str or ~azure.mgmt.sql.models.RecommendedActionCurrentState - :ivar action_initiated_by: Gets who initiated the execution of this recommended action. - Possible Value are: User -> When user explicity notified system to apply the recommended - action. System -> When auto-execute status of this advisor was set to 'Enabled', in which case - the system applied it. Known values are: "User" and "System". - :vartype action_initiated_by: str or ~azure.mgmt.sql.models.RecommendedActionInitiatedBy - :ivar last_modified: Gets the time when the state was last modified. - :vartype last_modified: ~datetime.datetime - """ - - _validation = { - "current_value": {"required": True}, - "action_initiated_by": {"readonly": True}, - "last_modified": {"readonly": True}, - } - - _attribute_map = { - "current_value": {"key": "currentValue", "type": "str"}, - "action_initiated_by": {"key": "actionInitiatedBy", "type": "str"}, - "last_modified": {"key": "lastModified", "type": "iso-8601"}, - } - - def __init__(self, *, current_value: Union[str, "_models.RecommendedActionCurrentState"], **kwargs: Any) -> None: - """ - :keyword current_value: Current state the recommended action is in. Some commonly used states - are: Active -> recommended action is active and no action has been taken yet. Pending - -> recommended action is approved for and is awaiting execution. Executing -> recommended - action is being applied on the user database. Verifying -> recommended action was applied and - is being verified of its usefulness by the system. Success -> recommended action was - applied and improvement found during verification. Pending Revert -> verification found little - or no improvement so recommended action is queued for revert or user has manually reverted. - Reverting -> changes made while applying recommended action are being reverted on the user - database. Reverted -> successfully reverted the changes made by recommended action on user - database. Ignored -> user explicitly ignored/discarded the recommended action. Required. - Known values are: "Active", "Pending", "Executing", "Verifying", "PendingRevert", - "RevertCancelled", "Reverting", "Reverted", "Ignored", "Expired", "Monitoring", "Resolved", - "Success", and "Error". - :paramtype current_value: str or ~azure.mgmt.sql.models.RecommendedActionCurrentState - """ - super().__init__(**kwargs) - self.current_value = current_value - self.action_initiated_by: Optional[Union[str, "_models.RecommendedActionInitiatedBy"]] = None - self.last_modified: Optional[datetime.datetime] = None - - -class RecommendedSensitivityLabelUpdate(ProxyResource): - """A recommended sensitivity label update operation. - - 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 op: Known values are: "enable" and "disable". - :vartype op: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind - :ivar schema: Schema name of the column to update. - :vartype schema: str - :ivar table: Table name of the column to update. - :vartype table: str - :ivar column: Column name to update. - :vartype column: str - """ - - _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"}, - "op": {"key": "properties.op", "type": "str"}, - "schema": {"key": "properties.schema", "type": "str"}, - "table": {"key": "properties.table", "type": "str"}, - "column": {"key": "properties.column", "type": "str"}, - } - - def __init__( - self, - *, - op: Optional[Union[str, "_models.RecommendedSensitivityLabelUpdateKind"]] = None, - schema: Optional[str] = None, - table: Optional[str] = None, - column: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword op: Known values are: "enable" and "disable". - :paramtype op: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind - :keyword schema: Schema name of the column to update. - :paramtype schema: str - :keyword table: Table name of the column to update. - :paramtype table: str - :keyword column: Column name to update. - :paramtype column: str - """ - super().__init__(**kwargs) - self.op = op - self.schema = schema - self.table = table - self.column = column - - -class RecommendedSensitivityLabelUpdateList(_serialization.Model): - """A list of recommended sensitivity label update operations. - - :ivar operations: - :vartype operations: list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] - """ - - _attribute_map = { - "operations": {"key": "operations", "type": "[RecommendedSensitivityLabelUpdate]"}, - } - - def __init__( - self, *, operations: Optional[list["_models.RecommendedSensitivityLabelUpdate"]] = None, **kwargs: Any - ) -> None: - """ - :keyword operations: - :paramtype operations: list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] - """ - super().__init__(**kwargs) - self.operations = operations - - -class RecoverableDatabase(ProxyResource): - """A recoverable database 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 edition: The edition of the database. - :vartype edition: str - :ivar service_level_objective: The service level objective name of the database. - :vartype service_level_objective: str - :ivar elastic_pool_name: The elastic pool name of the database. - :vartype elastic_pool_name: str - :ivar last_available_backup_date: The last available backup date. - :vartype last_available_backup_date: ~datetime.datetime - :ivar keys: The resource ids of the user assigned identities to use. - :vartype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "edition": {"readonly": True}, - "service_level_objective": {"readonly": True}, - "elastic_pool_name": {"readonly": True}, - "last_available_backup_date": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "edition": {"key": "properties.edition", "type": "str"}, - "service_level_objective": {"key": "properties.serviceLevelObjective", "type": "str"}, - "elastic_pool_name": {"key": "properties.elasticPoolName", "type": "str"}, - "last_available_backup_date": {"key": "properties.lastAvailableBackupDate", "type": "iso-8601"}, - "keys": {"key": "properties.keys", "type": "{DatabaseKey}"}, - } - - def __init__(self, *, keys: Optional[dict[str, "_models.DatabaseKey"]] = None, **kwargs: Any) -> None: - """ - :keyword keys: The resource ids of the user assigned identities to use. - :paramtype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - """ - super().__init__(**kwargs) - self.edition: Optional[str] = None - self.service_level_objective: Optional[str] = None - self.elastic_pool_name: Optional[str] = None - self.last_available_backup_date: Optional[datetime.datetime] = None - self.keys = keys - - -class RecoverableDatabaseListResult(_serialization.Model): - """A list of recoverable databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.RecoverableDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RecoverableDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.RecoverableDatabase"]] = None - self.next_link: Optional[str] = None - - -class RecoverableManagedDatabase(ProxyResource): - """A recoverable managed database 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 last_available_backup_date: The last available backup date. - :vartype last_available_backup_date: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "last_available_backup_date": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "last_available_backup_date": {"key": "properties.lastAvailableBackupDate", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.last_available_backup_date: Optional[str] = None - - -class RecoverableManagedDatabaseListResult(_serialization.Model): - """A list of recoverable managed databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.RecoverableManagedDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RecoverableManagedDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.RecoverableManagedDatabase"]] = None - self.next_link: Optional[str] = None - - -class RefreshExternalGovernanceStatusOperationResult(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 server_name: Server name. - :vartype server_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}, - "server_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"}, - "server_name": {"key": "properties.serverName", "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: Optional[str] = None - self.request_type: Optional[str] = None - self.queued_time: Optional[str] = None - self.server_name: Optional[str] = None - self.status: Optional[str] = None - self.error_message: Optional[str] = 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: Optional[str] = None - self.request_type: Optional[str] = None - self.queued_time: Optional[str] = None - self.managed_instance_name: Optional[str] = None - self.status: Optional[str] = None - self.error_message: Optional[str] = None - - -class Remediation(_serialization.Model): - """SQL Vulnerability Assessment remediation Details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar description: SQL Vulnerability Assessment remediation description. - :vartype description: str - :ivar scripts: SQL Vulnerability Assessment remediation script. - :vartype scripts: list[str] - :ivar automated: SQL Vulnerability Assessment is remediation automated. - :vartype automated: bool - :ivar portal_link: SQL Vulnerability Assessment optional link to remediate in Azure Portal. - :vartype portal_link: str - """ - - _validation = { - "description": {"readonly": True}, - "scripts": {"readonly": True}, - "automated": {"readonly": True}, - "portal_link": {"readonly": True}, - } - - _attribute_map = { - "description": {"key": "description", "type": "str"}, - "scripts": {"key": "scripts", "type": "[str]"}, - "automated": {"key": "automated", "type": "bool"}, - "portal_link": {"key": "portalLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.description: Optional[str] = None - self.scripts: Optional[list[str]] = None - self.automated: Optional[bool] = None - self.portal_link: Optional[str] = None - - -class ReplicationLink(ProxyResource): - """A replication link. - - 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 partner_server: Resource partner server. - :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", - "NonReadableSecondary", "Source", and "Copy". - :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar partner_role: Partner replication role. Known values are: "Primary", "Secondary", - "NonReadableSecondary", "Source", and "Copy". - :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar replication_mode: Replication mode. - :vartype replication_mode: str - :ivar start_time: Time at which the link was created. - :vartype start_time: ~datetime.datetime - :ivar percent_complete: Seeding completion percentage for the link. - :vartype percent_complete: int - :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, SUSPENDED). Known values - are: "PENDING", "SEEDING", "CATCH_UP", and "SUSPENDED". - :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). 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}, - "partner_server": {"readonly": True}, - "partner_database": {"readonly": True}, - "partner_database_id": {"readonly": True}, - "partner_location": {"readonly": True}, - "role": {"readonly": True}, - "partner_role": {"readonly": True}, - "replication_mode": {"readonly": True}, - "start_time": {"readonly": True}, - "percent_complete": {"readonly": True}, - "replication_state": {"readonly": True}, - "is_termination_allowed": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "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"}, - "replication_mode": {"key": "properties.replicationMode", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "replication_state": {"key": "properties.replicationState", "type": "str"}, - "is_termination_allowed": {"key": "properties.isTerminationAllowed", "type": "bool"}, - "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.partner_server: Optional[str] = None - self.partner_database: Optional[str] = None - self.partner_database_id: Optional[str] = None - self.partner_location: Optional[str] = None - self.role: Optional[Union[str, "_models.ReplicationRole"]] = None - self.partner_role: Optional[Union[str, "_models.ReplicationRole"]] = None - self.replication_mode: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.percent_complete: Optional[int] = None - self.replication_state: Optional[Union[str, "_models.ReplicationState"]] = None - self.is_termination_allowed: Optional[bool] = None - self.link_type = link_type - - -class ReplicationLinkListResult(_serialization.Model): - """A list of replication links. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ReplicationLink] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ReplicationLink]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ReplicationLink"]] = None - self.next_link: Optional[str] = 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. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar user_assigned_identities: The resource ids of the user assigned identities to use. - :vartype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.UserIdentity] - :ivar principal_id: The Azure Active Directory principal id. - :vartype principal_id: str - :ivar type: The identity type. Set this to 'SystemAssigned' in order to automatically create - and assign an Azure Active Directory principal for the resource. Known values are: "None", - "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :vartype type: str or ~azure.mgmt.sql.models.IdentityType - :ivar tenant_id: The Azure Active Directory tenant id. - :vartype tenant_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "user_assigned_identities": {"key": "userAssignedIdentities", "type": "{UserIdentity}"}, - "principal_id": {"key": "principalId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - } - - def __init__( - self, - *, - user_assigned_identities: Optional[dict[str, "_models.UserIdentity"]] = None, - type: Optional[Union[str, "_models.IdentityType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword user_assigned_identities: The resource ids of the user assigned identities to use. - :paramtype user_assigned_identities: dict[str, ~azure.mgmt.sql.models.UserIdentity] - :keyword type: The identity type. Set this to 'SystemAssigned' in order to automatically create - and assign an Azure Active Directory principal for the resource. Known values are: "None", - "SystemAssigned", "UserAssigned", and "SystemAssigned,UserAssigned". - :paramtype type: str or ~azure.mgmt.sql.models.IdentityType - """ - super().__init__(**kwargs) - self.user_assigned_identities = user_assigned_identities - self.principal_id: Optional[str] = None - self.type = type - self.tenant_id: Optional[str] = None - - -class ResourceMoveDefinition(_serialization.Model): - """Contains the information necessary to perform a resource move (rename). - - All required parameters must be populated in order to send to server. - - :ivar id: The target ID for the resource. Required. - :vartype id: str - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The target ID for the resource. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class RestorableDroppedDatabase(ProxyResource): - """A restorable dropped database 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 sku: The name and tier of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar location: Resource location. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar database_name: The name of the database. - :vartype database_name: str - :ivar max_size_bytes: The max size of the database expressed in bytes. - :vartype max_size_bytes: int - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: ~datetime.datetime - :ivar deletion_date: The deletion date of the database (ISO8601 format). - :vartype deletion_date: ~datetime.datetime - :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). - :vartype earliest_restore_date: ~datetime.datetime - :ivar backup_storage_redundancy: The storage account type used to store backups for this - database. Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy - :ivar keys: The resource ids of the user assigned identities to use. - :vartype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "database_name": {"readonly": True}, - "max_size_bytes": {"readonly": True}, - "creation_date": {"readonly": True}, - "deletion_date": {"readonly": True}, - "earliest_restore_date": {"readonly": True}, - "backup_storage_redundancy": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "sku": {"key": "sku", "type": "Sku"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "max_size_bytes": {"key": "properties.maxSizeBytes", "type": "int"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "deletion_date": {"key": "properties.deletionDate", "type": "iso-8601"}, - "earliest_restore_date": {"key": "properties.earliestRestoreDate", "type": "iso-8601"}, - "backup_storage_redundancy": {"key": "properties.backupStorageRedundancy", "type": "str"}, - "keys": {"key": "properties.keys", "type": "{DatabaseKey}"}, - } - - def __init__( - self, - *, - sku: Optional["_models.Sku"] = None, - location: Optional[str] = None, - tags: Optional[dict[str, str]] = None, - keys: Optional[dict[str, "_models.DatabaseKey"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: The name and tier of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword location: Resource location. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword keys: The resource ids of the user assigned identities to use. - :paramtype keys: dict[str, ~azure.mgmt.sql.models.DatabaseKey] - """ - super().__init__(**kwargs) - self.sku = sku - self.location = location - self.tags = tags - self.database_name: Optional[str] = None - self.max_size_bytes: Optional[int] = None - self.creation_date: Optional[datetime.datetime] = None - self.deletion_date: Optional[datetime.datetime] = None - self.earliest_restore_date: Optional[datetime.datetime] = None - self.backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None - self.keys = keys - - -class RestorableDroppedDatabaseListResult(_serialization.Model): - """A list of restorable dropped databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.RestorableDroppedDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableDroppedDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.RestorableDroppedDatabase"]] = None - self.next_link: Optional[str] = None - - -class RestorableDroppedManagedDatabase(TrackedResource): - """A restorable dropped managed database resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar database_name: The name of the database. - :vartype database_name: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: ~datetime.datetime - :ivar deletion_date: The deletion date of the database (ISO8601 format). - :vartype deletion_date: ~datetime.datetime - :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). - :vartype earliest_restore_date: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "database_name": {"readonly": True}, - "creation_date": {"readonly": True}, - "deletion_date": {"readonly": True}, - "earliest_restore_date": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "deletion_date": {"key": "properties.deletionDate", "type": "iso-8601"}, - "earliest_restore_date": {"key": "properties.earliestRestoreDate", "type": "iso-8601"}, - } - - def __init__(self, *, location: str, tags: Optional[dict[str, str]] = None, **kwargs: Any) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - """ - super().__init__(location=location, tags=tags, **kwargs) - self.database_name: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.deletion_date: Optional[datetime.datetime] = None - self.earliest_restore_date: Optional[datetime.datetime] = None - - -class RestorableDroppedManagedDatabaseListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of restorable dropped managed databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.RestorableDroppedManagedDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorableDroppedManagedDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.RestorableDroppedManagedDatabase"]] = None - self.next_link: Optional[str] = None - - -class RestorePoint(ProxyResource): - """Database restore points. - - 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 location: Resource location. - :vartype location: str - :ivar restore_point_type: The type of restore point. Known values are: "CONTINUOUS" and - "DISCRETE". - :vartype restore_point_type: str or ~azure.mgmt.sql.models.RestorePointType - :ivar earliest_restore_date: The earliest time to which this database can be restored. - :vartype earliest_restore_date: ~datetime.datetime - :ivar restore_point_creation_date: The time the backup was taken. - :vartype restore_point_creation_date: ~datetime.datetime - :ivar restore_point_label: The label of restore point for backup request by user. - :vartype restore_point_label: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "restore_point_type": {"readonly": True}, - "earliest_restore_date": {"readonly": True}, - "restore_point_creation_date": {"readonly": True}, - "restore_point_label": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "restore_point_type": {"key": "properties.restorePointType", "type": "str"}, - "earliest_restore_date": {"key": "properties.earliestRestoreDate", "type": "iso-8601"}, - "restore_point_creation_date": {"key": "properties.restorePointCreationDate", "type": "iso-8601"}, - "restore_point_label": {"key": "properties.restorePointLabel", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.restore_point_type: Optional[Union[str, "_models.RestorePointType"]] = None - self.earliest_restore_date: Optional[datetime.datetime] = None - self.restore_point_creation_date: Optional[datetime.datetime] = None - self.restore_point_label: Optional[str] = None - - -class RestorePointListResult(_serialization.Model): - """A list of long term retention backups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.RestorePoint] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[RestorePoint]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.RestorePoint"]] = None - self.next_link: Optional[str] = None - - -class ScheduleItem(_serialization.Model): - """Schedule info describing when the server should be started or stopped. - - All required parameters must be populated in order to send to server. - - :ivar start_day: Start day. Required. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype start_day: str or ~azure.mgmt.sql.models.DayOfWeek - :ivar start_time: Start time. Required. - :vartype start_time: str - :ivar stop_day: Stop day. Required. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :vartype stop_day: str or ~azure.mgmt.sql.models.DayOfWeek - :ivar stop_time: Stop time. Required. - :vartype stop_time: str - """ - - _validation = { - "start_day": {"required": True}, - "start_time": {"required": True}, - "stop_day": {"required": True}, - "stop_time": {"required": True}, - } - - _attribute_map = { - "start_day": {"key": "startDay", "type": "str"}, - "start_time": {"key": "startTime", "type": "str"}, - "stop_day": {"key": "stopDay", "type": "str"}, - "stop_time": {"key": "stopTime", "type": "str"}, - } - - def __init__( - self, - *, - start_day: Union[str, "_models.DayOfWeek"], - start_time: str, - stop_day: Union[str, "_models.DayOfWeek"], - stop_time: str, - **kwargs: Any - ) -> None: - """ - :keyword start_day: Start day. Required. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype start_day: str or ~azure.mgmt.sql.models.DayOfWeek - :keyword start_time: Start time. Required. - :paramtype start_time: str - :keyword stop_day: Stop day. Required. Known values are: "Sunday", "Monday", "Tuesday", - "Wednesday", "Thursday", "Friday", and "Saturday". - :paramtype stop_day: str or ~azure.mgmt.sql.models.DayOfWeek - :keyword stop_time: Stop time. Required. - :paramtype stop_time: str - """ - super().__init__(**kwargs) - self.start_day = start_day - self.start_time = start_time - self.stop_day = stop_day - self.stop_time = stop_time - - -class SecurityEvent(ProxyResource): - """A security event. - - 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 event_time: The time when the security event occurred. - :vartype event_time: ~datetime.datetime - :ivar security_event_type: The type of the security event. Known values are: "Undefined", - "SqlInjectionVulnerability", and "SqlInjectionExploit". - :vartype security_event_type: str or ~azure.mgmt.sql.models.SecurityEventType - :ivar subscription: The subscription name. - :vartype subscription: str - :ivar server: The server name. - :vartype server: str - :ivar database: The database name. - :vartype database: str - :ivar client_ip: The IP address of the client who executed the statement. - :vartype client_ip: str - :ivar application_name: The application used to execute the statement. - :vartype application_name: str - :ivar principal_name: The principal user who executed the statement. - :vartype principal_name: str - :ivar security_event_sql_injection_additional_properties: The sql injection additional - properties, populated only if the type of the security event is sql injection. - :vartype security_event_sql_injection_additional_properties: - ~azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "event_time": {"readonly": True}, - "security_event_type": {"readonly": True}, - "subscription": {"readonly": True}, - "server": {"readonly": True}, - "database": {"readonly": True}, - "client_ip": {"readonly": True}, - "application_name": {"readonly": True}, - "principal_name": {"readonly": True}, - "security_event_sql_injection_additional_properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "event_time": {"key": "properties.eventTime", "type": "iso-8601"}, - "security_event_type": {"key": "properties.securityEventType", "type": "str"}, - "subscription": {"key": "properties.subscription", "type": "str"}, - "server": {"key": "properties.server", "type": "str"}, - "database": {"key": "properties.database", "type": "str"}, - "client_ip": {"key": "properties.clientIp", "type": "str"}, - "application_name": {"key": "properties.applicationName", "type": "str"}, - "principal_name": {"key": "properties.principalName", "type": "str"}, - "security_event_sql_injection_additional_properties": { - "key": "properties.securityEventSqlInjectionAdditionalProperties", - "type": "SecurityEventSqlInjectionAdditionalProperties", - }, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.event_time: Optional[datetime.datetime] = None - self.security_event_type: Optional[Union[str, "_models.SecurityEventType"]] = None - self.subscription: Optional[str] = None - self.server: Optional[str] = None - self.database: Optional[str] = None - self.client_ip: Optional[str] = None - self.application_name: Optional[str] = None - self.principal_name: Optional[str] = None - self.security_event_sql_injection_additional_properties: Optional[ - "_models.SecurityEventSqlInjectionAdditionalProperties" - ] = None - - -class SecurityEventCollection(_serialization.Model): - """A list of security events. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SecurityEvent] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SecurityEvent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SecurityEvent"]] = None - self.next_link: Optional[str] = None - - -class SecurityEventsFilterParameters(_serialization.Model): - """The properties that are supported in the $filter operation. - - :ivar event_time: Filter on the event time. - :vartype event_time: ~datetime.datetime - :ivar show_server_records: Whether to show server records or not. - :vartype show_server_records: bool - """ - - _attribute_map = { - "event_time": {"key": "eventTime", "type": "iso-8601"}, - "show_server_records": {"key": "showServerRecords", "type": "bool"}, - } - - def __init__( - self, - *, - event_time: Optional[datetime.datetime] = None, - show_server_records: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword event_time: Filter on the event time. - :paramtype event_time: ~datetime.datetime - :keyword show_server_records: Whether to show server records or not. - :paramtype show_server_records: bool - """ - super().__init__(**kwargs) - self.event_time = event_time - self.show_server_records = show_server_records - - -class SecurityEventSqlInjectionAdditionalProperties(_serialization.Model): # pylint: disable=name-too-long - """The properties of a security event sql injection additional properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar threat_id: The threat ID. - :vartype threat_id: str - :ivar statement: The statement. - :vartype statement: str - :ivar statement_highlight_offset: The statement highlight offset. - :vartype statement_highlight_offset: int - :ivar statement_highlight_length: The statement highlight length. - :vartype statement_highlight_length: int - :ivar error_code: The sql error code. - :vartype error_code: int - :ivar error_severity: The sql error severity. - :vartype error_severity: int - :ivar error_message: The sql error message. - :vartype error_message: str - """ - - _validation = { - "threat_id": {"readonly": True}, - "statement": {"readonly": True}, - "statement_highlight_offset": {"readonly": True}, - "statement_highlight_length": {"readonly": True}, - "error_code": {"readonly": True}, - "error_severity": {"readonly": True}, - "error_message": {"readonly": True}, - } - - _attribute_map = { - "threat_id": {"key": "threatId", "type": "str"}, - "statement": {"key": "statement", "type": "str"}, - "statement_highlight_offset": {"key": "statementHighlightOffset", "type": "int"}, - "statement_highlight_length": {"key": "statementHighlightLength", "type": "int"}, - "error_code": {"key": "errorCode", "type": "int"}, - "error_severity": {"key": "errorSeverity", "type": "int"}, - "error_message": {"key": "errorMessage", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.threat_id: Optional[str] = None - self.statement: Optional[str] = None - self.statement_highlight_offset: Optional[int] = None - self.statement_highlight_length: Optional[int] = None - self.error_code: Optional[int] = None - self.error_severity: Optional[int] = None - self.error_message: Optional[str] = None - - -class SensitivityLabel(ProxyResource): - """A sensitivity label. - - 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 managed_by: Resource that manages the sensitivity label. - :vartype managed_by: str - :ivar schema_name: The schema name. - :vartype schema_name: str - :ivar table_name: The table name. - :vartype table_name: str - :ivar column_name: The column name. - :vartype column_name: str - :ivar label_name: The label name. - :vartype label_name: str - :ivar label_id: The label ID. - :vartype label_id: str - :ivar information_type: The information type. - :vartype information_type: str - :ivar information_type_id: The information type ID. - :vartype information_type_id: str - :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for recommended - sensitivity label only. Specifies whether the sensitivity recommendation on this column is - disabled (dismissed) or not. - :vartype is_disabled: bool - :ivar rank: Known values are: "None", "Low", "Medium", "High", and "Critical". - :vartype rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank - :ivar client_classification_source: Known values are: "None", "Native", "Recommended", and - "MIP". - :vartype client_classification_source: str or ~azure.mgmt.sql.models.ClientClassificationSource - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "managed_by": {"readonly": True}, - "schema_name": {"readonly": True}, - "table_name": {"readonly": True}, - "column_name": {"readonly": True}, - "is_disabled": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "managed_by": {"key": "managedBy", "type": "str"}, - "schema_name": {"key": "properties.schemaName", "type": "str"}, - "table_name": {"key": "properties.tableName", "type": "str"}, - "column_name": {"key": "properties.columnName", "type": "str"}, - "label_name": {"key": "properties.labelName", "type": "str"}, - "label_id": {"key": "properties.labelId", "type": "str"}, - "information_type": {"key": "properties.informationType", "type": "str"}, - "information_type_id": {"key": "properties.informationTypeId", "type": "str"}, - "is_disabled": {"key": "properties.isDisabled", "type": "bool"}, - "rank": {"key": "properties.rank", "type": "str"}, - "client_classification_source": {"key": "properties.clientClassificationSource", "type": "str"}, - } - - def __init__( - self, - *, - label_name: Optional[str] = None, - label_id: Optional[str] = None, - information_type: Optional[str] = None, - information_type_id: Optional[str] = None, - rank: Optional[Union[str, "_models.SensitivityLabelRank"]] = None, - client_classification_source: Optional[Union[str, "_models.ClientClassificationSource"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword label_name: The label name. - :paramtype label_name: str - :keyword label_id: The label ID. - :paramtype label_id: str - :keyword information_type: The information type. - :paramtype information_type: str - :keyword information_type_id: The information type ID. - :paramtype information_type_id: str - :keyword rank: Known values are: "None", "Low", "Medium", "High", and "Critical". - :paramtype rank: str or ~azure.mgmt.sql.models.SensitivityLabelRank - :keyword client_classification_source: Known values are: "None", "Native", "Recommended", and - "MIP". - :paramtype client_classification_source: str or - ~azure.mgmt.sql.models.ClientClassificationSource - """ - super().__init__(**kwargs) - self.managed_by: Optional[str] = None - self.schema_name: Optional[str] = None - self.table_name: Optional[str] = None - self.column_name: Optional[str] = None - self.label_name = label_name - self.label_id = label_id - self.information_type = information_type - self.information_type_id = information_type_id - self.is_disabled: Optional[bool] = None - self.rank = rank - self.client_classification_source = client_classification_source - - -class SensitivityLabelListResult(_serialization.Model): - """A list of sensitivity labels. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SensitivityLabel] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SensitivityLabel]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SensitivityLabel"]] = None - self.next_link: Optional[str] = None - - -class SensitivityLabelUpdate(ProxyResource): - """A sensitivity label update operation. - - 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 op: Known values are: "set" and "remove". - :vartype op: str or ~azure.mgmt.sql.models.SensitivityLabelUpdateKind - :ivar schema: Schema name of the column to update. - :vartype schema: str - :ivar table: Table name of the column to update. - :vartype table: str - :ivar column: Column name to update. - :vartype column: str - :ivar sensitivity_label: The sensitivity label information to apply on a column. - :vartype sensitivity_label: ~azure.mgmt.sql.models.SensitivityLabel - """ - - _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"}, - "op": {"key": "properties.op", "type": "str"}, - "schema": {"key": "properties.schema", "type": "str"}, - "table": {"key": "properties.table", "type": "str"}, - "column": {"key": "properties.column", "type": "str"}, - "sensitivity_label": {"key": "properties.sensitivityLabel", "type": "SensitivityLabel"}, - } - - def __init__( - self, - *, - op: Optional[Union[str, "_models.SensitivityLabelUpdateKind"]] = None, - schema: Optional[str] = None, - table: Optional[str] = None, - column: Optional[str] = None, - sensitivity_label: Optional["_models.SensitivityLabel"] = None, - **kwargs: Any - ) -> None: - """ - :keyword op: Known values are: "set" and "remove". - :paramtype op: str or ~azure.mgmt.sql.models.SensitivityLabelUpdateKind - :keyword schema: Schema name of the column to update. - :paramtype schema: str - :keyword table: Table name of the column to update. - :paramtype table: str - :keyword column: Column name to update. - :paramtype column: str - :keyword sensitivity_label: The sensitivity label information to apply on a column. - :paramtype sensitivity_label: ~azure.mgmt.sql.models.SensitivityLabel - """ - super().__init__(**kwargs) - self.op = op - self.schema = schema - self.table = table - self.column = column - self.sensitivity_label = sensitivity_label - - -class SensitivityLabelUpdateList(_serialization.Model): - """A list of sensitivity label update operations. - - :ivar operations: - :vartype operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] - """ - - _attribute_map = { - "operations": {"key": "operations", "type": "[SensitivityLabelUpdate]"}, - } - - def __init__(self, *, operations: Optional[list["_models.SensitivityLabelUpdate"]] = None, **kwargs: Any) -> None: - """ - :keyword operations: - :paramtype operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] - """ - super().__init__(**kwargs) - self.operations = operations - - -class Server(TrackedResource): - """An Azure SQL Database server. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar identity: The Azure Active Directory identity of the server. - :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity - :ivar kind: Kind of sql server. This is metadata used for the Azure portal experience. - :vartype kind: str - :ivar administrator_login: Administrator username for the server. Once created it cannot be - changed. - :vartype administrator_login: str - :ivar administrator_login_password: The administrator login password (required for server - creation). - :vartype administrator_login_password: str - :ivar version: The version of the server. - :vartype version: str - :ivar state: The state of the server. - :vartype state: str - :ivar fully_qualified_domain_name: The fully qualified domain name of the server. - :vartype fully_qualified_domain_name: str - :ivar private_endpoint_connections: List of private endpoint connections on a server. - :vartype private_endpoint_connections: - list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] - :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', - '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". - :vartype minimal_tls_version: str or ~azure.mgmt.sql.models.MinimalTlsVersion - :ivar public_network_access: Whether or not public endpoint access is allowed for this server. - Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'. - Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccessFlag - :ivar workspace_feature: Whether or not existing server has a workspace created and if it - allows connection from workspace. Known values are: "Connected" and "Disconnected". - :vartype workspace_feature: str or ~azure.mgmt.sql.models.ServerWorkspaceFeature - :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used - by default. - :vartype primary_user_assigned_identity_id: str - :ivar federated_client_id: The Client id used for cross tenant CMK scenario. - :vartype federated_client_id: str - :ivar key_id: A CMK URI of the key to use for encryption. - :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator can be utilized during server - creation and for server updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :vartype administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator - :ivar restrict_outbound_network_access: Whether or not to restrict outbound network access for - this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values - are: "Enabled" and "Disabled". - :vartype restrict_outbound_network_access: str or - ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :ivar is_i_pv6_enabled: Whether or not to enable IPv6 support for this server. Value is - optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and - "Disabled". - :vartype is_i_pv6_enabled: str or ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :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 retention_days: Number of days this server will stay soft-deleted. - :vartype retention_days: int - :ivar create_mode: Create mode for server, only valid values for this are Normal and Restore. - Known values are: "Normal" and "Restore". - :vartype create_mode: str or ~azure.mgmt.sql.models.ServerCreateMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "kind": {"readonly": True}, - "state": {"readonly": True}, - "fully_qualified_domain_name": {"readonly": True}, - "private_endpoint_connections": {"readonly": True}, - "workspace_feature": {"readonly": True}, - "external_governance_status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "kind": {"key": "kind", "type": "str"}, - "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "fully_qualified_domain_name": {"key": "properties.fullyQualifiedDomainName", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[ServerPrivateEndpointConnection]", - }, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "workspace_feature": {"key": "properties.workspaceFeature", "type": "str"}, - "primary_user_assigned_identity_id": {"key": "properties.primaryUserAssignedIdentityId", "type": "str"}, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - "key_id": {"key": "properties.keyId", "type": "str"}, - "administrators": {"key": "properties.administrators", "type": "ServerExternalAdministrator"}, - "restrict_outbound_network_access": {"key": "properties.restrictOutboundNetworkAccess", "type": "str"}, - "is_i_pv6_enabled": {"key": "properties.isIPv6Enabled", "type": "str"}, - "external_governance_status": {"key": "properties.externalGovernanceStatus", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - } - - def __init__( - self, - *, - location: str, - tags: Optional[dict[str, str]] = None, - identity: Optional["_models.ResourceIdentity"] = None, - administrator_login: Optional[str] = None, - administrator_login_password: Optional[str] = None, - version: Optional[str] = None, - minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, - public_network_access: Optional[Union[str, "_models.ServerPublicNetworkAccessFlag"]] = None, - primary_user_assigned_identity_id: Optional[str] = None, - federated_client_id: Optional[str] = None, - key_id: Optional[str] = None, - administrators: Optional["_models.ServerExternalAdministrator"] = None, - restrict_outbound_network_access: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, - is_i_pv6_enabled: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, - retention_days: Optional[int] = None, - create_mode: Optional[Union[str, "_models.ServerCreateMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword identity: The Azure Active Directory identity of the server. - :paramtype identity: ~azure.mgmt.sql.models.ResourceIdentity - :keyword administrator_login: Administrator username for the server. Once created it cannot be - changed. - :paramtype administrator_login: str - :keyword administrator_login_password: The administrator login password (required for server - creation). - :paramtype administrator_login_password: str - :keyword version: The version of the server. - :paramtype version: str - :keyword minimal_tls_version: Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', - '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". - :paramtype minimal_tls_version: str or ~azure.mgmt.sql.models.MinimalTlsVersion - :keyword public_network_access: Whether or not public endpoint access is allowed for this - server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or - 'SecuredByPerimeter'. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccessFlag - :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be - used by default. - :paramtype primary_user_assigned_identity_id: str - :keyword federated_client_id: The Client id used for cross tenant CMK scenario. - :paramtype federated_client_id: str - :keyword key_id: A CMK URI of the key to use for encryption. - :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator can be utilized during server - creation and for server updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :paramtype administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator - :keyword restrict_outbound_network_access: Whether or not to restrict outbound network access - for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known - values are: "Enabled" and "Disabled". - :paramtype restrict_outbound_network_access: str or - ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :keyword is_i_pv6_enabled: Whether or not to enable IPv6 support for this server. Value is - optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and - "Disabled". - :paramtype is_i_pv6_enabled: str or ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :keyword retention_days: Number of days this server will stay soft-deleted. - :paramtype retention_days: int - :keyword create_mode: Create mode for server, only valid values for this are Normal and - Restore. Known values are: "Normal" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.sql.models.ServerCreateMode - """ - super().__init__(location=location, tags=tags, **kwargs) - self.identity = identity - self.kind: Optional[str] = None - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.version = version - self.state: Optional[str] = None - self.fully_qualified_domain_name: Optional[str] = None - self.private_endpoint_connections: Optional[list["_models.ServerPrivateEndpointConnection"]] = None - self.minimal_tls_version = minimal_tls_version - self.public_network_access = public_network_access - self.workspace_feature: Optional[Union[str, "_models.ServerWorkspaceFeature"]] = None - self.primary_user_assigned_identity_id = primary_user_assigned_identity_id - self.federated_client_id = federated_client_id - self.key_id = key_id - self.administrators = administrators - self.restrict_outbound_network_access = restrict_outbound_network_access - self.is_i_pv6_enabled = is_i_pv6_enabled - self.external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = None - self.retention_days = retention_days - self.create_mode = create_mode - - -class ServerAdvancedThreatProtection(ProxyResource): - """A server Advanced Threat Protection. - - 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 system_data: SystemData of AdvancedThreatProtectionResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.AdvancedThreatProtectionState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the Advanced Threat Protection, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "New", "Enabled", and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.AdvancedThreatProtectionState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.creation_time: Optional[datetime.datetime] = None - - -class ServerAutomaticTuning(ProxyResource): - """Server-level Automatic Tuning. - - 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 desired_state: Automatic tuning desired state. Known values are: "Custom", "Auto", and - "Unspecified". - :vartype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningServerMode - :ivar actual_state: Automatic tuning actual state. Known values are: "Custom", "Auto", and - "Unspecified". - :vartype actual_state: str or ~azure.mgmt.sql.models.AutomaticTuningServerMode - :ivar options: Automatic tuning options definition. - :vartype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningServerOptions] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "actual_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "desired_state": {"key": "properties.desiredState", "type": "str"}, - "actual_state": {"key": "properties.actualState", "type": "str"}, - "options": {"key": "properties.options", "type": "{AutomaticTuningServerOptions}"}, - } - - def __init__( - self, - *, - desired_state: Optional[Union[str, "_models.AutomaticTuningServerMode"]] = None, - options: Optional[dict[str, "_models.AutomaticTuningServerOptions"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword desired_state: Automatic tuning desired state. Known values are: "Custom", "Auto", and - "Unspecified". - :paramtype desired_state: str or ~azure.mgmt.sql.models.AutomaticTuningServerMode - :keyword options: Automatic tuning options definition. - :paramtype options: dict[str, ~azure.mgmt.sql.models.AutomaticTuningServerOptions] - """ - super().__init__(**kwargs) - self.desired_state = desired_state - self.actual_state: Optional[Union[str, "_models.AutomaticTuningServerMode"]] = None - self.options = options - - -class ServerAzureADAdministrator(ProxyResource): - """Azure Active Directory administrator. - - 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 administrator_type: Type of the sever administrator. "ActiveDirectory" - :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :ivar login: Login name of the server administrator. - :vartype login: str - :ivar sid: SID (object ID) of the server administrator. - :vartype sid: str - :ivar tenant_id: Tenant ID of the administrator. - :vartype tenant_id: str - :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :vartype azure_ad_only_authentication: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "azure_ad_only_authentication": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "administrator_type": {"key": "properties.administratorType", "type": "str"}, - "login": {"key": "properties.login", "type": "str"}, - "sid": {"key": "properties.sid", "type": "str"}, - "tenant_id": {"key": "properties.tenantId", "type": "str"}, - "azure_ad_only_authentication": {"key": "properties.azureADOnlyAuthentication", "type": "bool"}, - } - - def __init__( - self, - *, - administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, - login: Optional[str] = None, - sid: Optional[str] = None, - tenant_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword administrator_type: Type of the sever administrator. "ActiveDirectory" - :paramtype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :keyword login: Login name of the server administrator. - :paramtype login: str - :keyword sid: SID (object ID) of the server administrator. - :paramtype sid: str - :keyword tenant_id: Tenant ID of the administrator. - :paramtype tenant_id: str - """ - super().__init__(**kwargs) - self.administrator_type = administrator_type - self.login = login - self.sid = sid - self.tenant_id = tenant_id - self.azure_ad_only_authentication: Optional[bool] = None - - -class ServerAzureADOnlyAuthentication(ProxyResource): - """Azure Active Directory only authentication. - - 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 azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :vartype azure_ad_only_authentication: bool - """ - - _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"}, - "azure_ad_only_authentication": {"key": "properties.azureADOnlyAuthentication", "type": "bool"}, - } - - def __init__(self, *, azure_ad_only_authentication: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :paramtype azure_ad_only_authentication: bool - """ - super().__init__(**kwargs) - self.azure_ad_only_authentication = azure_ad_only_authentication - - -class ServerBlobAuditingPolicy(ProxyResource): - """A server blob auditing policy. - - 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 is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, devops - logs will be sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled', - 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true - - When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should also be created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_devops_audit_enabled: bool - :ivar retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :vartype retention_days: int - :ivar audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :vartype audit_actions_and_groups: list[str] - :ivar is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the - storage's secondary key. - :vartype is_storage_secondary_key_in_use: bool - :ivar is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_azure_monitor_target_enabled: bool - :ivar queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before audit - actions are forced to be processed. The default minimum value is 1000 (1 second). The maximum - is 2,147,483,647. - :vartype queue_delay_ms: int - :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :vartype is_managed_identity_in_use: bool - :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :vartype storage_account_access_key: str - :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. - :vartype storage_account_subscription_id: str - """ - - _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"}, - "is_devops_audit_enabled": {"key": "properties.isDevopsAuditEnabled", "type": "bool"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "audit_actions_and_groups": {"key": "properties.auditActionsAndGroups", "type": "[str]"}, - "is_storage_secondary_key_in_use": {"key": "properties.isStorageSecondaryKeyInUse", "type": "bool"}, - "is_azure_monitor_target_enabled": {"key": "properties.isAzureMonitorTargetEnabled", "type": "bool"}, - "queue_delay_ms": {"key": "properties.queueDelayMs", "type": "int"}, - "is_managed_identity_in_use": {"key": "properties.isManagedIdentityInUse", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "storage_account_subscription_id": {"key": "properties.storageAccountSubscriptionId", "type": "str"}, - } - - def __init__( - self, - *, - is_devops_audit_enabled: Optional[bool] = None, - retention_days: Optional[int] = None, - audit_actions_and_groups: Optional[list[str]] = None, - is_storage_secondary_key_in_use: Optional[bool] = None, - is_azure_monitor_target_enabled: Optional[bool] = None, - queue_delay_ms: Optional[int] = None, - is_managed_identity_in_use: Optional[bool] = None, - state: Optional[Union[str, "_models.BlobAuditingPolicyState"]] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - storage_account_subscription_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword is_devops_audit_enabled: Specifies the state of devops audit. If state is Enabled, - devops logs will be sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled', - 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true - - When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should also be created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_devops_audit_enabled: bool - :keyword retention_days: Specifies the number of days to keep in the audit logs in the storage - account. - :paramtype retention_days: int - :keyword audit_actions_and_groups: Specifies the Actions-Groups and Actions to audit. - - The recommended set of action groups to use is the following combination - this will audit all - the queries and stored procedures executed against the database, as well as successful and - failed logins: - - BATCH_COMPLETED_GROUP, - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, - FAILED_DATABASE_AUTHENTICATION_GROUP. - - This above combination is also the set that is configured by default when enabling auditing - from the Azure portal. - - The supported action groups to audit are (note: choose only specific groups that cover your - auditing needs. Using unnecessary groups could lead to very large quantities of audit records): - - APPLICATION_ROLE_CHANGE_PASSWORD_GROUP - BACKUP_RESTORE_GROUP - DATABASE_LOGOUT_GROUP - DATABASE_OBJECT_CHANGE_GROUP - DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP - DATABASE_OBJECT_PERMISSION_CHANGE_GROUP - DATABASE_OPERATION_GROUP - DATABASE_PERMISSION_CHANGE_GROUP - DATABASE_PRINCIPAL_CHANGE_GROUP - DATABASE_PRINCIPAL_IMPERSONATION_GROUP - DATABASE_ROLE_MEMBER_CHANGE_GROUP - FAILED_DATABASE_AUTHENTICATION_GROUP - SCHEMA_OBJECT_ACCESS_GROUP - SCHEMA_OBJECT_CHANGE_GROUP - SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP - SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP - SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP - USER_CHANGE_PASSWORD_GROUP - BATCH_STARTED_GROUP - BATCH_COMPLETED_GROUP - DBCC_GROUP - DATABASE_OWNERSHIP_CHANGE_GROUP - DATABASE_CHANGE_GROUP - LEDGER_OPERATION_GROUP - - These are groups that cover all sql statements and stored procedures executed against the - database, and should not be used in combination with other groups as this will result in - duplicate audit logs. - - For more information, see `Database-Level Audit Action Groups - `_. - - For Database auditing policy, specific Actions can also be specified (note that Actions cannot - be specified for Server auditing policy). The supported actions to audit are: - SELECT - UPDATE - INSERT - DELETE - EXECUTE - RECEIVE - REFERENCES - - The general form for defining an action to be audited is: - {action} ON {object} BY {principal} - - Note that :code:`` in the above format can refer to an object like a table, view, or - stored procedure, or an entire database or schema. For the latter cases, the forms - DATABASE::{db_name} and SCHEMA::{schema_name} are used, respectively. - - For example: - SELECT on dbo.myTable by public - SELECT on DATABASE::myDatabase by public - SELECT on SCHEMA::mySchema by public - - For more information, see `Database-Level Audit Actions - `_. - :paramtype audit_actions_and_groups: list[str] - :keyword is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is - the storage's secondary key. - :paramtype is_storage_secondary_key_in_use: bool - :keyword is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' - diagnostic logs category on the database should be also created. - Note that for server level audit you should use the 'master' database as {databaseName}. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_azure_monitor_target_enabled: bool - :keyword queue_delay_ms: Specifies the amount of time in milliseconds that can elapse before - audit actions are forced to be processed. The default minimum value is 1000 (1 second). The - maximum is 2,147,483,647. - :paramtype queue_delay_ms: int - :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :paramtype is_managed_identity_in_use: bool - :keyword state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the auditing storage - account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :paramtype storage_account_access_key: str - :keyword storage_account_subscription_id: Specifies the blob storage subscription Id. - :paramtype storage_account_subscription_id: str - """ - super().__init__(**kwargs) - self.is_devops_audit_enabled = is_devops_audit_enabled - self.retention_days = retention_days - self.audit_actions_and_groups = audit_actions_and_groups - self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use - self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled - self.queue_delay_ms = queue_delay_ms - self.is_managed_identity_in_use = is_managed_identity_in_use - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.storage_account_subscription_id = storage_account_subscription_id - - -class ServerBlobAuditingPolicyListResult(_serialization.Model): - """A list of server auditing settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerBlobAuditingPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerBlobAuditingPolicy"]] = None - self.next_link: Optional[str] = None - - -class ServerConfigurationOption(ProxyResource): - """A server configuration option. - - 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 server_configuration_option_value: Value of the server configuration option. - :vartype server_configuration_option_value: int - :ivar provisioning_state: Provisioning state of server configuration option. Known values are: - "Created", "InProgress", "Succeeded", "Failed", and "Canceled". - :vartype provisioning_state: str or ~azure.mgmt.sql.models.ProvisioningState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "provisioning_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "server_configuration_option_value": {"key": "properties.serverConfigurationOptionValue", "type": "int"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - } - - def __init__(self, *, server_configuration_option_value: Optional[int] = None, **kwargs: Any) -> None: - """ - :keyword server_configuration_option_value: Value of the server configuration option. - :paramtype server_configuration_option_value: int - """ - super().__init__(**kwargs) - self.server_configuration_option_value = server_configuration_option_value - self.provisioning_state: Optional[Union[str, "_models.ProvisioningState"]] = None - - -class ServerConfigurationOptionListResult(_serialization.Model): - """A list of server configuration options. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerConfigurationOption] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerConfigurationOption]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerConfigurationOption"]] = None - self.next_link: Optional[str] = None - - -class ServerConnectionPolicy(ProxyResource): - """A server connection policy. - - 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 location: Resource location. - :vartype location: str - :ivar kind: Metadata used for the Azure portal experience. - :vartype kind: str - :ivar connection_type: The server connection type. Known values are: "Default", "Redirect", and - "Proxy". - :vartype connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"readonly": True}, - "kind": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "connection_type": {"key": "properties.connectionType", "type": "str"}, - } - - def __init__( - self, *, connection_type: Optional[Union[str, "_models.ServerConnectionType"]] = None, **kwargs: Any - ) -> None: - """ - :keyword connection_type: The server connection type. Known values are: "Default", "Redirect", - and "Proxy". - :paramtype connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType - """ - super().__init__(**kwargs) - self.location: Optional[str] = None - self.kind: Optional[str] = None - self.connection_type = connection_type - - -class ServerConnectionPolicyListResult(_serialization.Model): - """A list of server connection policy objects. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerConnectionPolicy] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerConnectionPolicy]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerConnectionPolicy"]] = None - self.next_link: Optional[str] = None - - -class ServerDevOpsAuditingSettings(ProxyResource): - """A server DevOps auditing settings. - - 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 system_data: SystemData of ServerDevOpsAuditSettingsResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar is_azure_monitor_target_enabled: Specifies whether DevOps audit events are sent to Azure - Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should be also created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :vartype is_azure_monitor_target_enabled: bool - :ivar is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :vartype is_managed_identity_in_use: bool - :ivar state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :vartype storage_account_access_key: str - :ivar storage_account_subscription_id: Specifies the blob storage subscription Id. - :vartype storage_account_subscription_id: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "is_azure_monitor_target_enabled": {"key": "properties.isAzureMonitorTargetEnabled", "type": "bool"}, - "is_managed_identity_in_use": {"key": "properties.isManagedIdentityInUse", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "storage_account_subscription_id": {"key": "properties.storageAccountSubscriptionId", "type": "str"}, - } - - def __init__( - self, - *, - is_azure_monitor_target_enabled: Optional[bool] = None, - is_managed_identity_in_use: Optional[bool] = None, - state: Optional[Union[str, "_models.BlobAuditingPolicyState"]] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - storage_account_subscription_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword is_azure_monitor_target_enabled: Specifies whether DevOps audit events are sent to - Azure Monitor. - In order to send the events to Azure Monitor, specify 'State' as 'Enabled' and - 'IsAzureMonitorTargetEnabled' as true. - - When using REST API to configure DevOps audit, Diagnostic Settings with 'DevOpsOperationsAudit' - diagnostic logs category on the master database should be also created. - - Diagnostic Settings URI format: - PUT - https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview - - For more information, see `Diagnostic Settings REST API - `_ - or `Diagnostic Settings PowerShell `_. - :paramtype is_azure_monitor_target_enabled: bool - :keyword is_managed_identity_in_use: Specifies whether Managed Identity is used to access blob - storage. - :paramtype is_managed_identity_in_use: bool - :keyword state: Specifies the state of the audit. If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled are required. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or - isAzureMonitorTargetEnabled is required. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the auditing storage - account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed identity to access the - storage. - Prerequisites for using managed identity authentication: - - - #. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). - #. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data - Contributor' RBAC role to the server identity. - For more information, see `Auditing to storage using Managed Identity authentication - `_. - :paramtype storage_account_access_key: str - :keyword storage_account_subscription_id: Specifies the blob storage subscription Id. - :paramtype storage_account_subscription_id: str - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled - self.is_managed_identity_in_use = is_managed_identity_in_use - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.storage_account_subscription_id = storage_account_subscription_id - - -class ServerDevOpsAuditSettingsListResult(_serialization.Model): - """A list of server DevOps audit settings. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerDevOpsAuditingSettings]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerDevOpsAuditingSettings"]] = None - self.next_link: Optional[str] = None - - -class ServerDnsAlias(ProxyResource): - """A server DNS alias. - - 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 azure_dns_record: The fully qualified DNS record for alias. - :vartype azure_dns_record: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "azure_dns_record": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "azure_dns_record": {"key": "properties.azureDnsRecord", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.azure_dns_record: Optional[str] = None - - -class ServerDnsAliasAcquisition(_serialization.Model): - """A server dns alias acquisition request. - - All required parameters must be populated in order to send to server. - - :ivar old_server_dns_alias_id: The id of the server alias that will be acquired to point to - this server instead. Required. - :vartype old_server_dns_alias_id: str - """ - - _validation = { - "old_server_dns_alias_id": {"required": True}, - } - - _attribute_map = { - "old_server_dns_alias_id": {"key": "oldServerDnsAliasId", "type": "str"}, - } - - def __init__(self, *, old_server_dns_alias_id: str, **kwargs: Any) -> None: - """ - :keyword old_server_dns_alias_id: The id of the server alias that will be acquired to point to - this server instead. Required. - :paramtype old_server_dns_alias_id: str - """ - super().__init__(**kwargs) - self.old_server_dns_alias_id = old_server_dns_alias_id - - -class ServerDnsAliasListResult(_serialization.Model): - """A list of server DNS aliases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerDnsAlias] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerDnsAlias]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerDnsAlias"]] = None - self.next_link: Optional[str] = None - - -class ServerExternalAdministrator(_serialization.Model): - """Properties of a active directory administrator. - - :ivar administrator_type: Type of the sever administrator. "ActiveDirectory" - :vartype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :ivar principal_type: Principal Type of the sever administrator. Known values are: "User", - "Group", and "Application". - :vartype principal_type: str or ~azure.mgmt.sql.models.PrincipalType - :ivar login: Login name of the server administrator. - :vartype login: str - :ivar sid: SID (object ID) of the server administrator. - :vartype sid: str - :ivar tenant_id: Tenant ID of the administrator. - :vartype tenant_id: str - :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :vartype azure_ad_only_authentication: bool - """ - - _attribute_map = { - "administrator_type": {"key": "administratorType", "type": "str"}, - "principal_type": {"key": "principalType", "type": "str"}, - "login": {"key": "login", "type": "str"}, - "sid": {"key": "sid", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "azure_ad_only_authentication": {"key": "azureADOnlyAuthentication", "type": "bool"}, - } - - def __init__( - self, - *, - administrator_type: Optional[Union[str, "_models.AdministratorType"]] = None, - principal_type: Optional[Union[str, "_models.PrincipalType"]] = None, - login: Optional[str] = None, - sid: Optional[str] = None, - tenant_id: Optional[str] = None, - azure_ad_only_authentication: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword administrator_type: Type of the sever administrator. "ActiveDirectory" - :paramtype administrator_type: str or ~azure.mgmt.sql.models.AdministratorType - :keyword principal_type: Principal Type of the sever administrator. Known values are: "User", - "Group", and "Application". - :paramtype principal_type: str or ~azure.mgmt.sql.models.PrincipalType - :keyword login: Login name of the server administrator. - :paramtype login: str - :keyword sid: SID (object ID) of the server administrator. - :paramtype sid: str - :keyword tenant_id: Tenant ID of the administrator. - :paramtype tenant_id: str - :keyword azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :paramtype azure_ad_only_authentication: bool - """ - super().__init__(**kwargs) - self.administrator_type = administrator_type - self.principal_type = principal_type - self.login = login - self.sid = sid - self.tenant_id = tenant_id - self.azure_ad_only_authentication = azure_ad_only_authentication - - -class ServerInfo(_serialization.Model): - """Server info for the server trust group. - - All required parameters must be populated in order to send to server. - - :ivar server_id: Server Id. Required. - :vartype server_id: str - """ - - _validation = { - "server_id": {"required": True}, - } - - _attribute_map = { - "server_id": {"key": "serverId", "type": "str"}, - } - - def __init__(self, *, server_id: str, **kwargs: Any) -> None: - """ - :keyword server_id: Server Id. Required. - :paramtype server_id: str - """ - super().__init__(**kwargs) - self.server_id = server_id - - -class ServerKey(ProxyResource): - """A server key. - - 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 kind: Kind of encryption protector. This is metadata used for the Azure portal - experience. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :ivar subregion: Subregion of the server key. - :vartype subregion: str - :ivar server_key_type: The server key type like 'ServiceManaged', 'AzureKeyVault'. Known values - are: "ServiceManaged" and "AzureKeyVault". - :vartype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :ivar uri: The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is - required. The AKV URI is required to be in this format: - 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' or can be - 'https://YourVaultName.vault.azure.net/keys/YourKeyName'. - :vartype uri: str - :ivar thumbprint: Thumbprint of the server key. - :vartype thumbprint: str - :ivar creation_date: The server key creation date. - :vartype creation_date: ~datetime.datetime - :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or false. - :vartype auto_rotation_enabled: bool - :ivar key_version: The version of the server key. - :vartype key_version: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "kind": {"readonly": True}, - "location": {"readonly": True}, - "subregion": {"readonly": True}, - "thumbprint": {"readonly": True}, - "creation_date": {"readonly": True}, - "auto_rotation_enabled": {"readonly": True}, - "key_version": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "kind": {"key": "kind", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "subregion": {"key": "properties.subregion", "type": "str"}, - "server_key_type": {"key": "properties.serverKeyType", "type": "str"}, - "uri": {"key": "properties.uri", "type": "str"}, - "thumbprint": {"key": "properties.thumbprint", "type": "str"}, - "creation_date": {"key": "properties.creationDate", "type": "iso-8601"}, - "auto_rotation_enabled": {"key": "properties.autoRotationEnabled", "type": "bool"}, - "key_version": {"key": "properties.keyVersion", "type": "str"}, - } - - def __init__( - self, - *, - server_key_type: Optional[Union[str, "_models.ServerKeyType"]] = None, - uri: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword server_key_type: The server key type like 'ServiceManaged', 'AzureKeyVault'. Known - values are: "ServiceManaged" and "AzureKeyVault". - :paramtype server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :keyword uri: The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is - required. The AKV URI is required to be in this format: - 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' or can be - 'https://YourVaultName.vault.azure.net/keys/YourKeyName'. - :paramtype uri: str - """ - super().__init__(**kwargs) - self.kind: Optional[str] = None - self.location: Optional[str] = None - self.subregion: Optional[str] = None - self.server_key_type = server_key_type - self.uri = uri - self.thumbprint: Optional[str] = None - self.creation_date: Optional[datetime.datetime] = None - self.auto_rotation_enabled: Optional[bool] = None - self.key_version: Optional[str] = None - - -class ServerKeyListResult(_serialization.Model): - """A list of server keys. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerKey] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerKey]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerKey"]] = None - self.next_link: Optional[str] = None - - -class ServerListResult(_serialization.Model): - """A list of servers. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.Server] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Server]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Server"]] = None - self.next_link: Optional[str] = None - - -class ServerOperation(ProxyResource): - """A server operation. - - 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 operation: The name of operation. - :vartype operation: str - :ivar operation_friendly_name: The friendly name of operation. - :vartype operation_friendly_name: str - :ivar percent_complete: The percentage of the operation completed. - :vartype percent_complete: int - :ivar server_name: The name of the server. - :vartype server_name: str - :ivar start_time: The operation start time. - :vartype start_time: ~datetime.datetime - :ivar state: The operation state. Known values are: "Pending", "InProgress", "Succeeded", - "Failed", "CancelInProgress", and "Cancelled". - :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState - :ivar error_code: The operation error code. - :vartype error_code: int - :ivar error_description: The operation error description. - :vartype error_description: str - :ivar error_severity: The operation error severity. - :vartype error_severity: int - :ivar is_user_error: Whether or not the error is a user error. - :vartype is_user_error: bool - :ivar estimated_completion_time: The estimated completion time of the operation. - :vartype estimated_completion_time: ~datetime.datetime - :ivar description: The operation description. - :vartype description: str - :ivar is_cancellable: Whether the operation can be cancelled. - :vartype is_cancellable: bool - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "operation": {"readonly": True}, - "operation_friendly_name": {"readonly": True}, - "percent_complete": {"readonly": True}, - "server_name": {"readonly": True}, - "start_time": {"readonly": True}, - "state": {"readonly": True}, - "error_code": {"readonly": True}, - "error_description": {"readonly": True}, - "error_severity": {"readonly": True}, - "is_user_error": {"readonly": True}, - "estimated_completion_time": {"readonly": True}, - "description": {"readonly": True}, - "is_cancellable": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "operation": {"key": "properties.operation", "type": "str"}, - "operation_friendly_name": {"key": "properties.operationFriendlyName", "type": "str"}, - "percent_complete": {"key": "properties.percentComplete", "type": "int"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "error_code": {"key": "properties.errorCode", "type": "int"}, - "error_description": {"key": "properties.errorDescription", "type": "str"}, - "error_severity": {"key": "properties.errorSeverity", "type": "int"}, - "is_user_error": {"key": "properties.isUserError", "type": "bool"}, - "estimated_completion_time": {"key": "properties.estimatedCompletionTime", "type": "iso-8601"}, - "description": {"key": "properties.description", "type": "str"}, - "is_cancellable": {"key": "properties.isCancellable", "type": "bool"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.operation: Optional[str] = None - self.operation_friendly_name: Optional[str] = None - self.percent_complete: Optional[int] = None - self.server_name: Optional[str] = None - self.start_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.ManagementOperationState"]] = None - self.error_code: Optional[int] = None - self.error_description: Optional[str] = None - self.error_severity: Optional[int] = None - self.is_user_error: Optional[bool] = None - self.estimated_completion_time: Optional[datetime.datetime] = None - self.description: Optional[str] = None - self.is_cancellable: Optional[bool] = None - - -class ServerOperationListResult(_serialization.Model): - """The response to a list server operations request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerOperation] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerOperation]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerOperation"]] = None - self.next_link: Optional[str] = None - - -class ServerPrivateEndpointConnection(_serialization.Model): - """A private endpoint connection under a server. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar properties: Private endpoint connection properties. - :vartype properties: ~azure.mgmt.sql.models.PrivateEndpointConnectionProperties - """ - - _validation = { - "id": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "properties": {"key": "properties", "type": "PrivateEndpointConnectionProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.properties: Optional["_models.PrivateEndpointConnectionProperties"] = None - - -class ServerSecurityAlertPolicy(ProxyResource): - """A server security alert policy. - - 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 system_data: SystemData of SecurityAlertPolicyResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the policy, whether it is enabled or disabled or a policy - has not been applied yet on the specific database. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :ivar disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :vartype disabled_alerts: list[str] - :ivar email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :vartype email_addresses: list[str] - :ivar email_account_admins: Specifies that the alert is sent to the account administrators. - :vartype email_account_admins: bool - :ivar storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :vartype storage_endpoint: str - :ivar storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :vartype storage_account_access_key: str - :ivar retention_days: Specifies the number of days to keep in the Threat Detection audit logs. - :vartype retention_days: int - :ivar creation_time: Specifies the UTC creation time of the policy. - :vartype creation_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "creation_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - "disabled_alerts": {"key": "properties.disabledAlerts", "type": "[str]"}, - "email_addresses": {"key": "properties.emailAddresses", "type": "[str]"}, - "email_account_admins": {"key": "properties.emailAccountAdmins", "type": "bool"}, - "storage_endpoint": {"key": "properties.storageEndpoint", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - } - - def __init__( - self, - *, - state: Optional[Union[str, "_models.SecurityAlertsPolicyState"]] = None, - disabled_alerts: Optional[list[str]] = None, - email_addresses: Optional[list[str]] = None, - email_account_admins: Optional[bool] = None, - storage_endpoint: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - retention_days: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the policy, whether it is enabled or disabled or a - policy has not been applied yet on the specific database. Known values are: "Enabled" and - "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState - :keyword disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: - Sql_Injection, Sql_Injection_Vulnerability, Access_Anomaly, Data_Exfiltration, Unsafe_Action, - Brute_Force. - :paramtype disabled_alerts: list[str] - :keyword email_addresses: Specifies an array of e-mail addresses to which the alert is sent. - :paramtype email_addresses: list[str] - :keyword email_account_admins: Specifies that the alert is sent to the account administrators. - :paramtype email_account_admins: bool - :keyword storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection - audit logs. - :paramtype storage_endpoint: str - :keyword storage_account_access_key: Specifies the identifier key of the Threat Detection audit - storage account. - :paramtype storage_account_access_key: str - :keyword retention_days: Specifies the number of days to keep in the Threat Detection audit - logs. - :paramtype retention_days: int - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - self.disabled_alerts = disabled_alerts - self.email_addresses = email_addresses - self.email_account_admins = email_account_admins - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key - self.retention_days = retention_days - self.creation_time: Optional[datetime.datetime] = None - - -class ServerTrustCertificate(ProxyResource): - """Server trust certificate imported from box to enable connection between box and Sql Managed - Instance. - - 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 public_blob: The certificate public blob. - :vartype public_blob: str - :ivar thumbprint: The certificate thumbprint. - :vartype thumbprint: str - :ivar certificate_name: The certificate name. - :vartype certificate_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "thumbprint": {"readonly": True}, - "certificate_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "public_blob": {"key": "properties.publicBlob", "type": "str"}, - "thumbprint": {"key": "properties.thumbprint", "type": "str"}, - "certificate_name": {"key": "properties.certificateName", "type": "str"}, - } - - def __init__(self, *, public_blob: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword public_blob: The certificate public blob. - :paramtype public_blob: str - """ - super().__init__(**kwargs) - self.public_blob = public_blob - self.thumbprint: Optional[str] = None - self.certificate_name: Optional[str] = None - - -class ServerTrustCertificatesListResult(_serialization.Model): - """A list of server trust certificates in instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerTrustCertificate] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerTrustCertificate]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerTrustCertificate"]] = None - self.next_link: Optional[str] = None - - -class ServerTrustGroup(ProxyResource): - """A server trust group. - - 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 group_members: Group members information for the server trust group. - :vartype group_members: list[~azure.mgmt.sql.models.ServerInfo] - :ivar trust_scopes: Trust scope of the server trust group. - :vartype trust_scopes: list[str or - ~azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem] - """ - - _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"}, - "group_members": {"key": "properties.groupMembers", "type": "[ServerInfo]"}, - "trust_scopes": {"key": "properties.trustScopes", "type": "[str]"}, - } - - def __init__( - self, - *, - group_members: Optional[list["_models.ServerInfo"]] = None, - trust_scopes: Optional[list[Union[str, "_models.ServerTrustGroupPropertiesTrustScopesItem"]]] = None, - **kwargs: Any - ) -> None: - """ - :keyword group_members: Group members information for the server trust group. - :paramtype group_members: list[~azure.mgmt.sql.models.ServerInfo] - :keyword trust_scopes: Trust scope of the server trust group. - :paramtype trust_scopes: list[str or - ~azure.mgmt.sql.models.ServerTrustGroupPropertiesTrustScopesItem] - """ - super().__init__(**kwargs) - self.group_members = group_members - self.trust_scopes = trust_scopes - - -class ServerTrustGroupListResult(_serialization.Model): - """A list of server trust groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerTrustGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerTrustGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerTrustGroup"]] = None - self.next_link: Optional[str] = None - - -class ServerUpdate(_serialization.Model): - """An update request for an Azure SQL Database server. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar identity: Server identity. - :vartype identity: ~azure.mgmt.sql.models.ResourceIdentity - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar administrator_login: Administrator username for the server. Once created it cannot be - changed. - :vartype administrator_login: str - :ivar administrator_login_password: The administrator login password (required for server - creation). - :vartype administrator_login_password: str - :ivar version: The version of the server. - :vartype version: str - :ivar state: The state of the server. - :vartype state: str - :ivar fully_qualified_domain_name: The fully qualified domain name of the server. - :vartype fully_qualified_domain_name: str - :ivar private_endpoint_connections: List of private endpoint connections on a server. - :vartype private_endpoint_connections: - list[~azure.mgmt.sql.models.ServerPrivateEndpointConnection] - :ivar minimal_tls_version: Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', - '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". - :vartype minimal_tls_version: str or ~azure.mgmt.sql.models.MinimalTlsVersion - :ivar public_network_access: Whether or not public endpoint access is allowed for this server. - Value is optional but if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter'. - Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :vartype public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccessFlag - :ivar workspace_feature: Whether or not existing server has a workspace created and if it - allows connection from workspace. Known values are: "Connected" and "Disconnected". - :vartype workspace_feature: str or ~azure.mgmt.sql.models.ServerWorkspaceFeature - :ivar primary_user_assigned_identity_id: The resource id of a user assigned identity to be used - by default. - :vartype primary_user_assigned_identity_id: str - :ivar federated_client_id: The Client id used for cross tenant CMK scenario. - :vartype federated_client_id: str - :ivar key_id: A CMK URI of the key to use for encryption. - :vartype key_id: str - :ivar administrators: The Azure Active Directory administrator can be utilized during server - creation and for server updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :vartype administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator - :ivar restrict_outbound_network_access: Whether or not to restrict outbound network access for - this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known values - are: "Enabled" and "Disabled". - :vartype restrict_outbound_network_access: str or - ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :ivar is_i_pv6_enabled: Whether or not to enable IPv6 support for this server. Value is - optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and - "Disabled". - :vartype is_i_pv6_enabled: str or ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :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 retention_days: Number of days this server will stay soft-deleted. - :vartype retention_days: int - :ivar create_mode: Create mode for server, only valid values for this are Normal and Restore. - Known values are: "Normal" and "Restore". - :vartype create_mode: str or ~azure.mgmt.sql.models.ServerCreateMode - """ - - _validation = { - "state": {"readonly": True}, - "fully_qualified_domain_name": {"readonly": True}, - "private_endpoint_connections": {"readonly": True}, - "workspace_feature": {"readonly": True}, - "external_governance_status": {"readonly": True}, - } - - _attribute_map = { - "identity": {"key": "identity", "type": "ResourceIdentity"}, - "tags": {"key": "tags", "type": "{str}"}, - "administrator_login": {"key": "properties.administratorLogin", "type": "str"}, - "administrator_login_password": {"key": "properties.administratorLoginPassword", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "fully_qualified_domain_name": {"key": "properties.fullyQualifiedDomainName", "type": "str"}, - "private_endpoint_connections": { - "key": "properties.privateEndpointConnections", - "type": "[ServerPrivateEndpointConnection]", - }, - "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, - "public_network_access": {"key": "properties.publicNetworkAccess", "type": "str"}, - "workspace_feature": {"key": "properties.workspaceFeature", "type": "str"}, - "primary_user_assigned_identity_id": {"key": "properties.primaryUserAssignedIdentityId", "type": "str"}, - "federated_client_id": {"key": "properties.federatedClientId", "type": "str"}, - "key_id": {"key": "properties.keyId", "type": "str"}, - "administrators": {"key": "properties.administrators", "type": "ServerExternalAdministrator"}, - "restrict_outbound_network_access": {"key": "properties.restrictOutboundNetworkAccess", "type": "str"}, - "is_i_pv6_enabled": {"key": "properties.isIPv6Enabled", "type": "str"}, - "external_governance_status": {"key": "properties.externalGovernanceStatus", "type": "str"}, - "retention_days": {"key": "properties.retentionDays", "type": "int"}, - "create_mode": {"key": "properties.createMode", "type": "str"}, - } - - def __init__( - self, - *, - identity: Optional["_models.ResourceIdentity"] = None, - tags: Optional[dict[str, str]] = None, - administrator_login: Optional[str] = None, - administrator_login_password: Optional[str] = None, - version: Optional[str] = None, - minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, - public_network_access: Optional[Union[str, "_models.ServerPublicNetworkAccessFlag"]] = None, - primary_user_assigned_identity_id: Optional[str] = None, - federated_client_id: Optional[str] = None, - key_id: Optional[str] = None, - administrators: Optional["_models.ServerExternalAdministrator"] = None, - restrict_outbound_network_access: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, - is_i_pv6_enabled: Optional[Union[str, "_models.ServerNetworkAccessFlag"]] = None, - retention_days: Optional[int] = None, - create_mode: Optional[Union[str, "_models.ServerCreateMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword identity: Server identity. - :paramtype identity: ~azure.mgmt.sql.models.ResourceIdentity - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword administrator_login: Administrator username for the server. Once created it cannot be - changed. - :paramtype administrator_login: str - :keyword administrator_login_password: The administrator login password (required for server - creation). - :paramtype administrator_login_password: str - :keyword version: The version of the server. - :paramtype version: str - :keyword minimal_tls_version: Minimal TLS version. Allowed values: 'None', 1.0', '1.1', '1.2', - '1.3'. Known values are: "None", "1.0", "1.1", "1.2", and "1.3". - :paramtype minimal_tls_version: str or ~azure.mgmt.sql.models.MinimalTlsVersion - :keyword public_network_access: Whether or not public endpoint access is allowed for this - server. Value is optional but if passed in, must be 'Enabled' or 'Disabled' or - 'SecuredByPerimeter'. Known values are: "Enabled", "Disabled", and "SecuredByPerimeter". - :paramtype public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccessFlag - :keyword primary_user_assigned_identity_id: The resource id of a user assigned identity to be - used by default. - :paramtype primary_user_assigned_identity_id: str - :keyword federated_client_id: The Client id used for cross tenant CMK scenario. - :paramtype federated_client_id: str - :keyword key_id: A CMK URI of the key to use for encryption. - :paramtype key_id: str - :keyword administrators: The Azure Active Directory administrator can be utilized during server - creation and for server updates, except for the azureADOnlyAuthentication property. To update - the azureADOnlyAuthentication property, individual API must be used. - :paramtype administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator - :keyword restrict_outbound_network_access: Whether or not to restrict outbound network access - for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Known - values are: "Enabled" and "Disabled". - :paramtype restrict_outbound_network_access: str or - ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :keyword is_i_pv6_enabled: Whether or not to enable IPv6 support for this server. Value is - optional but if passed in, must be 'Enabled' or 'Disabled'. Known values are: "Enabled" and - "Disabled". - :paramtype is_i_pv6_enabled: str or ~azure.mgmt.sql.models.ServerNetworkAccessFlag - :keyword retention_days: Number of days this server will stay soft-deleted. - :paramtype retention_days: int - :keyword create_mode: Create mode for server, only valid values for this are Normal and - Restore. Known values are: "Normal" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.sql.models.ServerCreateMode - """ - super().__init__(**kwargs) - self.identity = identity - self.tags = tags - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.version = version - self.state: Optional[str] = None - self.fully_qualified_domain_name: Optional[str] = None - self.private_endpoint_connections: Optional[list["_models.ServerPrivateEndpointConnection"]] = None - self.minimal_tls_version = minimal_tls_version - self.public_network_access = public_network_access - self.workspace_feature: Optional[Union[str, "_models.ServerWorkspaceFeature"]] = None - self.primary_user_assigned_identity_id = primary_user_assigned_identity_id - self.federated_client_id = federated_client_id - self.key_id = key_id - self.administrators = administrators - self.restrict_outbound_network_access = restrict_outbound_network_access - self.is_i_pv6_enabled = is_i_pv6_enabled - self.external_governance_status: Optional[Union[str, "_models.ExternalGovernanceStatus"]] = None - self.retention_days = retention_days - self.create_mode = create_mode - - -class ServerUsage(ProxyResource): - """Usage metric of a server. - - 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 display_name: User-readable name of the metric. - :vartype display_name: str - :ivar current_value: Current value of the metric. - :vartype current_value: float - :ivar limit: Boundary value of the metric. - :vartype limit: float - :ivar unit: Unit of the metric. - :vartype unit: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "display_name": {"readonly": True}, - "current_value": {"readonly": True}, - "limit": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - "current_value": {"key": "properties.currentValue", "type": "float"}, - "limit": {"key": "properties.limit", "type": "float"}, - "unit": {"key": "properties.unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name: Optional[str] = None - self.current_value: Optional[float] = None - self.limit: Optional[float] = None - self.unit: Optional[str] = None - - -class ServerUsageListResult(_serialization.Model): - """A list of server usage metrics. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerUsage] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerUsage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerUsage"]] = None - self.next_link: Optional[str] = None - - -class ServerVersionCapability(_serialization.Model): - """The server capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The server version name. - :vartype name: str - :ivar supported_editions: The list of supported database editions. - :vartype supported_editions: list[~azure.mgmt.sql.models.EditionCapability] - :ivar supported_elastic_pool_editions: The list of supported elastic pool editions. - :vartype supported_elastic_pool_editions: - list[~azure.mgmt.sql.models.ElasticPoolEditionCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "name": {"readonly": True}, - "supported_editions": {"readonly": True}, - "supported_elastic_pool_editions": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "supported_editions": {"key": "supportedEditions", "type": "[EditionCapability]"}, - "supported_elastic_pool_editions": { - "key": "supportedElasticPoolEditions", - "type": "[ElasticPoolEditionCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.name: Optional[str] = None - self.supported_editions: Optional[list["_models.EditionCapability"]] = None - self.supported_elastic_pool_editions: Optional[list["_models.ElasticPoolEditionCapability"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ServerVulnerabilityAssessment(ProxyResource): - """A server vulnerability assessment. - - 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 storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). - :vartype storage_container_path: str - :ivar storage_container_sas_key: A shared access signature (SAS Key) that has write access to - the blob container specified in 'storageContainerPath' parameter. If 'storageAccountAccessKey' - isn't specified, StorageContainerSasKey is required. Applies only if the storage account is not - behind a Vnet or a firewall. - :vartype storage_container_sas_key: str - :ivar storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :vartype storage_account_access_key: str - :ivar recurring_scans: The recurring scans settings. - :vartype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - - _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"}, - "storage_container_path": {"key": "properties.storageContainerPath", "type": "str"}, - "storage_container_sas_key": {"key": "properties.storageContainerSasKey", "type": "str"}, - "storage_account_access_key": {"key": "properties.storageAccountAccessKey", "type": "str"}, - "recurring_scans": { - "key": "properties.recurringScans", - "type": "VulnerabilityAssessmentRecurringScansProperties", - }, - } - - def __init__( - self, - *, - storage_container_path: Optional[str] = None, - storage_container_sas_key: Optional[str] = None, - storage_account_access_key: Optional[str] = None, - recurring_scans: Optional["_models.VulnerabilityAssessmentRecurringScansProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword storage_container_path: A blob storage container path to hold the scan results (e.g. - https://myStorage.blob.core.windows.net/VaScans/). - :paramtype storage_container_path: str - :keyword storage_container_sas_key: A shared access signature (SAS Key) that has write access - to the blob container specified in 'storageContainerPath' parameter. If - 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is required. Applies only if - the storage account is not behind a Vnet or a firewall. - :paramtype storage_container_sas_key: str - :keyword storage_account_access_key: Specifies the identifier key of the storage account for - vulnerability assessment scan results. If 'StorageContainerSasKey' isn't specified, - storageAccountAccessKey is required. Applies only if the storage account is not behind a Vnet - or a firewall. - :paramtype storage_account_access_key: str - :keyword recurring_scans: The recurring scans settings. - :paramtype recurring_scans: - ~azure.mgmt.sql.models.VulnerabilityAssessmentRecurringScansProperties - """ - super().__init__(**kwargs) - self.storage_container_path = storage_container_path - self.storage_container_sas_key = storage_container_sas_key - self.storage_account_access_key = storage_account_access_key - self.recurring_scans = recurring_scans - - -class ServerVulnerabilityAssessmentListResult(_serialization.Model): - """A list of the server's vulnerability assessments. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ServerVulnerabilityAssessment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.ServerVulnerabilityAssessment"]] = None - self.next_link: Optional[str] = None - - -class ServiceObjectiveCapability(_serialization.Model): - """The service objectives capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique ID of the service objective. - :vartype id: str - :ivar name: The service objective name. - :vartype name: str - :ivar supported_max_sizes: The list of supported maximum database sizes. - :vartype supported_max_sizes: list[~azure.mgmt.sql.models.MaxSizeRangeCapability] - :ivar performance_level: The performance level. - :vartype performance_level: ~azure.mgmt.sql.models.PerformanceLevelCapability - :ivar sku: The sku. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar supported_license_types: List of supported license types. - :vartype supported_license_types: list[~azure.mgmt.sql.models.LicenseTypeCapability] - :ivar included_max_size: The included (free) max size. - :vartype included_max_size: ~azure.mgmt.sql.models.MaxSizeCapability - :ivar zone_redundant: Whether or not zone redundancy is supported for the service objective. - :vartype zone_redundant: bool - :ivar supported_auto_pause_delay: Supported time range for auto pause delay. - :vartype supported_auto_pause_delay: ~azure.mgmt.sql.models.AutoPauseDelayTimeRange - :ivar supported_min_capacities: List of supported min capacities. - :vartype supported_min_capacities: list[~azure.mgmt.sql.models.MinCapacityCapability] - :ivar compute_model: The compute model. - :vartype compute_model: str - :ivar supported_maintenance_configurations: List of supported maintenance configurations. - :vartype supported_maintenance_configurations: - list[~azure.mgmt.sql.models.MaintenanceConfigurationCapability] - :ivar zone_pinning: Whether or not zone pinning is supported. - :vartype zone_pinning: bool - :ivar supported_zones: List of supported availability zones. - :vartype supported_zones: list[~azure.mgmt.sql.models.ZonePinningCapability] - :ivar supported_free_limit_exhaustion_behaviors: List of supported free limit exhaustion - behaviors. - :vartype supported_free_limit_exhaustion_behaviors: - list[~azure.mgmt.sql.models.FreeLimitExhaustionBehaviorCapability] - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "supported_max_sizes": {"readonly": True}, - "performance_level": {"readonly": True}, - "sku": {"readonly": True}, - "supported_license_types": {"readonly": True}, - "included_max_size": {"readonly": True}, - "zone_redundant": {"readonly": True}, - "supported_auto_pause_delay": {"readonly": True}, - "supported_min_capacities": {"readonly": True}, - "compute_model": {"readonly": True}, - "supported_maintenance_configurations": {"readonly": True}, - "zone_pinning": {"readonly": True}, - "supported_zones": {"readonly": True}, - "supported_free_limit_exhaustion_behaviors": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "supported_max_sizes": {"key": "supportedMaxSizes", "type": "[MaxSizeRangeCapability]"}, - "performance_level": {"key": "performanceLevel", "type": "PerformanceLevelCapability"}, - "sku": {"key": "sku", "type": "Sku"}, - "supported_license_types": {"key": "supportedLicenseTypes", "type": "[LicenseTypeCapability]"}, - "included_max_size": {"key": "includedMaxSize", "type": "MaxSizeCapability"}, - "zone_redundant": {"key": "zoneRedundant", "type": "bool"}, - "supported_auto_pause_delay": {"key": "supportedAutoPauseDelay", "type": "AutoPauseDelayTimeRange"}, - "supported_min_capacities": {"key": "supportedMinCapacities", "type": "[MinCapacityCapability]"}, - "compute_model": {"key": "computeModel", "type": "str"}, - "supported_maintenance_configurations": { - "key": "supportedMaintenanceConfigurations", - "type": "[MaintenanceConfigurationCapability]", - }, - "zone_pinning": {"key": "zonePinning", "type": "bool"}, - "supported_zones": {"key": "supportedZones", "type": "[ZonePinningCapability]"}, - "supported_free_limit_exhaustion_behaviors": { - "key": "supportedFreeLimitExhaustionBehaviors", - "type": "[FreeLimitExhaustionBehaviorCapability]", - }, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional[str] = None - self.supported_max_sizes: Optional[list["_models.MaxSizeRangeCapability"]] = None - self.performance_level: Optional["_models.PerformanceLevelCapability"] = None - self.sku: Optional["_models.Sku"] = None - self.supported_license_types: Optional[list["_models.LicenseTypeCapability"]] = None - self.included_max_size: Optional["_models.MaxSizeCapability"] = None - self.zone_redundant: Optional[bool] = None - self.supported_auto_pause_delay: Optional["_models.AutoPauseDelayTimeRange"] = None - self.supported_min_capacities: Optional[list["_models.MinCapacityCapability"]] = None - self.compute_model: Optional[str] = None - self.supported_maintenance_configurations: Optional[list["_models.MaintenanceConfigurationCapability"]] = None - self.zone_pinning: Optional[bool] = None - self.supported_zones: Optional[list["_models.ZonePinningCapability"]] = None - self.supported_free_limit_exhaustion_behaviors: Optional[ - list["_models.FreeLimitExhaustionBehaviorCapability"] - ] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class ServicePrincipal(_serialization.Model): - """The managed instance's service principal configuration for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The Azure Active Directory application object id. - :vartype principal_id: str - :ivar client_id: The Azure Active Directory application client id. - :vartype client_id: str - :ivar tenant_id: The Azure Active Directory tenant id. - :vartype tenant_id: str - :ivar type: Service principal type. Known values are: "None" and "SystemAssigned". - :vartype type: str or ~azure.mgmt.sql.models.ServicePrincipalType - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - "tenant_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - "tenant_id": {"key": "tenantId", "type": "str"}, - "type": {"key": "type", "type": "str"}, - } - - def __init__(self, *, type: Optional[Union[str, "_models.ServicePrincipalType"]] = None, **kwargs: Any) -> None: - """ - :keyword type: Service principal type. Known values are: "None" and "SystemAssigned". - :paramtype type: str or ~azure.mgmt.sql.models.ServicePrincipalType - """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - self.tenant_id: Optional[str] = None - self.type = type - - -class Sku(_serialization.Model): - """An ARM Resource SKU. - - All required parameters must be populated in order to send to server. - - :ivar name: The name of the SKU, typically, a letter + Number code, e.g. P3. Required. - :vartype name: str - :ivar tier: The tier or edition of the particular SKU, e.g. Basic, Premium. - :vartype tier: str - :ivar size: Size of the particular SKU. - :vartype size: str - :ivar family: If the service has different generations of hardware, for the same SKU, then that - can be captured here. - :vartype family: str - :ivar capacity: Capacity of the particular SKU. - :vartype capacity: int - """ - - _validation = { - "name": {"required": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "size": {"key": "size", "type": "str"}, - "family": {"key": "family", "type": "str"}, - "capacity": {"key": "capacity", "type": "int"}, - } - - def __init__( - self, - *, - name: str, - tier: Optional[str] = None, - size: Optional[str] = None, - family: Optional[str] = None, - capacity: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: The name of the SKU, typically, a letter + Number code, e.g. P3. Required. - :paramtype name: str - :keyword tier: The tier or edition of the particular SKU, e.g. Basic, Premium. - :paramtype tier: str - :keyword size: Size of the particular SKU. - :paramtype size: str - :keyword family: If the service has different generations of hardware, for the same SKU, then - that can be captured here. - :paramtype family: str - :keyword capacity: Capacity of the particular SKU. - :paramtype capacity: int - """ - super().__init__(**kwargs) - self.name = name - self.tier = tier - self.size = size - self.family = family - self.capacity = capacity - - -class SqlAgentConfiguration(ProxyResource): - """A recoverable managed database 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 state: The state of Sql Agent. Known values are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState - """ - - _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"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.SqlAgentConfigurationPropertiesState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: The state of Sql Agent. Known values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SqlAgentConfigurationPropertiesState - """ - super().__init__(**kwargs) - self.state = state - - -class SqlVulnerabilityAssessment(ProxyResource): - """A SQL Vulnerability Assessment. - - 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 system_data: SystemData of SqlVulnerabilityAssessmentResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar state: Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or - disabled or a state has not been applied yet on the specific database or server. Known values - are: "Enabled" and "Disabled". - :vartype state: str or ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, *, state: Optional[Union[str, "_models.SqlVulnerabilityAssessmentState"]] = None, **kwargs: Any - ) -> None: - """ - :keyword state: Specifies the state of the SQL Vulnerability Assessment, whether it is enabled - or disabled or a state has not been applied yet on the specific database or server. Known - values are: "Enabled" and "Disabled". - :paramtype state: str or ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentState - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.state = state - - -class SqlVulnerabilityAssessmentListResult(_serialization.Model): - """A list of SQL Vulnerability Assessments. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SqlVulnerabilityAssessment]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SqlVulnerabilityAssessment"]] = None - self.next_link: Optional[str] = None - - -class SqlVulnerabilityAssessmentScanError(_serialization.Model): - """Properties of a vulnerability assessment scan error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - - -class SQLVulnerabilityAssessmentScanListResult(_serialization.Model): - """A list of vulnerability assessment scan results. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SqlVulnerabilityAssessmentScanResults]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SqlVulnerabilityAssessmentScanResults"]] = None - self.next_link: Optional[str] = None - - -class SqlVulnerabilityAssessmentScanRecord(ProxyResource): - """A vulnerability assessment scan record. - - 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 system_data: SystemData of SqlVulnerabilityAssessmentScanRecordResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar scan_id: The scan ID. - :vartype scan_id: str - :ivar trigger_type: The scan trigger type. Known values are: "OnDemand" and "Recurring". - :vartype trigger_type: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType - :ivar state: The scan status. Known values are: "Passed", "Failed", "FailedToRun", and - "InProgress". - :vartype state: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState - :ivar start_time: The scan start time (UTC). - :vartype start_time: ~datetime.datetime - :ivar end_time: The scan end time (UTC). - :vartype end_time: ~datetime.datetime - :ivar errors: The scan errors. - :vartype errors: list[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanError] - :ivar server: The server name. - :vartype server: str - :ivar database: The database name. - :vartype database: str - :ivar sql_version: The SQL version. - :vartype sql_version: str - :ivar high_severity_failed_rules_count: The number of failed rules with high severity. - :vartype high_severity_failed_rules_count: int - :ivar medium_severity_failed_rules_count: The number of failed rules with medium severity. - :vartype medium_severity_failed_rules_count: int - :ivar low_severity_failed_rules_count: The number of failed rules with low severity. - :vartype low_severity_failed_rules_count: int - :ivar total_passed_rules_count: The number of total passed rules. - :vartype total_passed_rules_count: int - :ivar total_failed_rules_count: The number of total failed rules. - :vartype total_failed_rules_count: int - :ivar total_rules_count: The number of total rules assessed. - :vartype total_rules_count: int - :ivar is_baseline_applied: Baseline created for this database, and has one or more rules. - :vartype is_baseline_applied: bool - :ivar last_scan_time: The last scan time. - :vartype last_scan_time: ~datetime.datetime - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "scan_id": {"readonly": True}, - "trigger_type": {"readonly": True}, - "state": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "errors": {"readonly": True}, - "server": {"readonly": True}, - "database": {"readonly": True}, - "sql_version": {"readonly": True}, - "high_severity_failed_rules_count": {"readonly": True}, - "medium_severity_failed_rules_count": {"readonly": True}, - "low_severity_failed_rules_count": {"readonly": True}, - "total_passed_rules_count": {"readonly": True}, - "total_failed_rules_count": {"readonly": True}, - "total_rules_count": {"readonly": True}, - "is_baseline_applied": {"readonly": True}, - "last_scan_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "scan_id": {"key": "properties.scanId", "type": "str"}, - "trigger_type": {"key": "properties.triggerType", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "errors": {"key": "properties.errors", "type": "[SqlVulnerabilityAssessmentScanError]"}, - "server": {"key": "properties.server", "type": "str"}, - "database": {"key": "properties.database", "type": "str"}, - "sql_version": {"key": "properties.sqlVersion", "type": "str"}, - "high_severity_failed_rules_count": {"key": "properties.highSeverityFailedRulesCount", "type": "int"}, - "medium_severity_failed_rules_count": {"key": "properties.mediumSeverityFailedRulesCount", "type": "int"}, - "low_severity_failed_rules_count": {"key": "properties.lowSeverityFailedRulesCount", "type": "int"}, - "total_passed_rules_count": {"key": "properties.totalPassedRulesCount", "type": "int"}, - "total_failed_rules_count": {"key": "properties.totalFailedRulesCount", "type": "int"}, - "total_rules_count": {"key": "properties.totalRulesCount", "type": "int"}, - "is_baseline_applied": {"key": "properties.isBaselineApplied", "type": "bool"}, - "last_scan_time": {"key": "properties.lastScanTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.scan_id: Optional[str] = None - self.trigger_type: Optional[Union[str, "_models.VulnerabilityAssessmentScanTriggerType"]] = None - self.state: Optional[Union[str, "_models.VulnerabilityAssessmentScanState"]] = None - self.start_time: Optional[datetime.datetime] = None - self.end_time: Optional[datetime.datetime] = None - self.errors: Optional[list["_models.SqlVulnerabilityAssessmentScanError"]] = None - self.server: Optional[str] = None - self.database: Optional[str] = None - self.sql_version: Optional[str] = None - self.high_severity_failed_rules_count: Optional[int] = None - self.medium_severity_failed_rules_count: Optional[int] = None - self.low_severity_failed_rules_count: Optional[int] = None - self.total_passed_rules_count: Optional[int] = None - self.total_failed_rules_count: Optional[int] = None - self.total_rules_count: Optional[int] = None - self.is_baseline_applied: Optional[bool] = None - self.last_scan_time: Optional[datetime.datetime] = None - - -class SqlVulnerabilityAssessmentScanRecordListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of vulnerability assessment scan records. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SqlVulnerabilityAssessmentScanRecord]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SqlVulnerabilityAssessmentScanRecord"]] = None - self.next_link: Optional[str] = None - - -class SqlVulnerabilityAssessmentScanResults(ProxyResource): - """SqlVulnerabilityAssessmentScanResults. - - 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 system_data: SystemData of AdvancedThreatProtectionResource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar rule_id: SQL Vulnerability Assessment rule Id. - :vartype rule_id: str - :ivar status: SQL Vulnerability Assessment rule result status. Known values are: "NonFinding", - "Finding", and "InternalError". - :vartype status: str or ~azure.mgmt.sql.models.RuleStatus - :ivar error_message: SQL Vulnerability Assessment error message. - :vartype error_message: str - :ivar is_trimmed: SQL Vulnerability Assessment is the query results trimmed. - :vartype is_trimmed: bool - :ivar query_results: SQL Vulnerability Assessment query results that was run. - :vartype query_results: list[list[str]] - :ivar remediation: SQL Vulnerability Assessment the remediation details. - :vartype remediation: ~azure.mgmt.sql.models.Remediation - :ivar baseline_adjusted_result: SQL Vulnerability Assessment rule result adjusted with - baseline. - :vartype baseline_adjusted_result: ~azure.mgmt.sql.models.BaselineAdjustedResult - :ivar rule_metadata: SQL Vulnerability Assessment rule metadata. - :vartype rule_metadata: ~azure.mgmt.sql.models.VaRule - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "rule_id": {"readonly": True}, - "status": {"readonly": True}, - "error_message": {"readonly": True}, - "is_trimmed": {"readonly": True}, - "query_results": {"readonly": True}, - "remediation": {"readonly": True}, - "baseline_adjusted_result": {"readonly": True}, - "rule_metadata": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "rule_id": {"key": "properties.ruleId", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - "error_message": {"key": "properties.errorMessage", "type": "str"}, - "is_trimmed": {"key": "properties.isTrimmed", "type": "bool"}, - "query_results": {"key": "properties.queryResults", "type": "[[str]]"}, - "remediation": {"key": "properties.remediation", "type": "Remediation"}, - "baseline_adjusted_result": {"key": "properties.baselineAdjustedResult", "type": "BaselineAdjustedResult"}, - "rule_metadata": {"key": "properties.ruleMetadata", "type": "VaRule"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.rule_id: Optional[str] = None - self.status: Optional[Union[str, "_models.RuleStatus"]] = None - self.error_message: Optional[str] = None - self.is_trimmed: Optional[bool] = None - self.query_results: Optional[list[list[str]]] = None - self.remediation: Optional["_models.Remediation"] = None - self.baseline_adjusted_result: Optional["_models.BaselineAdjustedResult"] = None - self.rule_metadata: Optional["_models.VaRule"] = None - - -class StartStopManagedInstanceSchedule(ProxyResource): - """Managed instance's Start/Stop schedule. - - 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 system_data: System data of the scheduled resource. - :vartype system_data: ~azure.mgmt.sql.models.SystemData - :ivar description: The description of the schedule. - :vartype description: str - :ivar time_zone_id: The time zone of the schedule. - :vartype time_zone_id: str - :ivar schedule_list: Schedule list. - :vartype schedule_list: list[~azure.mgmt.sql.models.ScheduleItem] - :ivar next_run_action: Next action to be executed (Start or Stop). - :vartype next_run_action: str - :ivar next_execution_time: Timestamp when the next action will be executed in the corresponding - schedule time zone. - :vartype next_execution_time: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "next_run_action": {"readonly": True}, - "next_execution_time": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "description": {"key": "properties.description", "type": "str"}, - "time_zone_id": {"key": "properties.timeZoneId", "type": "str"}, - "schedule_list": {"key": "properties.scheduleList", "type": "[ScheduleItem]"}, - "next_run_action": {"key": "properties.nextRunAction", "type": "str"}, - "next_execution_time": {"key": "properties.nextExecutionTime", "type": "str"}, - } - - def __init__( - self, - *, - description: str = "", - time_zone_id: str = "UTC", - schedule_list: Optional[list["_models.ScheduleItem"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword description: The description of the schedule. - :paramtype description: str - :keyword time_zone_id: The time zone of the schedule. - :paramtype time_zone_id: str - :keyword schedule_list: Schedule list. - :paramtype schedule_list: list[~azure.mgmt.sql.models.ScheduleItem] - """ - super().__init__(**kwargs) - self.system_data: Optional["_models.SystemData"] = None - self.description = description - self.time_zone_id = time_zone_id - self.schedule_list = schedule_list - self.next_run_action: Optional[str] = None - self.next_execution_time: Optional[str] = None - - -class StartStopManagedInstanceScheduleListResult(_serialization.Model): # pylint: disable=name-too-long - """Managed instance's Start/Stop schedule list result. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.StartStopManagedInstanceSchedule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[StartStopManagedInstanceSchedule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.StartStopManagedInstanceSchedule"]] = None - self.next_link: Optional[str] = None - - -class StorageCapability(_serialization.Model): - """The storage account type capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar storage_account_type: The storage account type for the database's backups. Known values - are: "GRS", "LRS", "ZRS", and "GZRS". - :vartype storage_account_type: str or - ~azure.mgmt.sql.models.StorageCapabilityStorageAccountType - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "storage_account_type": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "storage_account_type": {"key": "storageAccountType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.storage_account_type: Optional[Union[str, "_models.StorageCapabilityStorageAccountType"]] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason - - -class SubscriptionUsage(ProxyResource): - """Usage Metric of a Subscription in a Location. - - 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 display_name: User-readable name of the metric. - :vartype display_name: str - :ivar current_value: Current value of the metric. - :vartype current_value: float - :ivar limit: Boundary value of the metric. - :vartype limit: float - :ivar unit: Unit of the metric. - :vartype unit: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "display_name": {"readonly": True}, - "current_value": {"readonly": True}, - "limit": {"readonly": True}, - "unit": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - "current_value": {"key": "properties.currentValue", "type": "float"}, - "limit": {"key": "properties.limit", "type": "float"}, - "unit": {"key": "properties.unit", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.display_name: Optional[str] = None - self.current_value: Optional[float] = None - self.limit: Optional[float] = None - self.unit: Optional[str] = None - - -class SubscriptionUsageListResult(_serialization.Model): - """A list of subscription usage metrics in a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SubscriptionUsage] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SubscriptionUsage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SubscriptionUsage"]] = None - self.next_link: Optional[str] = None - - -class SynapseLinkWorkspace(ProxyResource): - """Synapse link workspace 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 workspaces: List of all synapselink workspaces. - :vartype workspaces: list[~azure.mgmt.sql.models.SynapseLinkWorkspaceInfoProperties] - """ - - _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"}, - "workspaces": {"key": "properties.workspaces", "type": "[SynapseLinkWorkspaceInfoProperties]"}, - } - - def __init__( - self, *, workspaces: Optional[list["_models.SynapseLinkWorkspaceInfoProperties"]] = None, **kwargs: Any - ) -> None: - """ - :keyword workspaces: List of all synapselink workspaces. - :paramtype workspaces: list[~azure.mgmt.sql.models.SynapseLinkWorkspaceInfoProperties] - """ - super().__init__(**kwargs) - self.workspaces = workspaces - - -class SynapseLinkWorkspaceInfoProperties(_serialization.Model): - """Properties of a Synapse link workspaces. - - :ivar workspace_id: Synapse link workspace id. - :vartype workspace_id: str - :ivar link_connection_name: Link connection name. - :vartype link_connection_name: str - """ - - _attribute_map = { - "workspace_id": {"key": "workspaceId", "type": "str"}, - "link_connection_name": {"key": "linkConnectionName", "type": "str"}, - } - - def __init__( - self, *, workspace_id: Optional[str] = None, link_connection_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword workspace_id: Synapse link workspace id. - :paramtype workspace_id: str - :keyword link_connection_name: Link connection name. - :paramtype link_connection_name: str - """ - super().__init__(**kwargs) - self.workspace_id = workspace_id - self.link_connection_name = link_connection_name - - -class SynapseLinkWorkspaceListResult(_serialization.Model): - """A list of synapselink workspaces. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SynapseLinkWorkspace] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SynapseLinkWorkspace]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SynapseLinkWorkspace"]] = None - self.next_link: Optional[str] = None - - -class SyncAgent(ProxyResource): - """An Azure SQL Database sync agent. - - 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 name_properties_name: Name of the sync agent. - :vartype name_properties_name: str - :ivar sync_database_id: ARM resource id of the sync database in the sync agent. - :vartype sync_database_id: str - :ivar last_alive_time: Last alive time of the sync agent. - :vartype last_alive_time: ~datetime.datetime - :ivar state: State of the sync agent. Known values are: "Online", "Offline", and - "NeverConnected". - :vartype state: str or ~azure.mgmt.sql.models.SyncAgentState - :ivar is_up_to_date: If the sync agent version is up to date. - :vartype is_up_to_date: bool - :ivar expiry_time: Expiration time of the sync agent version. - :vartype expiry_time: ~datetime.datetime - :ivar version: Version of the sync agent. - :vartype version: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "name_properties_name": {"readonly": True}, - "last_alive_time": {"readonly": True}, - "state": {"readonly": True}, - "is_up_to_date": {"readonly": True}, - "expiry_time": {"readonly": True}, - "version": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "name_properties_name": {"key": "properties.name", "type": "str"}, - "sync_database_id": {"key": "properties.syncDatabaseId", "type": "str"}, - "last_alive_time": {"key": "properties.lastAliveTime", "type": "iso-8601"}, - "state": {"key": "properties.state", "type": "str"}, - "is_up_to_date": {"key": "properties.isUpToDate", "type": "bool"}, - "expiry_time": {"key": "properties.expiryTime", "type": "iso-8601"}, - "version": {"key": "properties.version", "type": "str"}, - } - - def __init__(self, *, sync_database_id: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword sync_database_id: ARM resource id of the sync database in the sync agent. - :paramtype sync_database_id: str - """ - super().__init__(**kwargs) - self.name_properties_name: Optional[str] = None - self.sync_database_id = sync_database_id - self.last_alive_time: Optional[datetime.datetime] = None - self.state: Optional[Union[str, "_models.SyncAgentState"]] = None - self.is_up_to_date: Optional[bool] = None - self.expiry_time: Optional[datetime.datetime] = None - self.version: Optional[str] = None - - -class SyncAgentKeyProperties(_serialization.Model): - """Properties of an Azure SQL Database sync agent key. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar sync_agent_key: Key of sync agent. - :vartype sync_agent_key: str - """ - - _validation = { - "sync_agent_key": {"readonly": True}, - } - - _attribute_map = { - "sync_agent_key": {"key": "syncAgentKey", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sync_agent_key: Optional[str] = None - - -class SyncAgentLinkedDatabase(ProxyResource): - """An Azure SQL Database sync agent linked database. - - 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 database_type: Type of the sync agent linked database. Known values are: - "AzureSqlDatabase" and "SqlServerDatabase". - :vartype database_type: str or ~azure.mgmt.sql.models.SyncMemberDbType - :ivar database_id: Id of the sync agent linked database. - :vartype database_id: str - :ivar description: Description of the sync agent linked database. - :vartype description: str - :ivar server_name: Server name of the sync agent linked database. - :vartype server_name: str - :ivar database_name: Database name of the sync agent linked database. - :vartype database_name: str - :ivar user_name: User name of the sync agent linked database. - :vartype user_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "database_type": {"readonly": True}, - "database_id": {"readonly": True}, - "description": {"readonly": True}, - "server_name": {"readonly": True}, - "database_name": {"readonly": True}, - "user_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_type": {"key": "properties.databaseType", "type": "str"}, - "database_id": {"key": "properties.databaseId", "type": "str"}, - "description": {"key": "properties.description", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "user_name": {"key": "properties.userName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.database_type: Optional[Union[str, "_models.SyncMemberDbType"]] = None - self.database_id: Optional[str] = None - self.description: Optional[str] = None - self.server_name: Optional[str] = None - self.database_name: Optional[str] = None - self.user_name: Optional[str] = None - - -class SyncAgentLinkedDatabaseListResult(_serialization.Model): - """A list of sync agent linked databases. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncAgentLinkedDatabase] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncAgentLinkedDatabase]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncAgentLinkedDatabase"]] = None - self.next_link: Optional[str] = None - - -class SyncAgentListResult(_serialization.Model): - """A list of sync agents. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncAgent] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncAgent]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncAgent"]] = None - self.next_link: Optional[str] = None - - -class SyncDatabaseIdListResult(_serialization.Model): - """A list of sync database ID properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncDatabaseIdProperties] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncDatabaseIdProperties]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncDatabaseIdProperties"]] = None - self.next_link: Optional[str] = None - - -class SyncDatabaseIdProperties(_serialization.Model): - """Properties of the sync database id. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: ARM resource id of sync database. - :vartype id: str - """ - - _validation = { - "id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - - -class SyncFullSchemaProperties(_serialization.Model): - """Properties of the database full schema. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tables: List of tables in the database full schema. - :vartype tables: list[~azure.mgmt.sql.models.SyncFullSchemaTable] - :ivar last_update_time: Last update time of the database schema. - :vartype last_update_time: ~datetime.datetime - """ - - _validation = { - "tables": {"readonly": True}, - "last_update_time": {"readonly": True}, - } - - _attribute_map = { - "tables": {"key": "tables", "type": "[SyncFullSchemaTable]"}, - "last_update_time": {"key": "lastUpdateTime", "type": "iso-8601"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.tables: Optional[list["_models.SyncFullSchemaTable"]] = None - self.last_update_time: Optional[datetime.datetime] = None - - -class SyncFullSchemaPropertiesListResult(_serialization.Model): - """A list of sync schema properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncFullSchemaProperties]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncFullSchemaProperties"]] = None - self.next_link: Optional[str] = None - - -class SyncFullSchemaTable(_serialization.Model): - """Properties of the table in the database full schema. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar columns: List of columns in the table of database full schema. - :vartype columns: list[~azure.mgmt.sql.models.SyncFullSchemaTableColumn] - :ivar error_id: Error id of the table. - :vartype error_id: str - :ivar has_error: If there is error in the table. - :vartype has_error: bool - :ivar name: Name of the table. - :vartype name: str - :ivar quoted_name: Quoted name of the table. - :vartype quoted_name: str - """ - - _validation = { - "columns": {"readonly": True}, - "error_id": {"readonly": True}, - "has_error": {"readonly": True}, - "name": {"readonly": True}, - "quoted_name": {"readonly": True}, - } - - _attribute_map = { - "columns": {"key": "columns", "type": "[SyncFullSchemaTableColumn]"}, - "error_id": {"key": "errorId", "type": "str"}, - "has_error": {"key": "hasError", "type": "bool"}, - "name": {"key": "name", "type": "str"}, - "quoted_name": {"key": "quotedName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.columns: Optional[list["_models.SyncFullSchemaTableColumn"]] = None - self.error_id: Optional[str] = None - self.has_error: Optional[bool] = None - self.name: Optional[str] = None - self.quoted_name: Optional[str] = None - - -class SyncFullSchemaTableColumn(_serialization.Model): - """Properties of the column in the table of database full schema. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar data_size: Data size of the column. - :vartype data_size: str - :ivar data_type: Data type of the column. - :vartype data_type: str - :ivar error_id: Error id of the column. - :vartype error_id: str - :ivar has_error: If there is error in the table. - :vartype has_error: bool - :ivar is_primary_key: If it is the primary key of the table. - :vartype is_primary_key: bool - :ivar name: Name of the column. - :vartype name: str - :ivar quoted_name: Quoted name of the column. - :vartype quoted_name: str - """ - - _validation = { - "data_size": {"readonly": True}, - "data_type": {"readonly": True}, - "error_id": {"readonly": True}, - "has_error": {"readonly": True}, - "is_primary_key": {"readonly": True}, - "name": {"readonly": True}, - "quoted_name": {"readonly": True}, - } - - _attribute_map = { - "data_size": {"key": "dataSize", "type": "str"}, - "data_type": {"key": "dataType", "type": "str"}, - "error_id": {"key": "errorId", "type": "str"}, - "has_error": {"key": "hasError", "type": "bool"}, - "is_primary_key": {"key": "isPrimaryKey", "type": "bool"}, - "name": {"key": "name", "type": "str"}, - "quoted_name": {"key": "quotedName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.data_size: Optional[str] = None - self.data_type: Optional[str] = None - self.error_id: Optional[str] = None - self.has_error: Optional[bool] = None - self.is_primary_key: Optional[bool] = None - self.name: Optional[str] = None - self.quoted_name: Optional[str] = None - - -class SyncGroup(ProxyResource): - """An Azure SQL Database sync group. - - 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 sku: The name and capacity of the SKU. - :vartype sku: ~azure.mgmt.sql.models.Sku - :ivar interval: Sync interval of the sync group. - :vartype interval: int - :ivar last_sync_time: Last sync time of the sync group. - :vartype last_sync_time: ~datetime.datetime - :ivar conflict_resolution_policy: Conflict resolution policy of the sync group. Known values - are: "HubWin" and "MemberWin". - :vartype conflict_resolution_policy: str or ~azure.mgmt.sql.models.SyncConflictResolutionPolicy - :ivar sync_database_id: ARM resource id of the sync database in the sync group. - :vartype sync_database_id: str - :ivar hub_database_user_name: User name for the sync group hub database credential. - :vartype hub_database_user_name: str - :ivar hub_database_password: Password for the sync group hub database credential. - :vartype hub_database_password: str - :ivar sync_state: Sync state of the sync group. Known values are: "NotReady", "Error", - "Warning", "Progressing", and "Good". - :vartype sync_state: str or ~azure.mgmt.sql.models.SyncGroupState - :ivar schema: Sync schema of the sync group. - :vartype schema: ~azure.mgmt.sql.models.SyncGroupSchema - :ivar enable_conflict_logging: If conflict logging is enabled. - :vartype enable_conflict_logging: bool - :ivar conflict_logging_retention_in_days: Conflict logging retention period. - :vartype conflict_logging_retention_in_days: int - :ivar use_private_link_connection: If use private link connection is enabled. - :vartype use_private_link_connection: bool - :ivar private_endpoint_name: Private endpoint name of the sync group if use private link - connection is enabled. - :vartype private_endpoint_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "last_sync_time": {"readonly": True}, - "sync_state": {"readonly": True}, - "private_endpoint_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "sku": {"key": "sku", "type": "Sku"}, - "interval": {"key": "properties.interval", "type": "int"}, - "last_sync_time": {"key": "properties.lastSyncTime", "type": "iso-8601"}, - "conflict_resolution_policy": {"key": "properties.conflictResolutionPolicy", "type": "str"}, - "sync_database_id": {"key": "properties.syncDatabaseId", "type": "str"}, - "hub_database_user_name": {"key": "properties.hubDatabaseUserName", "type": "str"}, - "hub_database_password": {"key": "properties.hubDatabasePassword", "type": "str"}, - "sync_state": {"key": "properties.syncState", "type": "str"}, - "schema": {"key": "properties.schema", "type": "SyncGroupSchema"}, - "enable_conflict_logging": {"key": "properties.enableConflictLogging", "type": "bool"}, - "conflict_logging_retention_in_days": {"key": "properties.conflictLoggingRetentionInDays", "type": "int"}, - "use_private_link_connection": {"key": "properties.usePrivateLinkConnection", "type": "bool"}, - "private_endpoint_name": {"key": "properties.privateEndpointName", "type": "str"}, - } - - def __init__( - self, - *, - sku: Optional["_models.Sku"] = None, - interval: Optional[int] = None, - conflict_resolution_policy: Optional[Union[str, "_models.SyncConflictResolutionPolicy"]] = None, - sync_database_id: Optional[str] = None, - hub_database_user_name: Optional[str] = None, - hub_database_password: Optional[str] = None, - schema: Optional["_models.SyncGroupSchema"] = None, - enable_conflict_logging: Optional[bool] = None, - conflict_logging_retention_in_days: Optional[int] = None, - use_private_link_connection: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword sku: The name and capacity of the SKU. - :paramtype sku: ~azure.mgmt.sql.models.Sku - :keyword interval: Sync interval of the sync group. - :paramtype interval: int - :keyword conflict_resolution_policy: Conflict resolution policy of the sync group. Known values - are: "HubWin" and "MemberWin". - :paramtype conflict_resolution_policy: str or - ~azure.mgmt.sql.models.SyncConflictResolutionPolicy - :keyword sync_database_id: ARM resource id of the sync database in the sync group. - :paramtype sync_database_id: str - :keyword hub_database_user_name: User name for the sync group hub database credential. - :paramtype hub_database_user_name: str - :keyword hub_database_password: Password for the sync group hub database credential. - :paramtype hub_database_password: str - :keyword schema: Sync schema of the sync group. - :paramtype schema: ~azure.mgmt.sql.models.SyncGroupSchema - :keyword enable_conflict_logging: If conflict logging is enabled. - :paramtype enable_conflict_logging: bool - :keyword conflict_logging_retention_in_days: Conflict logging retention period. - :paramtype conflict_logging_retention_in_days: int - :keyword use_private_link_connection: If use private link connection is enabled. - :paramtype use_private_link_connection: bool - """ - super().__init__(**kwargs) - self.sku = sku - self.interval = interval - self.last_sync_time: Optional[datetime.datetime] = None - self.conflict_resolution_policy = conflict_resolution_policy - self.sync_database_id = sync_database_id - self.hub_database_user_name = hub_database_user_name - self.hub_database_password = hub_database_password - self.sync_state: Optional[Union[str, "_models.SyncGroupState"]] = None - self.schema = schema - self.enable_conflict_logging = enable_conflict_logging - self.conflict_logging_retention_in_days = conflict_logging_retention_in_days - self.use_private_link_connection = use_private_link_connection - self.private_endpoint_name: Optional[str] = None - - -class SyncGroupListResult(_serialization.Model): - """A list of sync groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncGroup"]] = None - self.next_link: Optional[str] = None - - -class SyncGroupLogListResult(_serialization.Model): - """A list of sync group log properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncGroupLogProperties] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncGroupLogProperties]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncGroupLogProperties"]] = None - self.next_link: Optional[str] = None - - -class SyncGroupLogProperties(_serialization.Model): - """Properties of an Azure SQL Database sync group log. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar timestamp: Timestamp of the sync group log. - :vartype timestamp: ~datetime.datetime - :ivar type: Type of the sync group log. Known values are: "All", "Error", "Warning", and - "Success". - :vartype type: str or ~azure.mgmt.sql.models.SyncGroupLogType - :ivar source: Source of the sync group log. - :vartype source: str - :ivar details: Details of the sync group log. - :vartype details: str - :ivar tracing_id: TracingId of the sync group log. - :vartype tracing_id: str - :ivar operation_status: OperationStatus of the sync group log. - :vartype operation_status: str - """ - - _validation = { - "timestamp": {"readonly": True}, - "type": {"readonly": True}, - "source": {"readonly": True}, - "details": {"readonly": True}, - "tracing_id": {"readonly": True}, - "operation_status": {"readonly": True}, - } - - _attribute_map = { - "timestamp": {"key": "timestamp", "type": "iso-8601"}, - "type": {"key": "type", "type": "str"}, - "source": {"key": "source", "type": "str"}, - "details": {"key": "details", "type": "str"}, - "tracing_id": {"key": "tracingId", "type": "str"}, - "operation_status": {"key": "operationStatus", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.timestamp: Optional[datetime.datetime] = None - self.type: Optional[Union[str, "_models.SyncGroupLogType"]] = None - self.source: Optional[str] = None - self.details: Optional[str] = None - self.tracing_id: Optional[str] = None - self.operation_status: Optional[str] = None - - -class SyncGroupSchema(_serialization.Model): - """Properties of sync group schema. - - :ivar tables: List of tables in sync group schema. - :vartype tables: list[~azure.mgmt.sql.models.SyncGroupSchemaTable] - :ivar master_sync_member_name: Name of master sync member where the schema is from. - :vartype master_sync_member_name: str - """ - - _attribute_map = { - "tables": {"key": "tables", "type": "[SyncGroupSchemaTable]"}, - "master_sync_member_name": {"key": "masterSyncMemberName", "type": "str"}, - } - - def __init__( - self, - *, - tables: Optional[list["_models.SyncGroupSchemaTable"]] = None, - master_sync_member_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword tables: List of tables in sync group schema. - :paramtype tables: list[~azure.mgmt.sql.models.SyncGroupSchemaTable] - :keyword master_sync_member_name: Name of master sync member where the schema is from. - :paramtype master_sync_member_name: str - """ - super().__init__(**kwargs) - self.tables = tables - self.master_sync_member_name = master_sync_member_name - - -class SyncGroupSchemaTable(_serialization.Model): - """Properties of table in sync group schema. - - :ivar columns: List of columns in sync group schema. - :vartype columns: list[~azure.mgmt.sql.models.SyncGroupSchemaTableColumn] - :ivar quoted_name: Quoted name of sync group schema table. - :vartype quoted_name: str - """ - - _attribute_map = { - "columns": {"key": "columns", "type": "[SyncGroupSchemaTableColumn]"}, - "quoted_name": {"key": "quotedName", "type": "str"}, - } - - def __init__( - self, - *, - columns: Optional[list["_models.SyncGroupSchemaTableColumn"]] = None, - quoted_name: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword columns: List of columns in sync group schema. - :paramtype columns: list[~azure.mgmt.sql.models.SyncGroupSchemaTableColumn] - :keyword quoted_name: Quoted name of sync group schema table. - :paramtype quoted_name: str - """ - super().__init__(**kwargs) - self.columns = columns - self.quoted_name = quoted_name - - -class SyncGroupSchemaTableColumn(_serialization.Model): - """Properties of column in sync group table. - - :ivar quoted_name: Quoted name of sync group table column. - :vartype quoted_name: str - :ivar data_size: Data size of the column. - :vartype data_size: str - :ivar data_type: Data type of the column. - :vartype data_type: str - """ - - _attribute_map = { - "quoted_name": {"key": "quotedName", "type": "str"}, - "data_size": {"key": "dataSize", "type": "str"}, - "data_type": {"key": "dataType", "type": "str"}, - } - - def __init__( - self, - *, - quoted_name: Optional[str] = None, - data_size: Optional[str] = None, - data_type: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword quoted_name: Quoted name of sync group table column. - :paramtype quoted_name: str - :keyword data_size: Data size of the column. - :paramtype data_size: str - :keyword data_type: Data type of the column. - :paramtype data_type: str - """ - super().__init__(**kwargs) - self.quoted_name = quoted_name - self.data_size = data_size - self.data_type = data_type - - -class SyncMember(ProxyResource): - """An Azure SQL Database sync member. - - 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 database_type: Database type of the sync member. Known values are: "AzureSqlDatabase" and - "SqlServerDatabase". - :vartype database_type: str or ~azure.mgmt.sql.models.SyncMemberDbType - :ivar sync_agent_id: ARM resource id of the sync agent in the sync member. - :vartype sync_agent_id: str - :ivar sql_server_database_id: SQL Server database id of the sync member. - :vartype sql_server_database_id: str - :ivar sync_member_azure_database_resource_id: ARM resource id of the sync member logical - database, for sync members in Azure. - :vartype sync_member_azure_database_resource_id: str - :ivar use_private_link_connection: Whether to use private link connection. - :vartype use_private_link_connection: bool - :ivar private_endpoint_name: Private endpoint name of the sync member if use private link - connection is enabled, for sync members in Azure. - :vartype private_endpoint_name: str - :ivar server_name: Server name of the member database in the sync member. - :vartype server_name: str - :ivar database_name: Database name of the member database in the sync member. - :vartype database_name: str - :ivar user_name: User name of the member database in the sync member. - :vartype user_name: str - :ivar password: Password of the member database in the sync member. - :vartype password: str - :ivar sync_direction: Sync direction of the sync member. Known values are: "Bidirectional", - "OneWayMemberToHub", and "OneWayHubToMember". - :vartype sync_direction: str or ~azure.mgmt.sql.models.SyncDirection - :ivar sync_state: Sync state of the sync member. Known values are: "SyncInProgress", - "SyncSucceeded", "SyncFailed", "DisabledTombstoneCleanup", "DisabledBackupRestore", - "SyncSucceededWithWarnings", "SyncCancelling", "SyncCancelled", "UnProvisioned", - "Provisioning", "Provisioned", "ProvisionFailed", "DeProvisioning", "DeProvisioned", - "DeProvisionFailed", "Reprovisioning", "ReprovisionFailed", and "UnReprovisioned". - :vartype sync_state: str or ~azure.mgmt.sql.models.SyncMemberState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "private_endpoint_name": {"readonly": True}, - "sync_state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "database_type": {"key": "properties.databaseType", "type": "str"}, - "sync_agent_id": {"key": "properties.syncAgentId", "type": "str"}, - "sql_server_database_id": {"key": "properties.sqlServerDatabaseId", "type": "str"}, - "sync_member_azure_database_resource_id": { - "key": "properties.syncMemberAzureDatabaseResourceId", - "type": "str", - }, - "use_private_link_connection": {"key": "properties.usePrivateLinkConnection", "type": "bool"}, - "private_endpoint_name": {"key": "properties.privateEndpointName", "type": "str"}, - "server_name": {"key": "properties.serverName", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "user_name": {"key": "properties.userName", "type": "str"}, - "password": {"key": "properties.password", "type": "str"}, - "sync_direction": {"key": "properties.syncDirection", "type": "str"}, - "sync_state": {"key": "properties.syncState", "type": "str"}, - } - - def __init__( - self, - *, - database_type: Optional[Union[str, "_models.SyncMemberDbType"]] = None, - sync_agent_id: Optional[str] = None, - sql_server_database_id: Optional[str] = None, - sync_member_azure_database_resource_id: Optional[str] = None, - use_private_link_connection: Optional[bool] = None, - server_name: Optional[str] = None, - database_name: Optional[str] = None, - user_name: Optional[str] = None, - password: Optional[str] = None, - sync_direction: Optional[Union[str, "_models.SyncDirection"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword database_type: Database type of the sync member. Known values are: "AzureSqlDatabase" - and "SqlServerDatabase". - :paramtype database_type: str or ~azure.mgmt.sql.models.SyncMemberDbType - :keyword sync_agent_id: ARM resource id of the sync agent in the sync member. - :paramtype sync_agent_id: str - :keyword sql_server_database_id: SQL Server database id of the sync member. - :paramtype sql_server_database_id: str - :keyword sync_member_azure_database_resource_id: ARM resource id of the sync member logical - database, for sync members in Azure. - :paramtype sync_member_azure_database_resource_id: str - :keyword use_private_link_connection: Whether to use private link connection. - :paramtype use_private_link_connection: bool - :keyword server_name: Server name of the member database in the sync member. - :paramtype server_name: str - :keyword database_name: Database name of the member database in the sync member. - :paramtype database_name: str - :keyword user_name: User name of the member database in the sync member. - :paramtype user_name: str - :keyword password: Password of the member database in the sync member. - :paramtype password: str - :keyword sync_direction: Sync direction of the sync member. Known values are: "Bidirectional", - "OneWayMemberToHub", and "OneWayHubToMember". - :paramtype sync_direction: str or ~azure.mgmt.sql.models.SyncDirection - """ - super().__init__(**kwargs) - self.database_type = database_type - self.sync_agent_id = sync_agent_id - self.sql_server_database_id = sql_server_database_id - self.sync_member_azure_database_resource_id = sync_member_azure_database_resource_id - self.use_private_link_connection = use_private_link_connection - self.private_endpoint_name: Optional[str] = None - self.server_name = server_name - self.database_name = database_name - self.user_name = user_name - self.password = password - self.sync_direction = sync_direction - self.sync_state: Optional[Union[str, "_models.SyncMemberState"]] = None - - -class SyncMemberListResult(_serialization.Model): - """A list of Azure SQL Database sync members. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.SyncMember] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[SyncMember]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.SyncMember"]] = None - self.next_link: Optional[str] = None - - -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TdeCertificate(ProxyResource): - """A TDE certificate that can be uploaded into a server. - - 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 private_blob: The base64 encoded certificate private blob. - :vartype private_blob: str - :ivar cert_password: The certificate password. - :vartype cert_password: str - """ - - _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"}, - "private_blob": {"key": "properties.privateBlob", "type": "str"}, - "cert_password": {"key": "properties.certPassword", "type": "str"}, - } - - def __init__( - self, *, private_blob: Optional[str] = None, cert_password: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword private_blob: The base64 encoded certificate private blob. - :paramtype private_blob: str - :keyword cert_password: The certificate password. - :paramtype cert_password: str - """ - super().__init__(**kwargs) - self.private_blob = private_blob - self.cert_password = cert_password - - -class TimeZone(ProxyResource): - """Time Zone property. - - 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 time_zone_id: The time zone id. - :vartype time_zone_id: str - :ivar display_name: The time zone display name. - :vartype display_name: str - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "time_zone_id": {"readonly": True}, - "display_name": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "time_zone_id": {"key": "properties.timeZoneId", "type": "str"}, - "display_name": {"key": "properties.displayName", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.time_zone_id: Optional[str] = None - self.display_name: Optional[str] = None - - -class TimeZoneListResult(_serialization.Model): - """A list of time zones. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.TimeZone] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TimeZone]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.TimeZone"]] = None - self.next_link: Optional[str] = None - - -class TopQueries(_serialization.Model): - """TopQueries. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar number_of_queries: Requested number of top queries. - :vartype number_of_queries: int - :ivar aggregation_function: Aggregation function used to calculate query metrics. - :vartype aggregation_function: str - :ivar observation_metric: Metric used to rank queries. - :vartype observation_metric: str - :ivar interval_type: Interval type (length). Known values are: "PT1H" and "P1D". - :vartype interval_type: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: str - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: str - :ivar queries: List of top resource consuming queries with appropriate metric data. - :vartype queries: list[~azure.mgmt.sql.models.QueryStatisticsProperties] - """ - - _validation = { - "number_of_queries": {"readonly": True}, - "aggregation_function": {"readonly": True}, - "observation_metric": {"readonly": True}, - "interval_type": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - } - - _attribute_map = { - "number_of_queries": {"key": "numberOfQueries", "type": "int"}, - "aggregation_function": {"key": "aggregationFunction", "type": "str"}, - "observation_metric": {"key": "observationMetric", "type": "str"}, - "interval_type": {"key": "intervalType", "type": "str"}, - "start_time": {"key": "startTime", "type": "str"}, - "end_time": {"key": "endTime", "type": "str"}, - "queries": {"key": "queries", "type": "[QueryStatisticsProperties]"}, - } - - def __init__(self, *, queries: Optional[list["_models.QueryStatisticsProperties"]] = None, **kwargs: Any) -> None: - """ - :keyword queries: List of top resource consuming queries with appropriate metric data. - :paramtype queries: list[~azure.mgmt.sql.models.QueryStatisticsProperties] - """ - super().__init__(**kwargs) - self.number_of_queries: Optional[int] = None - self.aggregation_function: Optional[str] = None - self.observation_metric: Optional[str] = None - self.interval_type: Optional[Union[str, "_models.QueryTimeGrainType"]] = None - self.start_time: Optional[str] = None - self.end_time: Optional[str] = None - self.queries = queries - - -class TopQueriesListResult(_serialization.Model): - """A list of top resource consuming queries on managed instance. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.TopQueries] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[TopQueries]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.TopQueries"]] = None - self.next_link: Optional[str] = None - - -class UpdateLongTermRetentionBackupParameters(_serialization.Model): - """Contains the information necessary to perform long term retention backup update operation. - - :ivar requested_backup_storage_redundancy: The storage redundancy type of the copied backup. - Known values are: "Geo", "Local", "Zone", and "GeoZone". - :vartype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - """ - - _attribute_map = { - "requested_backup_storage_redundancy": {"key": "properties.requestedBackupStorageRedundancy", "type": "str"}, - } - - def __init__( - self, - *, - requested_backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword requested_backup_storage_redundancy: The storage redundancy type of the copied backup. - Known values are: "Geo", "Local", "Zone", and "GeoZone". - :paramtype requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.BackupStorageRedundancy - """ - super().__init__(**kwargs) - self.requested_backup_storage_redundancy = requested_backup_storage_redundancy - - -class UpdateVirtualClusterDnsServersOperation(ProxyResource): - """A refresh DNS servers operation. - - 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 status: The status of the DNS refresh operation. Known values are: "Succeeded", "Failed", - and "InProgress". - :vartype status: str or ~azure.mgmt.sql.models.DNSRefreshOperationStatus - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "status": {"key": "properties.status", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.status: Optional[Union[str, "_models.DNSRefreshOperationStatus"]] = None - - -class UpsertManagedServerOperationParameters(_serialization.Model): - """UpsertManagedServerOperationParameters. - - :ivar family: - :vartype family: str - :ivar tier: - :vartype tier: str - :ivar v_cores: - :vartype v_cores: int - :ivar storage_size_in_gb: - :vartype storage_size_in_gb: int - """ - - _attribute_map = { - "family": {"key": "family", "type": "str"}, - "tier": {"key": "tier", "type": "str"}, - "v_cores": {"key": "vCores", "type": "int"}, - "storage_size_in_gb": {"key": "storageSizeInGB", "type": "int"}, - } - - def __init__( - self, - *, - family: Optional[str] = None, - tier: Optional[str] = None, - v_cores: Optional[int] = None, - storage_size_in_gb: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword family: - :paramtype family: str - :keyword tier: - :paramtype tier: str - :keyword v_cores: - :paramtype v_cores: int - :keyword storage_size_in_gb: - :paramtype storage_size_in_gb: int - """ - super().__init__(**kwargs) - self.family = family - self.tier = tier - self.v_cores = v_cores - self.storage_size_in_gb = storage_size_in_gb - - -class UpsertManagedServerOperationStepWithEstimatesAndDuration(_serialization.Model): # pylint: disable=name-too-long - """UpsertManagedServerOperationStepWithEstimatesAndDuration. - - :ivar step_start_time: - :vartype step_start_time: ~datetime.datetime - :ivar step_end_time: - :vartype step_end_time: ~datetime.datetime - :ivar time_elapsed: - :vartype time_elapsed: str - :ivar order: - :vartype order: int - :ivar name: - :vartype name: str - :ivar status: Known values are: "NotStarted", "InProgress", "SlowedDown", "Completed", - "Failed", and "Canceled". - :vartype status: str or - ~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus - """ - - _attribute_map = { - "step_start_time": {"key": "stepStartTime", "type": "iso-8601"}, - "step_end_time": {"key": "stepEndTime", "type": "iso-8601"}, - "time_elapsed": {"key": "timeElapsed", "type": "str"}, - "order": {"key": "order", "type": "int"}, - "name": {"key": "name", "type": "str"}, - "status": {"key": "status", "type": "str"}, - } - - def __init__( - self, - *, - step_start_time: Optional[datetime.datetime] = None, - step_end_time: Optional[datetime.datetime] = None, - time_elapsed: Optional[str] = None, - order: Optional[int] = None, - name: Optional[str] = None, - status: Optional[Union[str, "_models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword step_start_time: - :paramtype step_start_time: ~datetime.datetime - :keyword step_end_time: - :paramtype step_end_time: ~datetime.datetime - :keyword time_elapsed: - :paramtype time_elapsed: str - :keyword order: - :paramtype order: int - :keyword name: - :paramtype name: str - :keyword status: Known values are: "NotStarted", "InProgress", "SlowedDown", "Completed", - "Failed", and "Canceled". - :paramtype status: str or - ~azure.mgmt.sql.models.UpsertManagedServerOperationStepWithEstimatesAndDurationStatus - """ - super().__init__(**kwargs) - self.step_start_time = step_start_time - self.step_end_time = step_end_time - self.time_elapsed = time_elapsed - self.order = order - self.name = name - self.status = status - - -class Usage(_serialization.Model): - """ARM usage. - - 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: ~azure.mgmt.sql.models.Name - :ivar type: Resource type. - :vartype type: str - :ivar unit: Usage unit. - :vartype unit: str - :ivar current_value: Usage current value. - :vartype current_value: int - :ivar limit: Usage limit. - :vartype limit: int - :ivar requested_limit: Usage requested limit. - :vartype requested_limit: int - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "unit": {"readonly": True}, - "current_value": {"readonly": True}, - "limit": {"readonly": True}, - "requested_limit": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "Name"}, - "type": {"key": "type", "type": "str"}, - "unit": {"key": "unit", "type": "str"}, - "current_value": {"key": "currentValue", "type": "int"}, - "limit": {"key": "limit", "type": "int"}, - "requested_limit": {"key": "requestedLimit", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id: Optional[str] = None - self.name: Optional["_models.Name"] = None - self.type: Optional[str] = None - self.unit: Optional[str] = None - self.current_value: Optional[int] = None - self.limit: Optional[int] = None - self.requested_limit: Optional[int] = None - - -class UsageListResult(_serialization.Model): - """A list of usages. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.Usage] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[Usage]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.Usage"]] = None - self.next_link: Optional[str] = None - - -class UserIdentity(_serialization.Model): - """Azure Active Directory identity configuration for a resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar principal_id: The Azure Active Directory principal id. - :vartype principal_id: str - :ivar client_id: The Azure Active Directory client id. - :vartype client_id: str - """ - - _validation = { - "principal_id": {"readonly": True}, - "client_id": {"readonly": True}, - } - - _attribute_map = { - "principal_id": {"key": "principalId", "type": "str"}, - "client_id": {"key": "clientId", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.principal_id: Optional[str] = None - self.client_id: Optional[str] = None - - -class VaRule(_serialization.Model): - """SQL Vulnerability Assessment rule metadata details. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar rule_id: SQL Vulnerability Assessment rule Id. - :vartype rule_id: str - :ivar severity: SQL Vulnerability Assessment rule severity. Known values are: "High", "Medium", - "Low", "Informational", and "Obsolete". - :vartype severity: str or ~azure.mgmt.sql.models.RuleSeverity - :ivar category: SQL Vulnerability Assessment rule category. - :vartype category: str - :ivar rule_type: SQL Vulnerability Assessment rule type. Known values are: "Binary", - "BaselineExpected", "PositiveList", and "NegativeList". - :vartype rule_type: str or ~azure.mgmt.sql.models.RuleType - :ivar title: SQL Vulnerability Assessment rule title. - :vartype title: str - :ivar description: SQL Vulnerability Assessment rule description. - :vartype description: str - :ivar rationale: SQL Vulnerability Assessment rule rationale. - :vartype rationale: str - :ivar query_check: SQL Vulnerability Assessment rule query details. - :vartype query_check: ~azure.mgmt.sql.models.QueryCheck - :ivar benchmark_references: SQL Vulnerability Assessment benchmark references. - :vartype benchmark_references: list[~azure.mgmt.sql.models.BenchmarkReference] - """ - - _validation = { - "rule_id": {"readonly": True}, - "severity": {"readonly": True}, - "category": {"readonly": True}, - "rule_type": {"readonly": True}, - "title": {"readonly": True}, - "description": {"readonly": True}, - "rationale": {"readonly": True}, - "query_check": {"readonly": True}, - "benchmark_references": {"readonly": True}, - } - - _attribute_map = { - "rule_id": {"key": "ruleId", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, - "category": {"key": "category", "type": "str"}, - "rule_type": {"key": "ruleType", "type": "str"}, - "title": {"key": "title", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "rationale": {"key": "rationale", "type": "str"}, - "query_check": {"key": "queryCheck", "type": "QueryCheck"}, - "benchmark_references": {"key": "benchmarkReferences", "type": "[BenchmarkReference]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.rule_id: Optional[str] = None - self.severity: Optional[Union[str, "_models.RuleSeverity"]] = None - self.category: Optional[str] = None - self.rule_type: Optional[Union[str, "_models.RuleType"]] = None - self.title: Optional[str] = None - self.description: Optional[str] = None - self.rationale: Optional[str] = None - self.query_check: Optional["_models.QueryCheck"] = None - self.benchmark_references: Optional[list["_models.BenchmarkReference"]] = None - - -class VirtualCluster(TrackedResource): - """An Azure SQL virtual cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. Required. - :vartype location: str - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar subnet_id: Subnet resource ID for the virtual cluster. - :vartype subnet_id: str - :ivar version: Virtual cluster version. - :vartype version: str - :ivar child_resources: List of resources in this virtual cluster. - :vartype child_resources: list[str] - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "location": {"required": True}, - "subnet_id": {"readonly": True}, - "child_resources": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "tags": {"key": "tags", "type": "{str}"}, - "subnet_id": {"key": "properties.subnetId", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "child_resources": {"key": "properties.childResources", "type": "[str]"}, - } - - def __init__( - self, *, location: str, tags: Optional[dict[str, str]] = None, version: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword location: Resource location. Required. - :paramtype location: str - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword version: Virtual cluster version. - :paramtype version: str - """ - super().__init__(location=location, tags=tags, **kwargs) - self.subnet_id: Optional[str] = None - self.version = version - self.child_resources: Optional[list[str]] = None - - -class VirtualClusterListResult(_serialization.Model): - """A list of virtual clusters. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.VirtualCluster] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[VirtualCluster]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.VirtualCluster"]] = None - self.next_link: Optional[str] = None - - -class VirtualClusterUpdate(_serialization.Model): - """An update request for virtual cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar subnet_id: Subnet resource ID for the virtual cluster. - :vartype subnet_id: str - :ivar version: Virtual cluster version. - :vartype version: str - :ivar child_resources: List of resources in this virtual cluster. - :vartype child_resources: list[str] - """ - - _validation = { - "subnet_id": {"readonly": True}, - "child_resources": {"readonly": True}, - } - - _attribute_map = { - "tags": {"key": "tags", "type": "{str}"}, - "subnet_id": {"key": "properties.subnetId", "type": "str"}, - "version": {"key": "properties.version", "type": "str"}, - "child_resources": {"key": "properties.childResources", "type": "[str]"}, - } - - def __init__(self, *, tags: Optional[dict[str, str]] = None, version: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword version: Virtual cluster version. - :paramtype version: str - """ - super().__init__(**kwargs) - self.tags = tags - self.subnet_id: Optional[str] = None - self.version = version - self.child_resources: Optional[list[str]] = None - - -class VirtualNetworkRule(ProxyResource): - """A virtual network rule. - - 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 virtual_network_subnet_id: The ARM resource id of the virtual network subnet. - :vartype virtual_network_subnet_id: str - :ivar ignore_missing_vnet_service_endpoint: Create firewall rule before the virtual network has - vnet service endpoint enabled. - :vartype ignore_missing_vnet_service_endpoint: bool - :ivar state: Virtual Network Rule State. Known values are: "Initializing", "InProgress", - "Ready", "Failed", "Deleting", and "Unknown". - :vartype state: str or ~azure.mgmt.sql.models.VirtualNetworkRuleState - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "state": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "virtual_network_subnet_id": {"key": "properties.virtualNetworkSubnetId", "type": "str"}, - "ignore_missing_vnet_service_endpoint": {"key": "properties.ignoreMissingVnetServiceEndpoint", "type": "bool"}, - "state": {"key": "properties.state", "type": "str"}, - } - - def __init__( - self, - *, - virtual_network_subnet_id: Optional[str] = None, - ignore_missing_vnet_service_endpoint: Optional[bool] = None, - **kwargs: Any - ) -> None: - """ - :keyword virtual_network_subnet_id: The ARM resource id of the virtual network subnet. - :paramtype virtual_network_subnet_id: str - :keyword ignore_missing_vnet_service_endpoint: Create firewall rule before the virtual network - has vnet service endpoint enabled. - :paramtype ignore_missing_vnet_service_endpoint: bool - """ - super().__init__(**kwargs) - self.virtual_network_subnet_id = virtual_network_subnet_id - self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint - self.state: Optional[Union[str, "_models.VirtualNetworkRuleState"]] = None - - -class VirtualNetworkRuleListResult(_serialization.Model): - """A list of virtual network rules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.VirtualNetworkRule] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[VirtualNetworkRule]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.VirtualNetworkRule"]] = None - self.next_link: Optional[str] = None - - -class VulnerabilityAssessmentRecurringScansProperties(_serialization.Model): # pylint: disable=name-too-long - """Properties of a Vulnerability Assessment recurring scans. - - :ivar is_enabled: Recurring scans state. - :vartype is_enabled: bool - :ivar email_subscription_admins: Specifies that the schedule scan notification will be is sent - to the subscription administrators. - :vartype email_subscription_admins: bool - :ivar emails: Specifies an array of e-mail addresses to which the scan notification is sent. - :vartype emails: list[str] - """ - - _attribute_map = { - "is_enabled": {"key": "isEnabled", "type": "bool"}, - "email_subscription_admins": {"key": "emailSubscriptionAdmins", "type": "bool"}, - "emails": {"key": "emails", "type": "[str]"}, - } - - def __init__( - self, - *, - is_enabled: Optional[bool] = None, - email_subscription_admins: bool = True, - emails: Optional[list[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword is_enabled: Recurring scans state. - :paramtype is_enabled: bool - :keyword email_subscription_admins: Specifies that the schedule scan notification will be is - sent to the subscription administrators. - :paramtype email_subscription_admins: bool - :keyword emails: Specifies an array of e-mail addresses to which the scan notification is sent. - :paramtype emails: list[str] - """ - super().__init__(**kwargs) - self.is_enabled = is_enabled - self.email_subscription_admins = email_subscription_admins - self.emails = emails - - -class VulnerabilityAssessmentScanError(_serialization.Model): - """Properties of a vulnerability assessment scan error. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str - """ - - _validation = { - "code": {"readonly": True}, - "message": {"readonly": True}, - } - - _attribute_map = { - "code": {"key": "code", "type": "str"}, - "message": {"key": "message", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.code: Optional[str] = None - self.message: Optional[str] = None - - -class VulnerabilityAssessmentScanRecord(ProxyResource): - """A vulnerability assessment scan record. - - 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 scan_id: The scan ID. - :vartype scan_id: str - :ivar trigger_type: The scan trigger type. Known values are: "OnDemand" and "Recurring". - :vartype trigger_type: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanTriggerType - :ivar state: The scan status. Known values are: "Passed", "Failed", "FailedToRun", and - "InProgress". - :vartype state: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentScanState - :ivar start_time: The scan start time (UTC). - :vartype start_time: ~datetime.datetime - :ivar end_time: The scan end time (UTC). - :vartype end_time: ~datetime.datetime - :ivar errors: The scan errors. - :vartype errors: list[~azure.mgmt.sql.models.VulnerabilityAssessmentScanError] - :ivar storage_container_path: The scan results storage container path. - :vartype storage_container_path: str - :ivar number_of_failed_security_checks: The number of failed security checks. - :vartype number_of_failed_security_checks: int - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "scan_id": {"readonly": True}, - "trigger_type": {"readonly": True}, - "state": {"readonly": True}, - "start_time": {"readonly": True}, - "end_time": {"readonly": True}, - "errors": {"readonly": True}, - "storage_container_path": {"readonly": True}, - "number_of_failed_security_checks": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "scan_id": {"key": "properties.scanId", "type": "str"}, - "trigger_type": {"key": "properties.triggerType", "type": "str"}, - "state": {"key": "properties.state", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "iso-8601"}, - "end_time": {"key": "properties.endTime", "type": "iso-8601"}, - "errors": {"key": "properties.errors", "type": "[VulnerabilityAssessmentScanError]"}, - "storage_container_path": {"key": "properties.storageContainerPath", "type": "str"}, - "number_of_failed_security_checks": {"key": "properties.numberOfFailedSecurityChecks", "type": "int"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.scan_id: Optional[str] = None - self.trigger_type: Optional[Union[str, "_models.VulnerabilityAssessmentScanTriggerType"]] = None - self.state: Optional[Union[str, "_models.VulnerabilityAssessmentScanState"]] = None - self.start_time: Optional[datetime.datetime] = None - self.end_time: Optional[datetime.datetime] = None - self.errors: Optional[list["_models.VulnerabilityAssessmentScanError"]] = None - self.storage_container_path: Optional[str] = None - self.number_of_failed_security_checks: Optional[int] = None - - -class VulnerabilityAssessmentScanRecordListResult(_serialization.Model): # pylint: disable=name-too-long - """A list of vulnerability assessment scan records. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[VulnerabilityAssessmentScanRecord]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.VulnerabilityAssessmentScanRecord"]] = None - self.next_link: Optional[str] = None - - -class WorkloadClassifier(ProxyResource): - """Workload classifier operations for a data warehouse. - - 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 member_name: The workload classifier member name. - :vartype member_name: str - :ivar label: The workload classifier label. - :vartype label: str - :ivar context: The workload classifier context. - :vartype context: str - :ivar start_time: The workload classifier start time for classification. - :vartype start_time: str - :ivar end_time: The workload classifier end time for classification. - :vartype end_time: str - :ivar importance: The workload classifier importance. - :vartype importance: str - """ - - _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"}, - "member_name": {"key": "properties.memberName", "type": "str"}, - "label": {"key": "properties.label", "type": "str"}, - "context": {"key": "properties.context", "type": "str"}, - "start_time": {"key": "properties.startTime", "type": "str"}, - "end_time": {"key": "properties.endTime", "type": "str"}, - "importance": {"key": "properties.importance", "type": "str"}, - } - - def __init__( - self, - *, - member_name: Optional[str] = None, - label: Optional[str] = None, - context: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - importance: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword member_name: The workload classifier member name. - :paramtype member_name: str - :keyword label: The workload classifier label. - :paramtype label: str - :keyword context: The workload classifier context. - :paramtype context: str - :keyword start_time: The workload classifier start time for classification. - :paramtype start_time: str - :keyword end_time: The workload classifier end time for classification. - :paramtype end_time: str - :keyword importance: The workload classifier importance. - :paramtype importance: str - """ - super().__init__(**kwargs) - self.member_name = member_name - self.label = label - self.context = context - self.start_time = start_time - self.end_time = end_time - self.importance = importance - - -class WorkloadClassifierListResult(_serialization.Model): - """A list of workload classifiers for a workload group. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.WorkloadClassifier] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[WorkloadClassifier]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.WorkloadClassifier"]] = None - self.next_link: Optional[str] = None - - -class WorkloadGroup(ProxyResource): - """Workload group operations for a data warehouse. - - 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 min_resource_percent: The workload group minimum percentage resource. - :vartype min_resource_percent: int - :ivar max_resource_percent: The workload group cap percentage resource. - :vartype max_resource_percent: int - :ivar min_resource_percent_per_request: The workload group request minimum grant percentage. - :vartype min_resource_percent_per_request: float - :ivar max_resource_percent_per_request: The workload group request maximum grant percentage. - :vartype max_resource_percent_per_request: float - :ivar importance: The workload group importance level. - :vartype importance: str - :ivar query_execution_timeout: The workload group query execution timeout. - :vartype query_execution_timeout: int - """ - - _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"}, - "min_resource_percent": {"key": "properties.minResourcePercent", "type": "int"}, - "max_resource_percent": {"key": "properties.maxResourcePercent", "type": "int"}, - "min_resource_percent_per_request": {"key": "properties.minResourcePercentPerRequest", "type": "float"}, - "max_resource_percent_per_request": {"key": "properties.maxResourcePercentPerRequest", "type": "float"}, - "importance": {"key": "properties.importance", "type": "str"}, - "query_execution_timeout": {"key": "properties.queryExecutionTimeout", "type": "int"}, - } - - def __init__( - self, - *, - min_resource_percent: Optional[int] = None, - max_resource_percent: Optional[int] = None, - min_resource_percent_per_request: Optional[float] = None, - max_resource_percent_per_request: Optional[float] = None, - importance: Optional[str] = None, - query_execution_timeout: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword min_resource_percent: The workload group minimum percentage resource. - :paramtype min_resource_percent: int - :keyword max_resource_percent: The workload group cap percentage resource. - :paramtype max_resource_percent: int - :keyword min_resource_percent_per_request: The workload group request minimum grant percentage. - :paramtype min_resource_percent_per_request: float - :keyword max_resource_percent_per_request: The workload group request maximum grant percentage. - :paramtype max_resource_percent_per_request: float - :keyword importance: The workload group importance level. - :paramtype importance: str - :keyword query_execution_timeout: The workload group query execution timeout. - :paramtype query_execution_timeout: int - """ - super().__init__(**kwargs) - self.min_resource_percent = min_resource_percent - self.max_resource_percent = max_resource_percent - self.min_resource_percent_per_request = min_resource_percent_per_request - self.max_resource_percent_per_request = max_resource_percent_per_request - self.importance = importance - self.query_execution_timeout = query_execution_timeout - - -class WorkloadGroupListResult(_serialization.Model): - """A list of workload groups. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Array of results. - :vartype value: list[~azure.mgmt.sql.models.WorkloadGroup] - :ivar next_link: Link to retrieve next page of results. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[WorkloadGroup]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value: Optional[list["_models.WorkloadGroup"]] = None - self.next_link: Optional[str] = None - - -class ZonePinningCapability(_serialization.Model): - """The zone pinning capability. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar availability_zone: Name of the availability zone. - :vartype availability_zone: str - :ivar status: The status of the capability. Known values are: "Visible", "Available", - "Default", and "Disabled". - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :ivar reason: The reason for the capability not being available. - :vartype reason: str - """ - - _validation = { - "availability_zone": {"readonly": True}, - "status": {"readonly": True}, - } - - _attribute_map = { - "availability_zone": {"key": "availabilityZone", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "reason": {"key": "reason", "type": "str"}, - } - - def __init__(self, *, reason: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword reason: The reason for the capability not being available. - :paramtype reason: str - """ - super().__init__(**kwargs) - self.availability_zone: Optional[str] = None - self.status: Optional[Union[str, "_models.CapabilityStatus"]] = None - self.reason = reason diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_patch.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): 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 8add9d7322c9..52d6388fc113 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 @@ -1,9 +1,8 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- # pylint: disable=wrong-import-position @@ -13,239 +12,225 @@ if TYPE_CHECKING: from ._patch import * # pylint: disable=unused-wildcard-import -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations # type: ignore -from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations # type: ignore -from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore -from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore -from ._database_advanced_threat_protection_settings_operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._database_advisors_operations import DatabaseAdvisorsOperations # type: ignore -from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations # type: ignore -from ._database_columns_operations import DatabaseColumnsOperations # type: ignore -from ._database_encryption_protectors_operations import DatabaseEncryptionProtectorsOperations # type: ignore -from ._database_extensions_operations import DatabaseExtensionsOperations # type: ignore -from ._database_operations_operations import DatabaseOperationsOperations # type: ignore -from ._database_recommended_actions_operations import DatabaseRecommendedActionsOperations # type: ignore -from ._databases_operations import DatabasesOperations # type: ignore -from ._database_schemas_operations import DatabaseSchemasOperations # type: ignore -from ._database_security_alert_policies_operations import DatabaseSecurityAlertPoliciesOperations # type: ignore -from ._database_sql_vulnerability_assessment_baselines_operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_execute_scan_operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._database_sql_vulnerability_assessment_rule_baselines_operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_sql_vulnerability_assessment_scan_result_operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._database_sql_vulnerability_assessment_scans_operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore -from ._database_sql_vulnerability_assessments_settings_operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._database_tables_operations import DatabaseTablesOperations # type: ignore -from ._database_usages_operations import DatabaseUsagesOperations # type: ignore -from ._database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore -from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore -from ._data_masking_policies_operations import DataMaskingPoliciesOperations # type: ignore -from ._data_masking_rules_operations import DataMaskingRulesOperations # type: ignore -from ._data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations # type: ignore -from ._deleted_servers_operations import DeletedServersOperations # type: ignore -from ._distributed_availability_groups_operations import DistributedAvailabilityGroupsOperations # type: ignore -from ._elastic_pool_operations_operations import ElasticPoolOperationsOperations # type: ignore -from ._elastic_pools_operations import ElasticPoolsOperations # type: ignore -from ._encryption_protectors_operations import EncryptionProtectorsOperations # type: ignore -from ._endpoint_certificates_operations import EndpointCertificatesOperations # type: ignore -from ._failover_groups_operations import FailoverGroupsOperations # type: ignore -from ._firewall_rules_operations import FirewallRulesOperations # type: ignore -from ._geo_backup_policies_operations import GeoBackupPoliciesOperations # type: ignore -from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations # type: ignore -from ._instance_pool_operations_operations import InstancePoolOperationsOperations # type: ignore -from ._instance_pools_operations import InstancePoolsOperations # type: ignore -from ._ipv6_firewall_rules_operations import IPv6FirewallRulesOperations # type: ignore -from ._job_agents_operations import JobAgentsOperations # type: ignore -from ._job_credentials_operations import JobCredentialsOperations # type: ignore -from ._job_executions_operations import JobExecutionsOperations # type: ignore -from ._job_private_endpoints_operations import JobPrivateEndpointsOperations # type: ignore -from ._jobs_operations import JobsOperations # type: ignore -from ._job_step_executions_operations import JobStepExecutionsOperations # type: ignore -from ._job_steps_operations import JobStepsOperations # type: ignore -from ._job_target_executions_operations import JobTargetExecutionsOperations # type: ignore -from ._job_target_groups_operations import JobTargetGroupsOperations # type: ignore -from ._job_versions_operations import JobVersionsOperations # type: ignore -from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations # type: ignore -from ._capabilities_operations import CapabilitiesOperations # type: ignore -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations # type: ignore -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore -from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations # type: ignore -from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations # type: ignore -from ._maintenance_windows_operations import MaintenanceWindowsOperations # type: ignore -from ._managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore -from ._managed_database_advanced_threat_protection_settings_operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_database_columns_operations import ManagedDatabaseColumnsOperations # type: ignore -from ._managed_database_move_operations_operations import ManagedDatabaseMoveOperationsOperations # type: ignore -from ._managed_database_queries_operations import ManagedDatabaseQueriesOperations # type: ignore -from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations # type: ignore -from ._managed_databases_operations import ManagedDatabasesOperations # type: ignore -from ._managed_database_schemas_operations import ManagedDatabaseSchemasOperations # type: ignore -from ._managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore -from ._managed_database_security_events_operations import ManagedDatabaseSecurityEventsOperations # type: ignore -from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore -from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore -from ._managed_database_tables_operations import ManagedDatabaseTablesOperations # type: ignore -from ._managed_database_transparent_data_encryption_operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore -from ._managed_database_vulnerability_assessment_rule_baselines_operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore -from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore -from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations # type: ignore -from ._managed_instance_advanced_threat_protection_settings_operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore -from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore -from ._managed_instance_dtcs_operations import ManagedInstanceDtcsOperations # type: ignore -from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore -from ._managed_instance_keys_operations import ManagedInstanceKeysOperations # type: ignore -from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore -from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations # type: ignore -from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore -from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore -from ._managed_instances_operations import ManagedInstancesOperations # type: ignore -from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations # type: ignore -from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore -from ._managed_ledger_digest_uploads_operations import ManagedLedgerDigestUploadsOperations # type: ignore -from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore -from ._managed_server_dns_aliases_operations import ManagedServerDnsAliasesOperations # type: ignore -from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore from ._operations import Operations # type: ignore -from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations # type: ignore -from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations # type: ignore -from ._private_link_resources_operations import PrivateLinkResourcesOperations # type: ignore -from ._recoverable_databases_operations import RecoverableDatabasesOperations # type: ignore -from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations # type: ignore -from ._replication_links_operations import ReplicationLinksOperations # type: ignore -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations # type: ignore -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations # type: ignore -from ._restore_points_operations import RestorePointsOperations # type: ignore -from ._sensitivity_labels_operations import SensitivityLabelsOperations # type: ignore -from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations # type: ignore -from ._server_advanced_threat_protection_settings_operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore -from ._server_advisors_operations import ServerAdvisorsOperations # type: ignore -from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations # type: ignore -from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations # type: ignore -from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore -from ._server_configuration_options_operations import ServerConfigurationOptionsOperations # type: ignore -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations # type: ignore -from ._server_dev_ops_audit_settings_operations import ServerDevOpsAuditSettingsOperations # type: ignore -from ._server_dns_aliases_operations import ServerDnsAliasesOperations # type: ignore -from ._server_keys_operations import ServerKeysOperations # type: ignore -from ._server_operations_operations import ServerOperationsOperations # type: ignore -from ._servers_operations import ServersOperations # type: ignore -from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations # type: ignore -from ._server_trust_certificates_operations import ServerTrustCertificatesOperations # type: ignore -from ._server_trust_groups_operations import ServerTrustGroupsOperations # type: ignore -from ._server_usages_operations import ServerUsagesOperations # type: ignore -from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations # type: ignore -from ._sql_agent_operations import SqlAgentOperations # type: ignore -from ._sql_vulnerability_assessment_baseline_operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore -from ._sql_vulnerability_assessment_baselines_operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore -from ._sql_vulnerability_assessment_execute_scan_operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore -from ._sql_vulnerability_assessment_rule_baseline_operations import SqlVulnerabilityAssessmentRuleBaselineOperations # type: ignore -from ._sql_vulnerability_assessment_rule_baselines_operations import SqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore -from ._sql_vulnerability_assessment_scan_result_operations import SqlVulnerabilityAssessmentScanResultOperations # type: ignore -from ._sql_vulnerability_assessment_scans_operations import SqlVulnerabilityAssessmentScansOperations # type: ignore -from ._sql_vulnerability_assessments_settings_operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore -from ._sql_vulnerability_assessments_operations import SqlVulnerabilityAssessmentsOperations # type: ignore -from ._start_stop_managed_instance_schedules_operations import StartStopManagedInstanceSchedulesOperations # type: ignore -from ._subscription_usages_operations import SubscriptionUsagesOperations # type: ignore -from ._synapse_link_workspaces_operations import SynapseLinkWorkspacesOperations # type: ignore -from ._sync_agents_operations import SyncAgentsOperations # type: ignore -from ._sync_groups_operations import SyncGroupsOperations # type: ignore -from ._sync_members_operations import SyncMembersOperations # type: ignore -from ._tde_certificates_operations import TdeCertificatesOperations # type: ignore -from ._time_zones_operations import TimeZonesOperations # type: ignore -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations # type: ignore -from ._usages_operations import UsagesOperations # type: ignore -from ._virtual_clusters_operations import VirtualClustersOperations # type: ignore -from ._virtual_network_rules_operations import VirtualNetworkRulesOperations # type: ignore -from ._workload_classifiers_operations import WorkloadClassifiersOperations # type: ignore -from ._workload_groups_operations import WorkloadGroupsOperations # type: ignore +from ._operations import BackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import DatabaseColumnsOperations # type: ignore +from ._operations import RestorePointsOperations # type: ignore +from ._operations import SensitivityLabelsOperations # type: ignore +from ._operations import DatabasesOperations # type: ignore +from ._operations import FirewallRulesOperations # type: ignore +from ._operations import ReplicationLinksOperations # type: ignore +from ._operations import ServersOperations # type: ignore +from ._operations import ServerBlobAuditingPoliciesOperations # type: ignore +from ._operations import DatabaseBlobAuditingPoliciesOperations # type: ignore +from ._operations import ExtendedDatabaseBlobAuditingPoliciesOperations # type: ignore +from ._operations import ExtendedServerBlobAuditingPoliciesOperations # type: ignore +from ._operations import ServerAdvisorsOperations # type: ignore +from ._operations import ManagedDatabaseColumnsOperations # type: ignore +from ._operations import DatabaseTablesOperations # type: ignore +from ._operations import ManagedDatabaseTablesOperations # type: ignore +from ._operations import DatabaseSchemasOperations # type: ignore +from ._operations import ManagedDatabaseSchemasOperations # type: ignore +from ._operations import DatabaseSecurityAlertPoliciesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentBaselineOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentsOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentsSettingsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentRuleBaselineOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentScanResultOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedDatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DataMaskingPoliciesOperations # type: ignore +from ._operations import DeletedServersOperations # type: ignore +from ._operations import DistributedAvailabilityGroupsOperations # type: ignore +from ._operations import ManagedDatabasesOperations # type: ignore +from ._operations import ServerTrustGroupsOperations # type: ignore +from ._operations import ManagedInstancesOperations # type: ignore +from ._operations import ElasticPoolsOperations # type: ignore +from ._operations import EncryptionProtectorsOperations # type: ignore +from ._operations import EndpointCertificatesOperations # type: ignore +from ._operations import FailoverGroupsOperations # type: ignore +from ._operations import GeoBackupPoliciesOperations # type: ignore +from ._operations import InstanceFailoverGroupsOperations # type: ignore +from ._operations import InstancePoolOperationsOperations # type: ignore +from ._operations import InstancePoolsOperations # type: ignore +from ._operations import IPv6FirewallRulesOperations # type: ignore +from ._operations import JobExecutionsOperations # type: ignore +from ._operations import JobAgentsOperations # type: ignore +from ._operations import JobCredentialsOperations # type: ignore +from ._operations import JobStepExecutionsOperations # type: ignore +from ._operations import JobTargetExecutionsOperations # type: ignore +from ._operations import JobsOperations # type: ignore +from ._operations import JobPrivateEndpointsOperations # type: ignore +from ._operations import JobStepsOperations # type: ignore +from ._operations import JobTargetGroupsOperations # type: ignore +from ._operations import JobVersionsOperations # type: ignore +from ._operations import LongTermRetentionBackupsOperations # type: ignore +from ._operations import LongTermRetentionManagedInstanceBackupsOperations # type: ignore +from ._operations import LongTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedBackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedDatabaseSecurityAlertPoliciesOperations # type: ignore +from ._operations import ManagedInstanceAdministratorsOperations # type: ignore +from ._operations import ManagedInstanceAzureADOnlyAuthenticationsOperations # type: ignore +from ._operations import ManagedInstanceDtcsOperations # type: ignore +from ._operations import ManagedInstanceEncryptionProtectorsOperations # type: ignore +from ._operations import ManagedInstanceKeysOperations # type: ignore +from ._operations import ManagedInstanceLongTermRetentionPoliciesOperations # type: ignore +from ._operations import ManagedInstanceOperationsOperations # type: ignore +from ._operations import ManagedInstancePrivateEndpointConnectionsOperations # type: ignore +from ._operations import ManagedInstanceVulnerabilityAssessmentsOperations # type: ignore +from ._operations import ManagedServerDnsAliasesOperations # type: ignore +from ._operations import ManagedServerSecurityAlertPoliciesOperations # type: ignore +from ._operations import NetworkSecurityPerimeterConfigurationsOperations # type: ignore +from ._operations import OutboundFirewallRulesOperations # type: ignore +from ._operations import PrivateEndpointConnectionsOperations # type: ignore +from ._operations import PrivateLinkResourcesOperations # type: ignore +from ._operations import RecoverableDatabasesOperations # type: ignore +from ._operations import RecoverableManagedDatabasesOperations # type: ignore +from ._operations import RestorableDroppedDatabasesOperations # type: ignore +from ._operations import RestorableDroppedManagedDatabasesOperations # type: ignore +from ._operations import ServerAzureADAdministratorsOperations # type: ignore +from ._operations import ServerAzureADOnlyAuthenticationsOperations # type: ignore +from ._operations import ServerConfigurationOptionsOperations # type: ignore +from ._operations import ServerConnectionPoliciesOperations # type: ignore +from ._operations import ServerDevOpsAuditSettingsOperations # type: ignore +from ._operations import ServerDnsAliasesOperations # type: ignore +from ._operations import ServerKeysOperations # type: ignore +from ._operations import ServerSecurityAlertPoliciesOperations # type: ignore +from ._operations import ServerTrustCertificatesOperations # type: ignore +from ._operations import ServerVulnerabilityAssessmentsOperations # type: ignore +from ._operations import StartStopManagedInstanceSchedulesOperations # type: ignore +from ._operations import SubscriptionUsagesOperations # type: ignore +from ._operations import SyncAgentsOperations # type: ignore +from ._operations import SyncGroupsOperations # type: ignore +from ._operations import SyncMembersOperations # type: ignore +from ._operations import TimeZonesOperations # type: ignore +from ._operations import VirtualClustersOperations # type: ignore +from ._operations import VirtualNetworkRulesOperations # type: ignore +from ._operations import WorkloadClassifiersOperations # type: ignore +from ._operations import WorkloadGroupsOperations # type: ignore +from ._operations import ManagedDatabaseSensitivityLabelsOperations # type: ignore +from ._operations import DatabaseEncryptionProtectorsOperations # type: ignore +from ._operations import DatabaseOperationsOperations # type: ignore +from ._operations import DatabaseUsagesOperations # type: ignore +from ._operations import RecommendedSensitivityLabelsOperations # type: ignore +from ._operations import SynapseLinkWorkspacesOperations # type: ignore +from ._operations import ServerOperationsOperations # type: ignore +from ._operations import ServerUsagesOperations # type: ignore +from ._operations import TdeCertificatesOperations # type: ignore +from ._operations import DatabaseAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import DatabaseAdvisorsOperations # type: ignore +from ._operations import DatabaseAutomaticTuningOperations # type: ignore +from ._operations import DatabaseExtensionsOperations # type: ignore +from ._operations import DatabaseRecommendedActionsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentBaselinesOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentsSettingsOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentExecuteScanOperations # type: ignore +from ._operations import SqlVulnerabilityAssessmentRuleBaselinesOperations # type: ignore +from ._operations import DatabaseSqlVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DatabaseVulnerabilityAssessmentScansOperations # type: ignore +from ._operations import DataMaskingRulesOperations # type: ignore +from ._operations import DataWarehouseUserActivitiesOperations # type: ignore +from ._operations import ManagedDatabaseSecurityEventsOperations # type: ignore +from ._operations import ManagedDatabaseRecommendedSensitivityLabelsOperations # type: ignore +from ._operations import ManagedInstanceTdeCertificatesOperations # type: ignore +from ._operations import ElasticPoolOperationsOperations # type: ignore +from ._operations import UsagesOperations # type: ignore +from ._operations import LedgerDigestUploadsOperations # type: ignore +from ._operations import MaintenanceWindowOptionsOperations # type: ignore +from ._operations import MaintenanceWindowsOperations # type: ignore +from ._operations import ManagedDatabaseAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ManagedDatabaseMoveOperationsOperations # type: ignore +from ._operations import ManagedDatabaseQueriesOperations # type: ignore +from ._operations import ManagedDatabaseRestoreDetailsOperations # type: ignore +from ._operations import ManagedDatabaseTransparentDataEncryptionOperations # type: ignore +from ._operations import ManagedInstanceAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ManagedInstancePrivateLinkResourcesOperations # type: ignore +from ._operations import ManagedLedgerDigestUploadsOperations # type: ignore +from ._operations import ServerAdvancedThreatProtectionSettingsOperations # type: ignore +from ._operations import ServerAutomaticTuningOperations # type: ignore +from ._operations import SqlAgentOperations # type: ignore +from ._operations import TransparentDataEncryptionsOperations # type: ignore +from ._operations import CapabilitiesOperations # type: ignore from ._patch import __all__ as _patch_all from ._patch import * from ._patch import patch_sdk as _patch_sdk __all__ = [ + "Operations", "BackupShortTermRetentionPoliciesOperations", + "DatabaseColumnsOperations", + "RestorePointsOperations", + "SensitivityLabelsOperations", + "DatabasesOperations", + "FirewallRulesOperations", + "ReplicationLinksOperations", + "ServersOperations", "ServerBlobAuditingPoliciesOperations", "DatabaseBlobAuditingPoliciesOperations", "ExtendedDatabaseBlobAuditingPoliciesOperations", "ExtendedServerBlobAuditingPoliciesOperations", - "DatabaseAdvancedThreatProtectionSettingsOperations", - "DatabaseAdvisorsOperations", - "DatabaseAutomaticTuningOperations", - "DatabaseColumnsOperations", - "DatabaseEncryptionProtectorsOperations", - "DatabaseExtensionsOperations", - "DatabaseOperationsOperations", - "DatabaseRecommendedActionsOperations", - "DatabasesOperations", + "ServerAdvisorsOperations", + "ManagedDatabaseColumnsOperations", + "DatabaseTablesOperations", + "ManagedDatabaseTablesOperations", "DatabaseSchemasOperations", + "ManagedDatabaseSchemasOperations", "DatabaseSecurityAlertPoliciesOperations", - "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", - "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentBaselineOperations", + "SqlVulnerabilityAssessmentsOperations", + "SqlVulnerabilityAssessmentsSettingsOperations", "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations", + "SqlVulnerabilityAssessmentRuleBaselineOperations", "DatabaseSqlVulnerabilityAssessmentScanResultOperations", - "DatabaseSqlVulnerabilityAssessmentScansOperations", - "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", - "DatabaseTablesOperations", - "DatabaseUsagesOperations", + "SqlVulnerabilityAssessmentScanResultOperations", + "SqlVulnerabilityAssessmentScansOperations", "DatabaseVulnerabilityAssessmentRuleBaselinesOperations", + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", "DatabaseVulnerabilityAssessmentsOperations", - "DatabaseVulnerabilityAssessmentScansOperations", + "ManagedDatabaseVulnerabilityAssessmentsOperations", + "ManagedDatabaseVulnerabilityAssessmentScansOperations", "DataMaskingPoliciesOperations", - "DataMaskingRulesOperations", - "DataWarehouseUserActivitiesOperations", "DeletedServersOperations", "DistributedAvailabilityGroupsOperations", - "ElasticPoolOperationsOperations", + "ManagedDatabasesOperations", + "ServerTrustGroupsOperations", + "ManagedInstancesOperations", "ElasticPoolsOperations", "EncryptionProtectorsOperations", "EndpointCertificatesOperations", "FailoverGroupsOperations", - "FirewallRulesOperations", "GeoBackupPoliciesOperations", "InstanceFailoverGroupsOperations", "InstancePoolOperationsOperations", "InstancePoolsOperations", "IPv6FirewallRulesOperations", + "JobExecutionsOperations", "JobAgentsOperations", "JobCredentialsOperations", - "JobExecutionsOperations", - "JobPrivateEndpointsOperations", - "JobsOperations", "JobStepExecutionsOperations", - "JobStepsOperations", "JobTargetExecutionsOperations", + "JobsOperations", + "JobPrivateEndpointsOperations", + "JobStepsOperations", "JobTargetGroupsOperations", "JobVersionsOperations", - "LedgerDigestUploadsOperations", - "CapabilitiesOperations", "LongTermRetentionBackupsOperations", "LongTermRetentionManagedInstanceBackupsOperations", "LongTermRetentionPoliciesOperations", - "MaintenanceWindowOptionsOperations", - "MaintenanceWindowsOperations", "ManagedBackupShortTermRetentionPoliciesOperations", - "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", - "ManagedDatabaseColumnsOperations", - "ManagedDatabaseMoveOperationsOperations", - "ManagedDatabaseQueriesOperations", - "ManagedDatabaseRestoreDetailsOperations", - "ManagedDatabasesOperations", - "ManagedDatabaseSchemasOperations", + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", "ManagedDatabaseSecurityAlertPoliciesOperations", - "ManagedDatabaseSecurityEventsOperations", - "ManagedDatabaseSensitivityLabelsOperations", - "ManagedDatabaseRecommendedSensitivityLabelsOperations", - "ManagedDatabaseTablesOperations", - "ManagedDatabaseTransparentDataEncryptionOperations", - "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations", - "ManagedDatabaseVulnerabilityAssessmentsOperations", - "ManagedDatabaseVulnerabilityAssessmentScansOperations", "ManagedInstanceAdministratorsOperations", - "ManagedInstanceAdvancedThreatProtectionSettingsOperations", "ManagedInstanceAzureADOnlyAuthenticationsOperations", "ManagedInstanceDtcsOperations", "ManagedInstanceEncryptionProtectorsOperations", @@ -253,30 +238,17 @@ "ManagedInstanceLongTermRetentionPoliciesOperations", "ManagedInstanceOperationsOperations", "ManagedInstancePrivateEndpointConnectionsOperations", - "ManagedInstancePrivateLinkResourcesOperations", - "ManagedInstancesOperations", - "ManagedInstanceTdeCertificatesOperations", "ManagedInstanceVulnerabilityAssessmentsOperations", - "ManagedLedgerDigestUploadsOperations", - "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", "ManagedServerDnsAliasesOperations", "ManagedServerSecurityAlertPoliciesOperations", "NetworkSecurityPerimeterConfigurationsOperations", - "Operations", "OutboundFirewallRulesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", "RecoverableDatabasesOperations", "RecoverableManagedDatabasesOperations", - "ReplicationLinksOperations", "RestorableDroppedDatabasesOperations", "RestorableDroppedManagedDatabasesOperations", - "RestorePointsOperations", - "SensitivityLabelsOperations", - "RecommendedSensitivityLabelsOperations", - "ServerAdvancedThreatProtectionSettingsOperations", - "ServerAdvisorsOperations", - "ServerAutomaticTuningOperations", "ServerAzureADAdministratorsOperations", "ServerAzureADOnlyAuthenticationsOperations", "ServerConfigurationOptionsOperations", @@ -284,37 +256,64 @@ "ServerDevOpsAuditSettingsOperations", "ServerDnsAliasesOperations", "ServerKeysOperations", - "ServerOperationsOperations", - "ServersOperations", "ServerSecurityAlertPoliciesOperations", "ServerTrustCertificatesOperations", - "ServerTrustGroupsOperations", - "ServerUsagesOperations", "ServerVulnerabilityAssessmentsOperations", - "SqlAgentOperations", - "SqlVulnerabilityAssessmentBaselineOperations", - "SqlVulnerabilityAssessmentBaselinesOperations", - "SqlVulnerabilityAssessmentExecuteScanOperations", - "SqlVulnerabilityAssessmentRuleBaselineOperations", - "SqlVulnerabilityAssessmentRuleBaselinesOperations", - "SqlVulnerabilityAssessmentScanResultOperations", - "SqlVulnerabilityAssessmentScansOperations", - "SqlVulnerabilityAssessmentsSettingsOperations", - "SqlVulnerabilityAssessmentsOperations", "StartStopManagedInstanceSchedulesOperations", "SubscriptionUsagesOperations", - "SynapseLinkWorkspacesOperations", "SyncAgentsOperations", "SyncGroupsOperations", "SyncMembersOperations", - "TdeCertificatesOperations", "TimeZonesOperations", - "TransparentDataEncryptionsOperations", - "UsagesOperations", "VirtualClustersOperations", "VirtualNetworkRulesOperations", "WorkloadClassifiersOperations", "WorkloadGroupsOperations", + "ManagedDatabaseSensitivityLabelsOperations", + "DatabaseEncryptionProtectorsOperations", + "DatabaseOperationsOperations", + "DatabaseUsagesOperations", + "RecommendedSensitivityLabelsOperations", + "SynapseLinkWorkspacesOperations", + "ServerOperationsOperations", + "ServerUsagesOperations", + "TdeCertificatesOperations", + "DatabaseAdvancedThreatProtectionSettingsOperations", + "DatabaseAdvisorsOperations", + "DatabaseAutomaticTuningOperations", + "DatabaseExtensionsOperations", + "DatabaseRecommendedActionsOperations", + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations", + "SqlVulnerabilityAssessmentBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations", + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentExecuteScanOperations", + "SqlVulnerabilityAssessmentRuleBaselinesOperations", + "DatabaseSqlVulnerabilityAssessmentScansOperations", + "DatabaseVulnerabilityAssessmentScansOperations", + "DataMaskingRulesOperations", + "DataWarehouseUserActivitiesOperations", + "ManagedDatabaseSecurityEventsOperations", + "ManagedDatabaseRecommendedSensitivityLabelsOperations", + "ManagedInstanceTdeCertificatesOperations", + "ElasticPoolOperationsOperations", + "UsagesOperations", + "LedgerDigestUploadsOperations", + "MaintenanceWindowOptionsOperations", + "MaintenanceWindowsOperations", + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations", + "ManagedDatabaseMoveOperationsOperations", + "ManagedDatabaseQueriesOperations", + "ManagedDatabaseRestoreDetailsOperations", + "ManagedDatabaseTransparentDataEncryptionOperations", + "ManagedInstanceAdvancedThreatProtectionSettingsOperations", + "ManagedInstancePrivateLinkResourcesOperations", + "ManagedLedgerDigestUploadsOperations", + "ServerAdvancedThreatProtectionSettingsOperations", + "ServerAutomaticTuningOperations", + "SqlAgentOperations", + "TransparentDataEncryptionsOperations", + "CapabilitiesOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore _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 deleted file mode 100644 index 307940720a39..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,826 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", - ) - 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"), - "policyName": _SERIALIZER.url("policy_name", policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/backupShortTermRetentionPolicies/{policyName}", - ) - 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"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/backupShortTermRetentionPolicies/{policyName}", - ) - 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"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class BackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.BackupShortTermRetentionPolicy"]: - """Gets a database's short term retention policy. - - :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 - :return: An iterator like instance of either BackupShortTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.BackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.BackupShortTermRetentionPolicy: - """Gets a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :return: BackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: _models.BackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :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 BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - BackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_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.BackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BackupShortTermRetentionPolicy]( - 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, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "BackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: _models.BackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy - :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 BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.ShortTermRetentionPolicyName], - parameters: Union[_models.BackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: - """Updates a database's short term retention policy. - - :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 policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - BackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either BackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("BackupShortTermRetentionPolicy", pipeline_response.http_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.BackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.BackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index f3a2b9ea28bc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py +++ /dev/null @@ -1,153 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - location_name: str, - subscription_id: str, - *, - include: Optional[Union[str, _models.CapabilityGroup]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if include is not None: - _params["include"] = _SERIALIZER.query("include", include, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class CapabilitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`capabilities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, location_name: str, include: Optional[Union[str, _models.CapabilityGroup]] = None, **kwargs: Any - ) -> _models.LocationCapabilities: - """Gets the subscription capabilities available for the specified location. - - :param location_name: The location name whose capabilities are retrieved. Required. - :type location_name: str - :param include: If specified, restricts the response to only include the selected item. Known - values are: "supportedEditions", "supportedElasticPoolEditions", - "supportedManagedInstanceVersions", "supportedInstancePoolEditions", - "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. - :type include: str or ~azure.mgmt.sql.models.CapabilityGroup - :return: LocationCapabilities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LocationCapabilities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - include=include, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LocationCapabilities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index fb0383aa82be..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py +++ /dev/null @@ -1,366 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}", - ) - 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"), - "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - 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", "2025-01-01")) - 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}/dataMaskingPolicies/{dataMaskingPolicyName}", - ) - 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"), - "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataMaskingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`data_masking_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Gets the database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: _models.DataMaskingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. 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: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - parameters: Union[_models.DataMaskingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DataMaskingPolicy: - """Creates or updates a database data masking policy. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param parameters: Parameters for creating or updating a data masking policy. Is either a - DataMaskingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or IO[bytes] - :return: DataMaskingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataMaskingPolicy] = 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, "DataMaskingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DataMaskingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 44130d5cc493..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py +++ /dev/null @@ -1,408 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules", - ) - 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"), - "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_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", "2025-01-01")) - 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}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}", - ) - 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"), - "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), - "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataMaskingRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`data_masking_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - **kwargs: Any - ) -> ItemPaged["_models.DataMaskingRule"]: - """Gets a list of database data masking rules. - - :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 data_masking_policy_name: The name of the database for which the data masking rule - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :return: An iterator like instance of either DataMaskingRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataMaskingRule] - :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", self._config.api_version)) - cls: ClsType[_models.DataMaskingRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataMaskingRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: _models.DataMaskingRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. - Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. - 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: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], - data_masking_rule_name: str, - parameters: Union[_models.DataMaskingRule, IO[bytes]], - **kwargs: Any - ) -> _models.DataMaskingRule: - """Creates or updates a database data masking rule. - - :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 data_masking_policy_name: The name of the database for which the data masking policy - applies. "Default" Required. - :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName - :param data_masking_rule_name: The name of the data masking rule. Required. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a data masking rule. Is - either a DataMaskingRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DataMaskingRule or IO[bytes] - :return: DataMaskingRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataMaskingRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataMaskingRule] = 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, "DataMaskingRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_masking_policy_name=data_masking_policy_name, - data_masking_rule_name=data_masking_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DataMaskingRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index af9ab17d0db7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py +++ /dev/null @@ -1,295 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}", - ) - 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"), - "dataWarehouseUserActivityName": _SERIALIZER.url( - "data_warehouse_user_activity_name", data_warehouse_user_activity_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataWarehouseUserActivitiesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`data_warehouse_user_activities` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DataWarehouseUserActivities"]: - """List the user activities of a data warehouse which includes running and suspended queries. - - :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 - :return: An iterator like instance of either DataWarehouseUserActivities or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataWarehouseUserActivities] - :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", self._config.api_version)) - cls: ClsType[_models.DataWarehouseUserActivitiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataWarehouseUserActivitiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], - **kwargs: Any - ) -> _models.DataWarehouseUserActivities: - """Gets the user activities of a data warehouse which includes running and suspended queries. - - :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 data_warehouse_user_activity_name: The activity name of the data warehouse. "current" - Required. - :type data_warehouse_user_activity_name: str or - ~azure.mgmt.sql.models.DataWarehouseUserActivityName - :return: DataWarehouseUserActivities or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - data_warehouse_user_activity_name=data_warehouse_user_activity_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DataWarehouseUserActivities", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 46eb0133c6c3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,499 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - 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"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - 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}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - 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"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseAdvancedThreatProtection"]: - """Gets a list of database's Advanced Threat Protection states. - - :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 - :return: An iterator like instance of either DatabaseAdvancedThreatProtection or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Gets a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.DatabaseAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. 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: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.DatabaseAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseAdvancedThreatProtection: - """Creates or updates a database's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The database Advanced Threat Protection state. Is either a - DatabaseAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection or IO[bytes] - :return: DatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseAdvancedThreatProtection] = 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, "DatabaseAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 4b4ccd6d0495..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py +++ /dev/null @@ -1,469 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - expand: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - advisor_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}", - ) - 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"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - advisor_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", "2025-01-01")) - 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}/advisors/{advisorName}", - ) - 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"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseAdvisorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_advisors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - **kwargs: Any - ) -> List[_models.Advisor]: - """Gets a list of database advisors. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: list of Advisor or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.Advisor] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[Advisor]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> _models.Advisor: - """Gets a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: _models.Advisor, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. 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: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - parameters: Union[_models.Advisor, IO[bytes]], - **kwargs: Any - ) -> _models.Advisor: - """Updates a database advisor. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Is either a Advisor type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor or IO[bytes] - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Advisor] = 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, "Advisor") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c9056fa23076..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py +++ /dev/null @@ -1,332 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/automaticTuning/current", - ) - 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"), - "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) - - -class DatabaseAutomaticTuningOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_automatic_tuning` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Gets a database's automatic tuning. - - :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 - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseAutomaticTuning, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. 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: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseAutomaticTuning, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseAutomaticTuning: - """Update automatic tuning properties for target database. - - :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 parameters: The requested automatic tuning resource state. Is either a - DatabaseAutomaticTuning type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning or IO[bytes] - :return: DatabaseAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseAutomaticTuning] = 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, "DatabaseAutomaticTuning") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 99b125f9ab17..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py +++ /dev/null @@ -1,465 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}", - ) - 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"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/auditingSettings/{blobAuditingPolicyName}", - ) - 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"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseBlobAuditingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseBlobAuditingPolicy"]: - """Lists auditing settings of a database. - - :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 - :return: An iterator like instance of either DatabaseBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Gets a database's blob auditing policy. - - :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 - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. 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: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseBlobAuditingPolicy: - """Creates or updates a database's blob auditing policy. - - :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 parameters: The database blob auditing policy. Is either a DatabaseBlobAuditingPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy or IO[bytes] - :return: DatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseBlobAuditingPolicy] = 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, "DatabaseBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c3984831d1c5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py +++ /dev/null @@ -1,498 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if schema is not None: - _params["schema"] = [_SERIALIZER.query("schema", q, "str") if q is not None else "" for q in schema] - if table is not None: - _params["table"] = [_SERIALIZER.query("table", q, "str") if q is not None else "" for q in table] - if column is not None: - _params["column"] = [_SERIALIZER.query("column", q, "str") if q is not None else "" for q in column] - if order_by is not None: - _params["orderBy"] = [_SERIALIZER.query("order_by", q, "str") if q is not None else "" for q in order_by] - if skiptoken is not None: - _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_table_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseColumnsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_columns` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseColumn"]: - """List database columns. - - :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 schema: Default value is None. - :type schema: list[str] - :param table: Default value is None. - :type table: list[str] - :param column: Default value is None. - :type column: list[str] - :param order_by: Default value is None. - :type order_by: list[str] - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - schema=schema, - table=table, - column=column, - order_by=order_by, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_table( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseColumn"]: - """List database columns. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_table_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> _models.DatabaseColumn: - """Get database column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: DatabaseColumn or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseColumn - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseColumn", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0dc20fd42d4a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_encryption_protectors_operations.py +++ /dev/null @@ -1,404 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_revalidate_request( - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revalidate", - ) - 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"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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_revert_request( - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revert", - ) - 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"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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) - - -class DatabaseEncryptionProtectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _revalidate_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revalidate( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> LROPoller[None]: - """Revalidates an existing encryption protector for a particular database. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _revert_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revert_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revert( - self, - resource_group_name: str, - server_name: str, - database_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> LROPoller[None]: - """Reverts an existing encryption protector for a particular database. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revert_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 876f004728e5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py +++ /dev/null @@ -1,559 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - extension_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}", - ) - 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"), - "extensionName": _SERIALIZER.url("extension_name", extension_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - extension_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", "2025-01-01")) - 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}/extensions/{extensionName}", - ) - 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"), - "extensionName": _SERIALIZER.url("extension_name", extension_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseExtensionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_extensions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ImportExportExtensionsOperationResult"]: - """List database extension. This will return an empty list as it is not supported. - - :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 - :return: An iterator like instance of either ImportExportExtensionsOperationResult or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.ImportExportExtensionsOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any - ) -> None: - """Gets a database extension. This will return resource not found as it is not supported. - - :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 extension_name: Required. - :type extension_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: Union[_models.DatabaseExtensions, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DatabaseExtensions") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - extension_name=extension_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: _models.DatabaseExtensions, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions - :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 ImportExportExtensionsOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import 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 ImportExportExtensionsOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - extension_name: str, - parameters: Union[_models.DatabaseExtensions, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ImportExportExtensionsOperationResult]: - """Perform a database extension operation, like database import, database export, or polybase - import. - - :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 extension_name: Required. - :type extension_name: str - :param parameters: The database import request parameters. Is either a DatabaseExtensions type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions or IO[bytes] - :return: An instance of LROPoller that returns either ImportExportExtensionsOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportExtensionsOperationResult] = 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, - extension_name=extension_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportExtensionsOperationResult", pipeline_response.http_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.ImportExportExtensionsOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ImportExportExtensionsOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 7d5331014294..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations_operations.py +++ /dev/null @@ -1,292 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "serverName": _SERIALIZER.url( - "server_name", server_name, "str", max_length=63, min_length=1, pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$" - ), - "databaseName": _SERIALIZER.url( - "database_name", - database_name, - "str", - max_length=128, - min_length=1, - pattern=r"^[^<>*%&:\\\/?\x00-\x1F]*[^.<>*%&:\\\/?\s\x00-\x1F]$", - ), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, - server_name: str, - database_name: str, - operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel", - ) - 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"), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseOperation"]: - """Gets a list of operations performed on the database. - - :param resource_group_name: The name of the resource group that contains the resource. - 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 - :return: An iterator like instance of either DatabaseOperation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseOperation] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the database. - - :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 operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 183c13705fac..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py +++ /dev/null @@ -1,485 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_advisor_request( - resource_group_name: str, - server_name: str, - database_name: str, - advisor_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions", - ) - 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"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}", - ) - 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"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), - "recommendedActionName": _SERIALIZER.url("recommended_action_name", recommended_action_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_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", "2025-01-01")) - 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}/advisors/{advisorName}/recommendedActions/{recommendedActionName}", - ) - 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"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), - "recommendedActionName": _SERIALIZER.url("recommended_action_name", recommended_action_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseRecommendedActionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_recommended_actions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database_advisor( - self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any - ) -> List[_models.RecommendedActionAutoGenerated]: - """Gets list of Database Recommended Actions. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :return: list of RecommendedActionAutoGenerated or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.RecommendedActionAutoGenerated] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.RecommendedActionAutoGenerated]] = kwargs.pop("cls", None) - - _request = build_list_by_database_advisor_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[RecommendedActionAutoGenerated]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Gets a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecommendedActionAutoGenerated] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - recommended_action_name=recommended_action_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: _models.RecommendedActionAutoGenerated, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. 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: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - advisor_name: str, - recommended_action_name: str, - parameters: Union[_models.RecommendedActionAutoGenerated, IO[bytes]], - **kwargs: Any - ) -> _models.RecommendedActionAutoGenerated: - """Updates a database recommended action. - - :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 advisor_name: The name of the Database Advisor. Required. - :type advisor_name: str - :param recommended_action_name: The name of Database Recommended Action. Required. - :type recommended_action_name: str - :param parameters: The requested recommended action resource state. Is either a - RecommendedActionAutoGenerated type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated or IO[bytes] - :return: RecommendedActionAutoGenerated or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecommendedActionAutoGenerated - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RecommendedActionAutoGenerated] = 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, "RecommendedActionAutoGenerated") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - advisor_name=advisor_name, - recommended_action_name=recommended_action_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecommendedActionAutoGenerated", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 330132f63400..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py +++ /dev/null @@ -1,302 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_schemas` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSchema"]: - """List database schemas. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseSchema or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSchema] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, schema_name: str, **kwargs: Any - ) -> _models.DatabaseSchema: - """Get database schema. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :return: DatabaseSchema or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSchema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSchema", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index e2a5fc9d5d14..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", - ) - 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"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - 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", "2025-01-01")) - 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}/securityAlertPolicies/{securityAlertPolicyName}", - ) - 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"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSecurityAlertPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseSecurityAlertPolicy"]: - """Gets a list of database's security alert policies. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :return: An iterator like instance of either DatabaseSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSecurityAlertListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSecurityAlertListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Gets a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: _models.DatabaseSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. 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: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: Union[_models.DatabaseSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 for which the security alert policy is defined. - Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Is either a DatabaseSecurityAlertPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or IO[bytes] - :return: DatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSecurityAlertPolicy] = 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, "DatabaseSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 4016f0a4a1c4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_baselines_operations.py +++ /dev/null @@ -1,539 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_sql_vulnerability_assessment_request( # pylint: disable=name-too-long - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - 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", "2025-01-01")) - 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}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessment( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentBaselineSet or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessment_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index a0c090a670a7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_execute_scan_operations.py +++ /dev/null @@ -1,232 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_execute_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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) - - -class DatabaseSqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_execute_scan` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _execute_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_execute_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_execute( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :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", self._config.api_version)) - 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._execute_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index f5771ef5dfb7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,683 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_baseline_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - 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, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_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", "2025-01-01")) - 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}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_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, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_baseline( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentRuleBaseline or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_baseline_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Gets a database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineInput type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or - IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 6bddc4542b24..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scan_result_operations.py +++ /dev/null @@ -1,334 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_scan_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), - "scanResultId": _SERIALIZER.url("scan_result_id", scan_result_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_scan_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanResults or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] - :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", self._config.api_version)) - cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanResults: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :param scan_result_id: The scan result id of the specific result to retrieve. Required. - :type scan_result_id: str - :return: SqlVulnerabilityAssessmentScanResults or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - scan_result_id=scan_result_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0d18ae6735fc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,318 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_sql_vulnerability_assessments_request( # pylint: disable=name-too-long - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessments( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanRecord or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessments_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanRecord: - """Get a database vulnerability assessment scan result. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: SqlVulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 85353f0f9cbf..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_sql_vulnerability_assessments_settings_operations.py +++ /dev/null @@ -1,295 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseSqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_sql_vulnerability_assessments_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessment"]: - """Lists SQL Vulnerability Assessment policies associated with a database. - - :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 - :return: An iterator like instance of either SqlVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Gets SQL Vulnerability Assessment policy for database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 1c2cb3433e27..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py +++ /dev/null @@ -1,319 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_schema_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseTablesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_tables` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_schema( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseTable"]: - """List database tables. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseTable or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseTable] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseTableListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - **kwargs: Any - ) -> _models.DatabaseTable: - """Get database table. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :return: DatabaseTable or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseTable - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseTable", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 945df863b0e3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py +++ /dev/null @@ -1,180 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseUsage"]: - """Gets database usages. - - :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 - :return: An iterator like instance of either DatabaseUsage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseUsage] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index afe3c47b90e7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Gets a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseVulnerabilityAssessmentRuleBaseline type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or - IO[bytes] - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseVulnerabilityAssessmentRuleBaseline") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 9b7ce15099e1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,620 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_export_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_initiate_scan_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentScansExport: - """Convert an existing scan result to a human readable format. If already exists nothing happens. - - :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 scanned database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id. Required. - :type scan_id: str - :return: DatabaseVulnerabilityAssessmentScansExport or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) - - _request = build_export_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _initiate_scan_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_initiate_scan( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", self._config.api_version)) - 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._initiate_scan_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index afca531f957d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py +++ /dev/null @@ -1,610 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - 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"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`database_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a database. - - :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 for which the vulnerability assessment policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Gets the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.DatabaseVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.DatabaseVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a DatabaseVulnerabilityAssessment type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or IO[bytes] - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = 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, "DatabaseVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment. - - :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 for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 06f2a564e335..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ /dev/null @@ -1,2485 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, *, skip_token: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}", - ) - 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"), - "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, 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}", - ) - 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"), - "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}", - ) - 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"), - "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_export_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/export", - ) - 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"), - "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_failover_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if replica_type is not None: - _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") - _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_import_method_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/import", - ) - 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"), - "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_rename_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/move", - ) - 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"), - "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_pause_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause", - ) - 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"), - "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_resume_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume", - ) - 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"), - "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_upgrade_data_warehouse_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse", - ) - 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"), - "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_list_by_elastic_pool_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_inaccessible_by_server_request( # pylint: disable=name-too-long - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DatabasesOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, skip_token: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Database"]: - """Gets a list of databases. - - :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 skip_token: Default value is None. - :type skip_token: str - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.Database: - """Gets a database. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: Database or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Database - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Database] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Database", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.Database, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Database") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.Database, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Database - :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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. 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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.Database, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Creates a new database or updates an existing database. - - :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 parameters: The requested database resource state. Is either a Database type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Database or IO[bytes] - :return: An instance of LROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Database] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the database. - - :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 - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.DatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate - :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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. 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 Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.DatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Database]: - """Updates an existing database. - - :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 parameters: The requested database resource state. Is either a DatabaseUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate or IO[bytes] - :return: An instance of LROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Database] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _export_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ExportDatabaseDefinition") - - _request = build_export_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ExportDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition - :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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export 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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_export( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExportDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Exports a database. - - :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 parameters: The database export request parameters. Is either a ExportDatabaseDefinition - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition or IO[bytes] - :return: An instance of LROPoller that returns either ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ImportExportOperationResult]( - 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, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - replica_type=replica_type, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, - resource_group_name: str, - server_name: str, - database_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Failovers a database. - - :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 to failover. Required. - :type database_name: str - :param replica_type: The type of replica to be failed over. Known values are: "Primary" and - "ReadableSecondary". Default value is None. - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - replica_type=replica_type, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _import_method_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ImportExistingDatabaseDefinition") - - _request = build_import_method_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ImportExistingDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition - :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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import 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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_import_method( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ImportExistingDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Is either a - ImportExistingDatabaseDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition or IO[bytes] - :return: An instance of LROPoller that returns either ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ImportExportOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @overload - def rename( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ResourceMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. Required. - :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def rename( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def rename( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ResourceMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> None: - """Renames a database. - - :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 to rename. Required. - :type database_name: str - :param parameters: The resource move definition for renaming this database. Is either a - ResourceMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "ResourceMoveDefinition") - - _request = build_rename_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - def _pause_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_pause( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[_models.Database]: - """Pauses a database. - - :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 to be paused. Required. - :type database_name: str - :return: An instance of LROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.Database] = 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._pause_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _resume_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_resume( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[_models.Database]: - """Resumes a database. - - :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 to be resumed. Required. - :type database_name: str - :return: An instance of LROPoller that returns either Database or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.Database] = 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._resume_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Database", pipeline_response.http_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.Database].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Database]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _upgrade_data_warehouse_initial( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_upgrade_data_warehouse_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_upgrade_data_warehouse( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Upgrades a data warehouse. - - :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 to be upgraded. Required. - :type database_name: str - :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", self._config.api_version)) - 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._upgrade_data_warehouse_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.Database"]: - """Gets a list of databases in an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_inaccessible_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.Database"]: - """Gets a list of inaccessible databases in a logical server. - - :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 - :return: An iterator like instance of either Database or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_inaccessible_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index bb1fc874d938..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py +++ /dev/null @@ -1,506 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers") - path_format_arguments = { - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_location_request(location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_recover_request( - location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_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) - - -class DeletedServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`deleted_servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: - """Gets a list of all deleted servers in a subscription. - - :return: An iterator like instance of either DeletedServer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DeletedServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: - """Gets a list of deleted servers for a location. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either DeletedServer or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DeletedServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: - """Gets a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: DeletedServer or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DeletedServer - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DeletedServer", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _recover_initial(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_recover_request( - location_name=location_name, - deleted_server_name=deleted_server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_recover( - self, location_name: str, deleted_server_name: str, **kwargs: Any - ) -> LROPoller[_models.DeletedServer]: - """Recovers a deleted server. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param deleted_server_name: The name of the deleted server. Required. - :type deleted_server_name: str - :return: An instance of LROPoller that returns either DeletedServer or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DeletedServer] - :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", self._config.api_version)) - cls: ClsType[_models.DeletedServer] = 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._recover_initial( - location_name=location_name, - deleted_server_name=deleted_server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DeletedServer", pipeline_response.http_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.DeletedServer].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.DeletedServer]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index a68f3525bbf5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_distributed_availability_groups_operations.py +++ /dev/null @@ -1,1480 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_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", "2025-01-01")) - 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}", - ) - 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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_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", "2025-01-01")) - 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}", - ) - 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="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", "2025-01-01")) - 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", - ) - 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", "2025-01-01")) - 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", - ) - 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:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`distributed_availability_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.DistributedAvailabilityGroup"]: - """Gets a list of a distributed availability groups in instance. - - :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 iterator like instance of either DistributedAvailabilityGroup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DistributedAvailabilityGroup] - :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", self._config.api_version)) - cls: ClsType[_models.DistributedAvailabilityGroupsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroupsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> _models.DistributedAvailabilityGroup: - """Gets a distributed availability group info. - - :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 - :return: DistributedAvailabilityGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") - - _request = build_create_or_update_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :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_create_or_update( - 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]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. 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_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 info. Is either a - DistributedAvailabilityGroup type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup 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", self._config.api_version)) - 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._create_or_update_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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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.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 _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. - - :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 - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - distributed_availability_group_name=distributed_availability_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "DistributedAvailabilityGroup") - - _request = build_update_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: _models.DistributedAvailabilityGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Updates a distributed availability group replication mode. - - :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 info. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup - :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_update( - 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]: - """Updates a distributed availability group replication mode. - - :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 info. 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_update( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.DistributedAvailabilityGroup]: - """Updates a distributed availability group replication mode. - - :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 info. Is either a - DistributedAvailabilityGroup type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup 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", self._config.api_version)) - 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._update_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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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.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 _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - distributed_availability_group_name: str, - parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - 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", self._config.api_version)) - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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 - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("DistributedAvailabilityGroup", pipeline_response.http_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_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py deleted file mode 100644 index ebcc923de869..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations_operations.py +++ /dev/null @@ -1,282 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_elastic_pool_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ElasticPoolOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`elastic_pool_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_elastic_pool( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.ElasticPoolOperation"]: - """Gets a list of operations performed on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :return: An iterator like instance of either ElasticPoolOperation or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPoolOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ElasticPoolOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_elastic_pool_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the elastic pool. - - :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 elastic_pool_name: Required. - :type elastic_pool_name: str - :param operation_id: The operation identifier. Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 7bc2eaee8bbc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py +++ /dev/null @@ -1,1080 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, *, skip: Optional[int] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - 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}/elasticPools/{elasticPoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - 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}/elasticPools/{elasticPoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_failover_request( - resource_group_name: str, server_name: str, elastic_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_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) - - -class ElasticPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`elastic_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, skip: Optional[int] = None, **kwargs: Any - ) -> ItemPaged["_models.ElasticPool"]: - """Gets all elastic pools in a server. - - :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 skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :return: An iterator like instance of either ElasticPool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - cls: ClsType[_models.ElasticPoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - skip=skip, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ElasticPoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> _models.ElasticPool: - """Gets an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :return: ElasticPool or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ElasticPool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ElasticPool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPool, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ElasticPool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: _models.ElasticPool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPool - :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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool 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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPool, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Creates or updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool parameters. Is either a ElasticPool type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPool or IO[bytes] - :return: An instance of LROPoller that returns either ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticPool] = 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, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ElasticPool", pipeline_response.http_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": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ElasticPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ElasticPoolUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: _models.ElasticPoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate - :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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update 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 ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - elastic_pool_name: str, - parameters: Union[_models.ElasticPoolUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ElasticPool]: - """Updates an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool. Required. - :type elastic_pool_name: str - :param parameters: The elastic pool update parameters. Is either a ElasticPoolUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate or IO[bytes] - :return: An instance of LROPoller that returns either ElasticPool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ElasticPool] = 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, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ElasticPool", pipeline_response.http_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.ElasticPool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ElasticPool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _failover_initial( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Failovers an elastic pool. - - :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 elastic_pool_name: The name of the elastic pool to failover. Required. - :type elastic_pool_name: str - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index c456ba39aad2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py +++ /dev/null @@ -1,702 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - 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}/encryptionProtector/{encryptionProtectorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revalidate_request( - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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) - - -class EncryptionProtectorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.EncryptionProtector"]: - """Gets a list of server encryption protectors. - - :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 - :return: An iterator like instance of either EncryptionProtector or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.EncryptionProtector] - :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", self._config.api_version)) - cls: ClsType[_models.EncryptionProtectorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EncryptionProtectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> _models.EncryptionProtector: - """Gets a server encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be retrieved. - "current" Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :return: EncryptionProtector or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.EncryptionProtector - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("EncryptionProtector", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.EncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "EncryptionProtector") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: _models.EncryptionProtector, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Required. - :type parameters: ~azure.mgmt.sql.models.EncryptionProtector - :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 EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. 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 EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.EncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.EncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Is either a - EncryptionProtector type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.EncryptionProtector or IO[bytes] - :return: An instance of LROPoller that returns either EncryptionProtector or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.EncryptionProtector] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.EncryptionProtector] = 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, - encryption_protector_name=encryption_protector_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("EncryptionProtector", pipeline_response.http_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.EncryptionProtector].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.EncryptionProtector]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _revalidate_initial( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revalidate( - self, - resource_group_name: str, - server_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> LROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - server_name=server_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index f23963a383bb..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_endpoint_certificates_operations.py +++ /dev/null @@ -1,273 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, endpoint_type: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "endpointType": _SERIALIZER.url("endpoint_type", endpoint_type, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class EndpointCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`endpoint_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.EndpointCertificate"]: - """List certificates used on endpoints on the target instance. - - :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 iterator like instance of either EndpointCertificate or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.EndpointCertificate] - :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", self._config.api_version)) - cls: ClsType[_models.EndpointCertificateListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("EndpointCertificateListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, endpoint_type: str, **kwargs: Any - ) -> _models.EndpointCertificate: - """Gets a certificate used on the endpoint with the given id. - - :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 endpoint_type: Type of the endpoint whose certificate the customer is looking for. - Required. - :type endpoint_type: str - :return: EndpointCertificate or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.EndpointCertificate - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - endpoint_type=endpoint_type, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("EndpointCertificate", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 2788a059673a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py +++ /dev/null @@ -1,465 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}", - ) - 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"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/extendedAuditingSettings/{blobAuditingPolicyName}", - ) - 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"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ExtendedDatabaseBlobAuditingPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`extended_database_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ExtendedDatabaseBlobAuditingPolicy"]: - """Lists extended auditing settings of a database. - - :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 - :return: An iterator like instance of either ExtendedDatabaseBlobAuditingPolicy or the result - of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ExtendedDatabaseBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Gets an extended database's blob auditing policy. - - :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 - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.ExtendedDatabaseBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. 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: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.ExtendedDatabaseBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.ExtendedDatabaseBlobAuditingPolicy: - """Creates or updates an extended database's blob auditing policy. - - :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 parameters: The extended database blob auditing policy. Is either a - ExtendedDatabaseBlobAuditingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy or IO[bytes] - :return: ExtendedDatabaseBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = 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, "ExtendedDatabaseBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ExtendedDatabaseBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index f5d118f733a0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py +++ /dev/null @@ -1,516 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/extendedAuditingSettings/{blobAuditingPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ExtendedServerBlobAuditingPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`extended_server_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ExtendedServerBlobAuditingPolicy"]: - """Lists extended auditing settings of a server. - - :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 - :return: An iterator like instance of either ExtendedServerBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ExtendedServerBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> _models.ExtendedServerBlobAuditingPolicy: - """Gets an extended server's blob auditing policy. - - :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 - :return: ExtendedServerBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ExtendedServerBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ExtendedServerBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy - :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 ExtendedServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. 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 ExtendedServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ExtendedServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ExtendedServerBlobAuditingPolicy]: - """Creates or updates an extended server's blob auditing policy. - - :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 parameters: Properties of extended blob auditing policy. Is either a - ExtendedServerBlobAuditingPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ExtendedServerBlobAuditingPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = 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, - parameters=parameters, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ExtendedServerBlobAuditingPolicy", pipeline_response.http_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.ExtendedServerBlobAuditingPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ExtendedServerBlobAuditingPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 3cc96eec78d9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py +++ /dev/null @@ -1,1386 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - 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}/failoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - 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}/failoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_failover_request( - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_force_failover_allow_data_loss_request( # pylint: disable=name-too-long - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_try_planned_before_forced_failover_request( # pylint: disable=name-too-long - resource_group_name: str, server_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class FailoverGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`failover_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.FailoverGroup"]: - """Lists the failover groups in a server. - - :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 containing the failover group. Required. - :type server_name: str - :return: An iterator like instance of either FailoverGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.FailoverGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> _models.FailoverGroup: - """Gets a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: FailoverGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FailoverGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("FailoverGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "FailoverGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: _models.FailoverGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroup - :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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Creates or updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a FailoverGroup type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroup or IO[bytes] - :return: An instance of LROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "FailoverGroupUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: _models.FailoverGroupUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate - :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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - failover_group_name: str, - parameters: Union[_models.FailoverGroupUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Updates a failover 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 server_name: The name of the server containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a FailoverGroupUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate or IO[bytes] - :return: An instance of LROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _failover_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. - - :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 containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of LROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - 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, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _force_failover_allow_data_loss_initial( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_force_failover_allow_data_loss_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_force_failover_allow_data_loss( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. This operation might result in data - loss. - - :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 containing the failover group. Required. - :type server_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of LROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._force_failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - 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 - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_try_planned_before_forced_failover_request( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_try_planned_before_forced_failover( - self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[_models.FailoverGroup]: - """Fails over from the current primary server to this server. This operation tries planned before - forced failover but might still result in data loss. - - :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 failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of LROPoller that returns either FailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] - :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", self._config.api_version)) - 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) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._try_planned_before_forced_failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("FailoverGroup", pipeline_response.http_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.FailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.FailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 11b4ac5add4b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py +++ /dev/null @@ -1,713 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_replace_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/firewallRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - 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}/firewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class FirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.FirewallRule"]: - """Gets a list of firewall rules. - - :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 - :return: An iterator like instance of either FirewallRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def replace( - self, - resource_group_name: str, - server_name: str, - parameters: _models.FirewallRuleList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def replace( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 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: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def replace( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.FirewallRuleList, IO[bytes]], - **kwargs: Any - ) -> Optional[_models.FirewallRule]: - """Replaces all firewall rules on the server. - - :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 parameters: Is either a FirewallRuleList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or IO[bytes] - :return: FirewallRule or None or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule or None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Optional[_models.FirewallRule]] = 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, "FirewallRuleList") - - _request = build_replace_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.FirewallRule: - """Gets a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: _models.FirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: Union[_models.FirewallRule, IO[bytes]], - **kwargs: Any - ) -> _models.FirewallRule: - """Creates or updates a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating a firewall rule. Is either - a FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.FirewallRule or IO[bytes] - :return: FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.FirewallRule] = 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, "FirewallRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> None: - """Deletes a firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index d370400621f4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}", - ) - 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"), - "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - 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", "2025-01-01")) - 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}/geoBackupPolicies/{geoBackupPolicyName}", - ) - 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"), - "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class GeoBackupPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`geo_backup_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.GeoBackupPolicy"]: - """Gets a list of Geo backup policies for the given database resource. - - :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 - :return: An iterator like instance of either GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.GeoBackupPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GeoBackupPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Gets a Geo backup policy for the given database resource. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: _models.GeoBackupPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. - Required. - :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. - 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: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], - parameters: Union[_models.GeoBackupPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.GeoBackupPolicy: - """Create or update a database default Geo backup policy. - - :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 geo_backup_policy_name: The name of the Geo backup policy. This should always be - 'Default'. "Default" Required. - :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName - :param parameters: The required parameters for creating or updating the geo backup policy. Is - either a GeoBackupPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy or IO[bytes] - :return: GeoBackupPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GeoBackupPolicy] = 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, "GeoBackupPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - geo_backup_policy_name=geo_backup_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("GeoBackupPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index febf8006584e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py +++ /dev/null @@ -1,983 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - resource_group_name: str, location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, location_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, location_name: str, failover_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", "2025-01-01")) - 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, location_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_failover_request( - resource_group_name: str, location_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_force_failover_allow_data_loss_request( # pylint: disable=name-too-long - resource_group_name: str, location_name: str, failover_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class InstanceFailoverGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`instance_failover_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> ItemPaged["_models.InstanceFailoverGroup"]: - """Lists the failover groups in a location. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> _models.InstanceFailoverGroup: - """Gets a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: InstanceFailoverGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstanceFailoverGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstanceFailoverGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: _models.InstanceFailoverGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup - :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 InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group 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 InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - failover_group_name: str, - parameters: Union[_models.InstanceFailoverGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InstanceFailoverGroup]: - """Creates or updates a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :param parameters: The failover group parameters. Is either a InstanceFailoverGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup or IO[bytes] - :return: An instance of LROPoller that returns either InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstanceFailoverGroup] = 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, - location_name=location_name, - failover_group_name=failover_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InstanceFailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a failover 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _failover_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[_models.InstanceFailoverGroup]: - """Fails over from the current primary managed instance to this managed instance. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of LROPoller that returns either InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = 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, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InstanceFailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _force_failover_allow_data_loss_initial( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_force_failover_allow_data_loss_request( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_force_failover_allow_data_loss( - self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any - ) -> LROPoller[_models.InstanceFailoverGroup]: - """Fails over from the current primary managed instance to this managed instance. This operation - might result in data loss. - - :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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param failover_group_name: The name of the failover group. Required. - :type failover_group_name: str - :return: An instance of LROPoller that returns either InstanceFailoverGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - :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", self._config.api_version)) - cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstanceFailoverGroup", pipeline_response.http_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.InstanceFailoverGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InstanceFailoverGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py deleted file mode 100644 index 7994e3f2311e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pool_operations_operations.py +++ /dev/null @@ -1,287 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_pool_request( - resource_group_name: str, instance_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url( - "instance_pool_name", - instance_pool_name, - "str", - max_length=127, - min_length=1, - pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$", - ), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, instance_pool_name: str, operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations/{operationId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url( - "instance_pool_name", - instance_pool_name, - "str", - max_length=127, - min_length=1, - pattern=r"^[a-z0-9]+(-*[a-z0-9]+)*$", - ), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class InstancePoolOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`instance_pool_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, **kwargs: Any - ) -> ItemPaged["_models.InstancePoolOperation"]: - """Gets a list of operations performed on the instance pool. - - :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 instance_pool_name: The name of the managed instance pool. Required. - :type instance_pool_name: str - :return: An iterator like instance of either InstancePoolOperation or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any - ) -> _models.InstancePoolOperation: - """Gets a management operation on a instance pool. - - :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 instance_pool_name: The name of the managed instance pool. Required. - :type instance_pool_name: str - :param operation_id: Required. - :type operation_id: str - :return: InstancePoolOperation or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstancePoolOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstancePoolOperation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index a7d9e10d12f0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py +++ /dev/null @@ -1,973 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools") - path_format_arguments = { - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, instance_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, instance_pool_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", "2025-01-01")) - 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/instancePools/{instancePoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, instance_pool_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, instance_pool_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", "2025-01-01")) - 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/instancePools/{instancePoolName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class InstancePoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`instance_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.InstancePool"]: - """Gets a list of all instance pools in the subscription. - - :return: An iterator like instance of either InstancePool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.InstancePool"]: - """Gets a list of instance pools in the resource 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 - :return: An iterator like instance of either InstancePool or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - cls: ClsType[_models.InstancePoolListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("InstancePoolListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> _models.InstancePool: - """Gets an instance pool. - - :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 instance_pool_name: The name of the instance pool to be retrieved. Required. - :type instance_pool_name: str - :return: InstancePool or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.InstancePool - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("InstancePool", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePool, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstancePool") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: _models.InstancePool, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePool - :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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. 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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePool, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Creates or updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be created or updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Is either a InstancePool type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePool or IO[bytes] - :return: An instance of LROPoller that returns either InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstancePool] = 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, - instance_pool_name=instance_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstancePool", pipeline_response.http_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.InstancePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InstancePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an instance pool. - - :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 instance_pool_name: The name of the instance pool to be deleted. Required. - :type instance_pool_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePoolUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "InstancePoolUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: _models.InstancePoolUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate - :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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. 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 InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - instance_pool_name: str, - parameters: Union[_models.InstancePoolUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.InstancePool]: - """Updates an instance pool. - - :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 instance_pool_name: The name of the instance pool to be updated. Required. - :type instance_pool_name: str - :param parameters: The requested instance pool resource state. Is either a InstancePoolUpdate - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate or IO[bytes] - :return: An instance of LROPoller that returns either InstancePool or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.InstancePool] = 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, - instance_pool_name=instance_pool_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("InstancePool", pipeline_response.http_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.InstancePool].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.InstancePool]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index c4bc37bfa1d5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ipv6_firewall_rules_operations.py +++ /dev/null @@ -1,546 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - 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}/ipv6FirewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, firewall_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class IPv6FirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`ipv6_firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.IPv6FirewallRule"]: - """Gets a list of IPv6 firewall rules. - - :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 - :return: An iterator like instance of either IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.IPv6FirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.IPv6FirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("IPv6FirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Gets an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: _models.IPv6FirewallRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. - Required. - :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. - 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: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - firewall_rule_name: str, - parameters: Union[_models.IPv6FirewallRule, IO[bytes]], - **kwargs: Any - ) -> _models.IPv6FirewallRule: - """Creates or updates an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :param parameters: The required parameters for creating or updating an IPv6 firewall rule. Is - either a IPv6FirewallRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule or IO[bytes] - :return: IPv6FirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.IPv6FirewallRule] = 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, "IPv6FirewallRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("IPv6FirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any - ) -> None: - """Deletes an IPv6 firewall rule. - - :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 firewall_rule_name: The name of the firewall rule. Required. - :type firewall_rule_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - firewall_rule_name=firewall_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 3136ae5e7bac..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py +++ /dev/null @@ -1,912 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobAgentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_agents` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobAgent"]: - """Gets a list of job agents in a server. - - :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 - :return: An iterator like instance of either JobAgent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - cls: ClsType[_models.JobAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any) -> _models.JobAgent: - """Gets a job agent. - - :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 job_agent_name: The name of the job agent to be retrieved. Required. - :type job_agent_name: str - :return: JobAgent or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobAgent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobAgent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobAgent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: _models.JobAgent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgent - :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 JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. 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 JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Creates or updates a job agent. - - :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 job_agent_name: The name of the job agent to be created or updated. Required. - :type job_agent_name: str - :param parameters: The requested job agent resource state. Is either a JobAgent type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgent or IO[bytes] - :return: An instance of LROPoller that returns either JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobAgent] = 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, - job_agent_name=job_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobAgent", pipeline_response.http_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.JobAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobAgent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a job agent. - - :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 job_agent_name: The name of the job agent to be deleted. Required. - :type job_agent_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgentUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobAgentUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: _models.JobAgentUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate - :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 JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. 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 JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - parameters: Union[_models.JobAgentUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JobAgent]: - """Updates a job agent. - - :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 job_agent_name: The name of the job agent to be updated. Required. - :type job_agent_name: str - :param parameters: The update to the job agent. Is either a JobAgentUpdate type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate or IO[bytes] - :return: An instance of LROPoller that returns either JobAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobAgent] = 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, - job_agent_name=job_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobAgent", pipeline_response.http_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.JobAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobAgent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 700e8075af07..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py +++ /dev/null @@ -1,582 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_agent_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "credentialName": _SERIALIZER.url("credential_name", credential_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}/credentials/{credentialName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "credentialName": _SERIALIZER.url("credential_name", credential_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "credentialName": _SERIALIZER.url("credential_name", credential_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobCredentialsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_credentials` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobCredential"]: - """Gets a list of jobs credentials. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobCredential or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobCredential] - :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", self._config.api_version)) - cls: ClsType[_models.JobCredentialListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobCredentialListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any - ) -> _models.JobCredential: - """Gets a jobs credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: _models.JobCredential, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. Required. - :type parameters: ~azure.mgmt.sql.models.JobCredential - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. 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: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - credential_name: str, - parameters: Union[_models.JobCredential, IO[bytes]], - **kwargs: Any - ) -> _models.JobCredential: - """Creates or updates a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :param parameters: The requested job credential state. Is either a JobCredential type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobCredential or IO[bytes] - :return: JobCredential or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobCredential - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobCredential] = 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, "JobCredential") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("JobCredential", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any - ) -> None: - """Deletes a job credential. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param credential_name: The name of the credential. Required. - :type credential_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - credential_name=credential_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index f6a8ce9750bd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py +++ /dev/null @@ -1,1008 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_agent_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_job_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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) - - -class JobExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists all executions in a job agent. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_job( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists a job's executions. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> LROPoller[_models.JobExecution]: - """Creates or updates a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The job execution id to create the job execution under. Required. - :type job_execution_id: str - :return: An instance of LROPoller that returns either JobExecution or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecution] = 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, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobExecution", pipeline_response.http_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.JobExecution].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobExecution]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - **kwargs: Any - ) -> None: - """Requests cancellation of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_execution_id: The id of the job execution to cancel. Required. - :type job_execution_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - def _create_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> LROPoller[_models.JobExecution]: - """Starts an elastic job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An instance of LROPoller that returns either JobExecution or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecution] = 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_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobExecution", pipeline_response.http_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.JobExecution].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobExecution]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 549bb1b58ea1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_private_endpoints_operations.py +++ /dev/null @@ -1,718 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_agent_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobPrivateEndpointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_private_endpoints` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobPrivateEndpoint"]: - """Gets a list of job agent private endpoints. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobPrivateEndpoint or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobPrivateEndpoint] - :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", self._config.api_version)) - cls: ClsType[_models.JobPrivateEndpointListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobPrivateEndpointListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> _models.JobPrivateEndpoint: - """Gets a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint to get. Required. - :type private_endpoint_name: str - :return: JobPrivateEndpoint or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobPrivateEndpoint", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "JobPrivateEndpoint") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: _models.JobPrivateEndpoint, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. Required. - :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint - :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 JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. 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 JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - private_endpoint_name: str, - parameters: Union[_models.JobPrivateEndpoint, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.JobPrivateEndpoint]: - """Creates or updates a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint. Required. - :type private_endpoint_name: str - :param parameters: The requested private endpoint state. Is either a JobPrivateEndpoint type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint or IO[bytes] - :return: An instance of LROPoller that returns either JobPrivateEndpoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobPrivateEndpoint] = 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, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("JobPrivateEndpoint", pipeline_response.http_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.JobPrivateEndpoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.JobPrivateEndpoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param private_endpoint_name: The name of the private endpoint to delete. Required. - :type private_endpoint_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - private_endpoint_name=private_endpoint_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 1312e4564dc0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py +++ /dev/null @@ -1,378 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_job_execution_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "stepName": _SERIALIZER.url("step_name", step_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobStepExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_step_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job_execution( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists the step executions of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_execution_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a step execution of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 61a0c1c5aad9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py +++ /dev/null @@ -1,884 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_job_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "stepName": _SERIALIZER.url("step_name", step_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "stepName": _SERIALIZER.url("step_name", step_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "stepName": _SERIALIZER.url("step_name", step_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_version_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_by_version_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - step_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), - "stepName": _SERIALIZER.url("step_name", step_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobStepsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_steps` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobStep"]: - """Gets all job steps for a job's current version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] - :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", self._config.api_version)) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets a job step in a job's current version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: _models.JobStep, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. Required. - :type parameters: ~azure.mgmt.sql.models.JobStep - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. 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: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - parameters: Union[_models.JobStep, IO[bytes]], - **kwargs: Any - ) -> _models.JobStep: - """Creates or updates a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step. Required. - :type step_name: str - :param parameters: The requested state of the job step. Is either a JobStep type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.JobStep or IO[bytes] - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobStep] = 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, "JobStep") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - step_name: str, - **kwargs: Any - ) -> None: - """Deletes a job step. This will implicitly create a new job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param step_name: The name of the job step to delete. Required. - :type step_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> ItemPaged["_models.JobStep"]: - """Gets all job steps in the specified job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: An iterator like instance of either JobStep or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] - :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", self._config.api_version)) - cls: ClsType[_models.JobStepListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobStepListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_by_version( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - step_name: str, - **kwargs: Any - ) -> _models.JobStep: - """Gets the specified version of a job step. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :param step_name: The name of the job step. Required. - :type step_name: str - :return: JobStep or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobStep - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) - - _request = build_get_by_version_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - step_name=step_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobStep", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index d9550cb588e2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py +++ /dev/null @@ -1,587 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -import datetime -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_step_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "stepName": _SERIALIZER.url("step_name", step_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - target_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "stepName": _SERIALIZER.url("step_name", step_name, "str"), - "targetId": _SERIALIZER.url("target_id", target_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_job_execution_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - subscription_id: str, - *, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if create_time_min is not None: - _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") - if create_time_max is not None: - _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") - if end_time_min is not None: - _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") - if end_time_max is not None: - _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") - if is_active is not None: - _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobTargetExecutionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_target_executions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_step( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists the target executions of a job step execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_step_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - step_name: str, - target_id: str, - **kwargs: Any - ) -> _models.JobExecution: - """Gets a target execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The unique id of the job execution. Required. - :type job_execution_id: str - :param step_name: The name of the step. Required. - :type step_name: str - :param target_id: The target id. Required. - :type target_id: str - :return: JobExecution or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobExecution - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - step_name=step_name, - target_id=target_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobExecution", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_job_execution( # pylint: disable=too-many-locals - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_execution_id: str, - create_time_min: Optional[datetime.datetime] = None, - create_time_max: Optional[datetime.datetime] = None, - end_time_min: Optional[datetime.datetime] = None, - end_time_max: Optional[datetime.datetime] = None, - is_active: Optional[bool] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - **kwargs: Any - ) -> ItemPaged["_models.JobExecution"]: - """Lists target executions for all steps of a job execution. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param job_execution_id: The id of the job execution. Required. - :type job_execution_id: str - :param create_time_min: If specified, only job executions created at or after the specified - time are included. Default value is None. - :type create_time_min: ~datetime.datetime - :param create_time_max: If specified, only job executions created before the specified time are - included. Default value is None. - :type create_time_max: ~datetime.datetime - :param end_time_min: If specified, only job executions completed at or after the specified time - are included. Default value is None. - :type end_time_min: ~datetime.datetime - :param end_time_max: If specified, only job executions completed before the specified time are - included. Default value is None. - :type end_time_max: ~datetime.datetime - :param is_active: If specified, only active or only completed job executions are included. - Default value is None. - :type is_active: bool - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :return: An iterator like instance of either JobExecution or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] - :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", self._config.api_version)) - cls: ClsType[_models.JobExecutionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_execution_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_execution_id=job_execution_id, - subscription_id=self._config.subscription_id, - create_time_min=create_time_min, - create_time_max=create_time_max, - end_time_min=end_time_min, - end_time_max=end_time_max, - is_active=is_active, - skip=skip, - top=top, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobExecutionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 840ac68fbc11..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py +++ /dev/null @@ -1,582 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_agent_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "targetGroupName": _SERIALIZER.url("target_group_name", target_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "targetGroupName": _SERIALIZER.url("target_group_name", target_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "targetGroupName": _SERIALIZER.url("target_group_name", target_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobTargetGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_target_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobTargetGroup"]: - """Gets all target groups in an agent. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either JobTargetGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobTargetGroup] - :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", self._config.api_version)) - cls: ClsType[_models.JobTargetGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobTargetGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any - ) -> _models.JobTargetGroup: - """Gets a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobTargetGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: _models.JobTargetGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. Required. - :type parameters: ~azure.mgmt.sql.models.JobTargetGroup - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. 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: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - target_group_name: str, - parameters: Union[_models.JobTargetGroup, IO[bytes]], - **kwargs: Any - ) -> _models.JobTargetGroup: - """Creates or updates a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :param parameters: The requested state of the target group. Is either a JobTargetGroup type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.JobTargetGroup or IO[bytes] - :return: JobTargetGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobTargetGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.JobTargetGroup] = 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, "JobTargetGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_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.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, 201]: - 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 = self._deserialize("JobTargetGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any - ) -> None: - """Deletes a target 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 server_name: The name of the server. Required. - :type server_name: str - :param job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param target_group_name: The name of the target group. Required. - :type target_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - target_group_name=target_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index d5fa4bc0951d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py +++ /dev/null @@ -1,300 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_job_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobVersionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`job_versions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_job( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> ItemPaged["_models.JobVersion"]: - """Gets all versions of a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: An iterator like instance of either JobVersion or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobVersion] - :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", self._config.api_version)) - cls: ClsType[_models.JobVersionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_job_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobVersionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - job_version: int, - **kwargs: Any - ) -> _models.JobVersion: - """Gets a job version. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job. Required. - :type job_name: str - :param job_version: The version of the job to get. Required. - :type job_version: int - :return: JobVersion or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.JobVersion - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - job_version=job_version, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("JobVersion", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 9efd8cf6642e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py +++ /dev/null @@ -1,566 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_agent_request( - resource_group_name: str, server_name: str, job_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - 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}/jobAgents/{jobAgentName}/jobs/{jobName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), - "jobName": _SERIALIZER.url("job_name", job_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class JobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_agent( - self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any - ) -> ItemPaged["_models.Job"]: - """Gets a list of jobs. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :return: An iterator like instance of either Job or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Job] - :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", self._config.api_version)) - cls: ClsType[_models.JobListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_agent_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("JobListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> _models.Job: - """Gets a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Job] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: _models.Job, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. Required. - :type parameters: ~azure.mgmt.sql.models.Job - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. 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: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - job_agent_name: str, - job_name: str, - parameters: Union[_models.Job, IO[bytes]], - **kwargs: Any - ) -> _models.Job: - """Creates or updates a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to get. Required. - :type job_name: str - :param parameters: The requested job state. Is either a Job type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Job or IO[bytes] - :return: Job or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Job - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Job] = 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, "Job") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("Job", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any - ) -> None: - """Deletes a job. - - :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 job_agent_name: The name of the job agent. Required. - :type job_agent_name: str - :param job_name: The name of the job to delete. Required. - :type job_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - job_agent_name=job_agent_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 4acfa65f236d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py +++ /dev/null @@ -1,737 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}", - ) - 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"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - 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", "2025-01-01")) - 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}/ledgerDigestUploads/{ledgerDigestUploads}", - ) - 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"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_disable_request( - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable", - ) - 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"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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) - - -class LedgerDigestUploadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`ledger_digest_uploads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.LedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 - :return: An iterator like instance of either LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> _models.LedgerDigestUploads: - """Gets the current ledger digest upload configuration for a database. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :return: LedgerDigestUploads or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LedgerDigestUploads", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: Union[_models.LedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LedgerDigestUploads") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: _models.LedgerDigestUploads, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :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 LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :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 LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - parameters: Union[_models.LedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: Is either a LedgerDigestUploads type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads or IO[bytes] - :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LedgerDigestUploads] = 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, - ledger_digest_uploads=ledger_digest_uploads, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_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.LedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _disable_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_disable_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_disable( - self, - resource_group_name: str, - server_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], - **kwargs: Any - ) -> LROPoller[_models.LedgerDigestUploads]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LedgerDigestUploads", pipeline_response.http_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.LedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 1a841ba430c1..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py +++ /dev/null @@ -1,4649 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - location_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_server_request( - location_name: str, - long_term_retention_server_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_database_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_change_access_tier_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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) - - -def build_copy_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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) - - -def build_lock_time_based_immutability_request( # pylint: disable=name-too-long - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/lockTimeBasedImmutability", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_remove_legal_hold_immutability_request( # pylint: disable=name-too-long - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeLegalHoldImmutability", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_remove_time_based_immutability_request( # pylint: disable=name-too-long - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeTimeBasedImmutability", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_set_legal_hold_immutability_request( # pylint: disable=name-too-long - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/setLegalHoldImmutability", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_update_request( - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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) - - -def build_list_by_resource_group_location_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_server_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_database_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_by_resource_group_request( - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_by_resource_group_request( - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_change_access_tier_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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) - - -def build_copy_by_resource_group_request( - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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) - - -def build_lock_time_based_immutability_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/lockTimeBasedImmutability", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_remove_legal_hold_immutability_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeLegalHoldImmutability", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_remove_time_based_immutability_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeTimeBasedImmutability", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_set_legal_hold_immutability_by_resource_group_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/setLegalHoldImmutability", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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_update_by_resource_group_request( - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_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", "2025-01-01")) - 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/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "longTermRetentionServerName": _SERIALIZER.url( - "long_term_retention_server_name", long_term_retention_server_name, "str" - ), - "longTermRetentionDatabaseName": _SERIALIZER.url( - "long_term_retention_database_name", long_term_retention_database_name, "str" - ), - "backupName": _SERIALIZER.url("backup_name", backup_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 LongTermRetentionBackupsOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`long_term_retention_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given location. - - :param location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_server( - self, - location_name: str, - long_term_retention_server_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given server. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists all long term retention backups for a database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.LongTermRetentionBackup: - """Gets a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: LongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _change_access_tier_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ChangeLongTermRetentionBackupAccessTierParameters") - - _request = build_change_access_tier_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters - :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 LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: 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 LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_change_access_tier( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Is either a ChangeLongTermRetentionBackupAccessTierParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or - IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _copy_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") - - _request = build_copy_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.CopyLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters - :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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_copy( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Is either a - CopyLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _lock_time_based_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_lock_time_based_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_lock_time_based_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Lock time based immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _remove_legal_hold_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_legal_hold_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_remove_legal_hold_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Remove legal hold immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _remove_time_based_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_time_based_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_remove_time_based_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Remove time based immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _set_legal_hold_immutability_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_set_legal_hold_immutability_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_set_legal_hold_immutability( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Set legal hold immutability of an existing long term retention backup. - - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_initial( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") - - _request = build_update_request( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.UpdateLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters - :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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Is either a - UpdateLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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( - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given location based on resource 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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_server( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists the long term retention backups for a given server based on resource groups. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_server_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionBackup"]: - """Lists all long term retention backups for a database based on a particular resource 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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.LongTermRetentionBackup: - """Gets a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: LongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ChangeLongTermRetentionBackupAccessTierParameters") - - _request = build_change_access_tier_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters - :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 LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: 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 LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Change a long term retention backup access tier. - - :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 location_name: Required. - :type location_name: str - :param long_term_retention_server_name: Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: Required. - :type long_term_retention_database_name: str - :param backup_name: Required. - :type backup_name: str - :param parameters: Is either a ChangeLongTermRetentionBackupAccessTierParameters type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or - IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _copy_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CopyLongTermRetentionBackupParameters") - - _request = build_copy_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.CopyLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters - :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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_copy_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.CopyLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Copy an existing long term retention backup to a different server. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The parameters needed for long term retention copy request. Is either a - CopyLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_lock_time_based_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_lock_time_based_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Lock time based immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_legal_hold_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_remove_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Remove legal hold immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _remove_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_remove_time_based_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_remove_time_based_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Remove time based immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _set_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_set_legal_hold_immutability_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_set_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackup]: - """Set legal hold immutability of an existing long term retention backup. - - :param resource_group_name: The resource group name of the database. Required. - :type resource_group_name: str - :param location_name: Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: An instance of LROPoller that returns either LongTermRetentionBackup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackup", pipeline_response.http_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.LongTermRetentionBackup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "UpdateLongTermRetentionBackupParameters") - - _request = build_update_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: _models.UpdateLongTermRetentionBackupParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters - :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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_by_resource_group( - self, - resource_group_name: str, - location_name: str, - long_term_retention_server_name: str, - long_term_retention_database_name: str, - backup_name: str, - parameters: Union[_models.UpdateLongTermRetentionBackupParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: - """Updates an existing long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param long_term_retention_server_name: The name of the server. Required. - :type long_term_retention_server_name: str - :param long_term_retention_database_name: The name of the database. Required. - :type long_term_retention_database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :param parameters: The requested backup resource state. Is either a - UpdateLongTermRetentionBackupParameters type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionBackupOperationResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - long_term_retention_server_name=long_term_retention_server_name, - long_term_retention_database_name=long_term_retention_database_name, - backup_name=backup_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionBackupOperationResult", pipeline_response.http_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.LongTermRetentionBackupOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionBackupOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index b43ca4ab5192..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py +++ /dev/null @@ -1,1546 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - location_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_database_request( - location_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - location_name: str, - managed_instance_name: str, - database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - location_name: str, - managed_instance_name: str, - database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_instance_request( - location_name: str, - managed_instance_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_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 - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_location_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_database_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_by_resource_group_request( - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_by_resource_group_request( - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "backupName": _SERIALIZER.url("backup_name", backup_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_instance_request( # pylint: disable=name-too-long - resource_group_name: str, - location_name: str, - managed_instance_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_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 - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if database_state is not None: - _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class LongTermRetentionManagedInstanceBackupsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`long_term_retention_managed_instance_backups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :param location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - skip=skip, - top=top, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionBackup: - """Gets a long term retention backup for a managed database. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: ManagedInstanceLongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_initial( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a long term retention backup. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, - location_name: str, - managed_instance_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. - - :param location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_request( - location_name=location_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for managed databases in a given location. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - skip=skip, - top=top, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group_database( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists all long term retention backups for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_database_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_by_resource_group( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionBackup: - """Gets a long term retention backup for a managed database. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :return: ManagedInstanceLongTermRetentionBackup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) - - _request = build_get_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionBackup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _delete_by_resource_group_initial( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_by_resource_group_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_by_resource_group( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - database_name: str, - backup_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a long term retention backup. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param database_name: The name of the managed database. Required. - :type database_name: str - :param backup_name: The backup name. Required. - :type backup_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_by_resource_group_initial( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - backup_name=backup_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_resource_group_instance( - self, - resource_group_name: str, - location_name: str, - managed_instance_name: str, - only_latest_per_database: Optional[bool] = None, - database_state: Optional[Union[str, _models.DatabaseState]] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: - """Lists the long term retention backups for a given managed instance. - - :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 location_name: The location of the database. Required. - :type location_name: str - :param managed_instance_name: The name of the managed instance. Required. - :type managed_instance_name: str - :param only_latest_per_database: Whether or not to only get the latest backup for each - database. Default value is None. - :type only_latest_per_database: bool - :param database_state: Whether to query against just live databases, just deleted databases, or - all databases. Known values are: "All", "Live", and "Deleted". Default value is None. - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState - :return: An iterator like instance of either ManagedInstanceLongTermRetentionBackup or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionBackupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_instance_request( - resource_group_name=resource_group_name, - location_name=location_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - database_state=database_state, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionBackupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 63a543dcca93..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py +++ /dev/null @@ -1,561 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", - ) - 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"), - "policyName": _SERIALIZER.url("policy_name", policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/backupLongTermRetentionPolicies/{policyName}", - ) - 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"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class LongTermRetentionPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`long_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.LongTermRetentionPolicy"]: - """Gets a database's long term retention policy. - - :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 - :return: An iterator like instance of either LongTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - **kwargs: Any - ) -> _models.LongTermRetentionPolicy: - """Gets a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :return: LongTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LongTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: _models.LongTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy - :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 LongTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. 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 LongTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - policy_name: Union[str, _models.LongTermRetentionPolicyName], - parameters: Union[_models.LongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LongTermRetentionPolicy]: - """Set or update a database's long term retention policy. - - :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 policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName - :param parameters: The long term retention policy info. Is either a LongTermRetentionPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either LongTermRetentionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LongTermRetentionPolicy] = 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, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("LongTermRetentionPolicy", pipeline_response.http_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.LongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LongTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 68d7b8d3dc72..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py +++ /dev/null @@ -1,170 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - maintenance_window_options_name: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["maintenanceWindowOptionsName"] = _SERIALIZER.query( - "maintenance_window_options_name", maintenance_window_options_name, "str" - ) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class MaintenanceWindowOptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`maintenance_window_options` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_options_name: str, - **kwargs: Any - ) -> _models.MaintenanceWindowOptions: - """Gets a list of available maintenance windows. - - :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 to get maintenance windows options for. - Required. - :type database_name: str - :param maintenance_window_options_name: Maintenance window options name. Required. - :type maintenance_window_options_name: str - :return: MaintenanceWindowOptions or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_options_name=maintenance_window_options_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("MaintenanceWindowOptions", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b0f57e6b382d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py +++ /dev/null @@ -1,348 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - maintenance_window_name: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - maintenance_window_name: 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", "2025-01-01")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") - _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") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class MaintenanceWindowsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`maintenance_windows` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - **kwargs: Any - ) -> _models.MaintenanceWindows: - """Gets maintenance windows settings for a database. - - :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 to get maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :return: MaintenanceWindows or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.MaintenanceWindows - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_name=maintenance_window_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MaintenanceWindows", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: _models.MaintenanceWindows, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - maintenance_window_name: str, - parameters: Union[_models.MaintenanceWindows, IO[bytes]], - **kwargs: Any - ) -> None: - """Sets maintenance windows settings for a database. - - :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 to set maintenance windows for. Required. - :type database_name: str - :param maintenance_window_name: Maintenance window name. Required. - :type maintenance_window_name: str - :param parameters: Is either a MaintenanceWindows type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "MaintenanceWindows") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - maintenance_window_name=maintenance_window_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index ef80707c5410..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,833 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a managed database's short term retention policy list. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedBackupShortTermRetentionPolicy: - """Gets a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :return: ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Updates a managed database's short term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 15c2e82d7238..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,500 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabaseAdvancedThreatProtection"]: - """Gets a list of managed database's Advanced Threat Protection states. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseAdvancedThreatProtection or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Gets a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ManagedDatabaseAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. 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: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedDatabaseAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedDatabaseAdvancedThreatProtection: - """Creates or updates a managed database's Advanced Threat Protection state. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed database Advanced Threat Protection state. Is either a - ManagedDatabaseAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection or IO[bytes] - :return: ManagedDatabaseAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = 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, "ManagedDatabaseAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedDatabaseAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index f0a7f58e1f1c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py +++ /dev/null @@ -1,498 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if schema is not None: - _params["schema"] = [_SERIALIZER.query("schema", q, "str") if q is not None else "" for q in schema] - if table is not None: - _params["table"] = [_SERIALIZER.query("table", q, "str") if q is not None else "" for q in table] - if column is not None: - _params["column"] = [_SERIALIZER.query("column", q, "str") if q is not None else "" for q in column] - if order_by is not None: - _params["orderBy"] = [_SERIALIZER.query("order_by", q, "str") if q is not None else "" for q in order_by] - if skiptoken is not None: - _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_table_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseColumnsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_columns` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema: Optional[List[str]] = None, - table: Optional[List[str]] = None, - column: Optional[List[str]] = None, - order_by: Optional[List[str]] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseColumn"]: - """List managed database columns. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema: Default value is None. - :type schema: list[str] - :param table: Default value is None. - :type table: list[str] - :param column: Default value is None. - :type column: list[str] - :param order_by: Default value is None. - :type order_by: list[str] - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - schema=schema, - table=table, - column=column, - order_by=order_by, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_table( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseColumn"]: - """List managed database columns. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseColumn or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseColumnListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_table_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseColumnListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> _models.DatabaseColumn: - """Get managed database column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: DatabaseColumn or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseColumn - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseColumn", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index c0b8b404c09d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_move_operations_operations.py +++ /dev/null @@ -1,298 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - resource_group_name: str, - location_name: str, - subscription_id: str, - *, - only_latest_per_database: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if only_latest_per_database is not None: - _params["onlyLatestPerDatabase"] = _SERIALIZER.query( - "only_latest_per_database", only_latest_per_database, "bool" - ) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, location_name: str, operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseMoveOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_move_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, - resource_group_name: str, - location_name: str, - only_latest_per_database: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabaseMoveOperationResult"]: - """Lists managed database move operations. - - :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 location_name: Required. - :type location_name: str - :param only_latest_per_database: Whether or not to only get the latest operation for each - database. Has higher priority than $filter. Default value is None. - :type only_latest_per_database: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedDatabaseMoveOperationResult or the result - of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseMoveOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - only_latest_per_database=only_latest_per_database, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseMoveOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, location_name: str, operation_id: str, **kwargs: Any - ) -> _models.ManagedDatabaseMoveOperationResult: - """Gets a managed database move operation. - - :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 location_name: Required. - :type location_name: str - :param operation_id: Required. - :type operation_id: str - :return: ManagedDatabaseMoveOperationResult or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseMoveOperationResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 7bd610503eca..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py +++ /dev/null @@ -1,322 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - query_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "queryId": _SERIALIZER.url("query_id", query_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_query_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - query_id: str, - subscription_id: str, - *, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "queryId": _SERIALIZER.url("query_id", query_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if start_time is not None: - _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") - if end_time is not None: - _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") - if interval is not None: - _params["interval"] = _SERIALIZER.query("interval", interval, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseQueriesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_queries` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, **kwargs: Any - ) -> _models.ManagedInstanceQuery: - """Get query by query id. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param query_id: Required. - :type query_id: str - :return: ManagedInstanceQuery or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - query_id=query_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceQuery", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_query( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - query_id: str, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.QueryStatistics"]: - """Get query execution statistics by query id. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param query_id: Required. - :type query_id: str - :param start_time: Start time for observed period. Default value is None. - :type start_time: str - :param end_time: End time for observed period. Default value is None. - :type end_time: str - :param interval: The time step to be used to summarize the metric values. Known values are: - "PT1H" and "P1D". Default value is None. - :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :return: An iterator like instance of either QueryStatistics or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.QueryStatistics] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceQueryStatistics] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_query_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - query_id=query_id, - subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - interval=interval, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceQueryStatistics", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 22a8b17acf1f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py +++ /dev/null @@ -1,232 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_update_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/recommendedSensitivityLabels", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseRecommendedSensitivityLabelsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_recommended_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.RecommendedSensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.RecommendedSensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a RecommendedSensitivityLabelUpdateList type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "RecommendedSensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index aa141b88e9e9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py +++ /dev/null @@ -1,166 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - restore_details_name: Union[str, _models.RestoreDetailsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "restoreDetailsName": _SERIALIZER.url("restore_details_name", restore_details_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseRestoreDetailsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_restore_details` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - restore_details_name: Union[str, _models.RestoreDetailsName], - **kwargs: Any - ) -> _models.ManagedDatabaseRestoreDetailsResult: - """Gets managed database restore details. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param restore_details_name: The name of the restore details to retrieve. "Default" Required. - :type restore_details_name: str or ~azure.mgmt.sql.models.RestoreDetailsName - :return: ManagedDatabaseRestoreDetailsResult or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - restore_details_name=restore_details_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseRestoreDetailsResult", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 8cbc4c92aa0c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py +++ /dev/null @@ -1,302 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseSchemasOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_schemas` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSchema"]: - """List managed database schemas. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseSchema or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSchema] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseSchemaListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseSchemaListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, schema_name: str, **kwargs: Any - ) -> _models.DatabaseSchema: - """Get managed database schema. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :return: DatabaseSchema or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSchema - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseSchema", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index bac1ae4861bb..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseSecurityAlertPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: - """Gets a list of managed database's security alert policies. - - :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 database_name: The name of the managed database for which the security alert policies - are defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedDatabaseSecurityAlertPolicy or the result - of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Gets a managed database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: _models.ManagedDatabaseSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. 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: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], - parameters: Union[_models.ManagedDatabaseSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedDatabaseSecurityAlertPolicy: - """Creates or updates a database's security alert policy. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param security_alert_policy_name: The name of the security alert policy. "default" Required. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName - :param parameters: The database security alert policy. Is either a - ManagedDatabaseSecurityAlertPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy or IO[bytes] - :return: ManagedDatabaseSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = 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, "ManagedDatabaseSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedDatabaseSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 77639063dc53..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py +++ /dev/null @@ -1,220 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - if skip is not None: - _params["$skip"] = _SERIALIZER.query("skip", skip, "int") - if top is not None: - _params["$top"] = _SERIALIZER.query("top", top, "int") - if skiptoken is not None: - _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseSecurityEventsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_security_events` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - skip: Optional[int] = None, - top: Optional[int] = None, - skiptoken: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SecurityEvent"]: - """Gets a list of security events. - - :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 database_name: The name of the managed database for which the security events are - retrieved. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :param skip: The number of elements in the collection to skip. Default value is None. - :type skip: int - :param top: The number of elements to return from the collection. Default value is None. - :type top: int - :param skiptoken: An opaque token that identifies a starting point in the collection. Default - value is None. - :type skiptoken: str - :return: An iterator like instance of either SecurityEvent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SecurityEvent] - :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", self._config.api_version)) - cls: ClsType[_models.SecurityEventCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - skip=skip, - top=top, - skiptoken=skiptoken, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SecurityEventCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 434d1180e487..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py +++ /dev/null @@ -1,1400 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_current_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/currentSensitivityLabels", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_recommended_by_database_request( # pylint: disable=name-too-long - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if include_disabled_recommendations is not None: - _params["includeDisabledRecommendations"] = _SERIALIZER.query( - "include_disabled_recommendations", include_disabled_recommendations, "bool" - ) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_disable_recommendation_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_enable_recommendation_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_list_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseSensitivityLabelsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_recommended_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_recommended_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Gets the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param sensitivity_label_source: The source of the sensitivity label. Known values are: - "current" and "recommended". Required. - :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - sensitivity_label_source=sensitivity_label_source, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: _models.SensitivityLabel, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. 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: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: Union[_models.SensitivityLabel, IO[bytes]], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Is either a SensitivityLabel type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or IO[bytes] - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SensitivityLabel] = 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, "SensitivityLabel") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Deletes the sensitivity label of a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def disable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def enable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 01c162d45dd7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py +++ /dev/null @@ -1,319 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_schema_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseTablesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_tables` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_schema( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.DatabaseTable"]: - """List managed database tables. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either DatabaseTable or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseTable] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseTableListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_schema_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseTableListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - schema_name: str, - table_name: str, - **kwargs: Any - ) -> _models.DatabaseTable: - """Get managed database table. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :return: DatabaseTable or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseTable - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseTable", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 3016397782f0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py +++ /dev/null @@ -1,492 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "tdeName": _SERIALIZER.url("tde_name", tde_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/transparentDataEncryption/{tdeName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "tdeName": _SERIALIZER.url("tde_name", tde_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseTransparentDataEncryptionOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_transparent_data_encryption` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedTransparentDataEncryption"]: - """Gets a list of managed database's transparent data encryptions. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either ManagedTransparentDataEncryption or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Gets a managed database's transparent data encryption. - - :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 database_name: The name of the managed database for which the transparent data - encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: _models.ManagedTransparentDataEncryption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. 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: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.ManagedTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedTransparentDataEncryption: - """Updates a database's transparent data encryption configuration. - - :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 database_name: The name of the managed database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Is either a - ManagedTransparentDataEncryption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or IO[bytes] - :return: ManagedTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedTransparentDataEncryption] = 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, "ManagedTransparentDataEncryption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index ae518909c4d7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "baselineName": _SERIALIZER.url("baseline_name", baseline_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Gets a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseVulnerabilityAssessmentRuleBaseline type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or - IO[bytes] - :return: DatabaseVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseVulnerabilityAssessmentRuleBaseline") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - rule_id: str, - baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 database_name: The name of the database for which the vulnerability assessment rule - baseline is defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a - baseline on a database level rule and master for server level rule). Known values are: "master" - and "default". Required. - :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - rule_id=rule_id, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 6ff512347dd9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,620 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_export_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_initiate_scan_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either VulnerabilityAssessmentScanRecord or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :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", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.VulnerabilityAssessmentScanRecord: - """Gets a vulnerability assessment scan record of a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :return: VulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def export( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessmentScansExport: - """Convert an existing scan result to a human readable format. If already exists nothing happens. - - :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 database_name: The name of the scanned database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id. Required. - :type scan_id: str - :return: DatabaseVulnerabilityAssessmentScansExport or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) - - _request = build_export_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessmentScansExport", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _initiate_scan_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_initiate_scan_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_initiate_scan( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. - :type scan_id: str - :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", self._config.api_version)) - 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._initiate_scan_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 1e42dc014c8a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py +++ /dev/null @@ -1,610 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_database_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: - """Lists the vulnerability assessments of a managed database. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :return: An iterator like instance of either DatabaseVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DatabaseVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Gets the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.DatabaseVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.DatabaseVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseVulnerabilityAssessment: - """Creates or updates the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a DatabaseVulnerabilityAssessment type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or IO[bytes] - :return: DatabaseVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseVulnerabilityAssessment] = 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, "DatabaseVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("DatabaseVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment. - - :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 database_name: The name of the database for which the vulnerability assessment is - defined. Required. - :type database_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 798d8e69f973..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py +++ /dev/null @@ -1,2154 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_move_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/cancelMove", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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) - - -def build_complete_move_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/completeMove", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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) - - -def build_complete_restore_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/completeRestore", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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) - - -def build_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/reevaluateInaccessibleDatabaseState", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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_move_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - 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}/databases/{databaseName}/startMove", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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) - - -def build_list_inaccessible_by_instance_request( # pylint: disable=name-too-long - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabase"]: - """Gets a list of managed databases. - - :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 iterator like instance of either ManagedDatabase or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> _models.ManagedDatabase: - """Gets a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: ManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabase, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabase") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabase, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabase - :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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. 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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabase, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Creates a new database or updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Is either a ManagedDatabase type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabase or IO[bytes] - :return: An instance of LROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabase] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate - :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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. 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 ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Updates an existing database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The requested database resource state. Is either a ManagedDatabaseUpdate - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate or IO[bytes] - :return: An instance of LROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedDatabase] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _cancel_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") - - _request = build_cancel_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_cancel_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Cancels a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the cancel managed database move operation. Is either a - ManagedDatabaseMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._cancel_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _complete_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseMoveDefinition") - - _request = build_complete_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_complete_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Completes a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the complete managed database move operation. Is either a - ManagedDatabaseMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._complete_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _complete_restore_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CompleteDatabaseRestoreDefinition") - - _request = build_complete_restore_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.CompleteDatabaseRestoreDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. - Required. - :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. - 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_complete_restore( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.CompleteDatabaseRestoreDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Completes the restore operation on a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: The definition for completing the restore of this managed database. Is - either a CompleteDatabaseRestoreDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._complete_restore_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reevaluate_inaccessible_database_state_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> LROPoller[_models.ManagedDatabase]: - """Reevaluates the inaccessibility state of a managed database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An instance of LROPoller that returns either ManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedDatabase", pipeline_response.http_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.ManagedDatabase].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedDatabase]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _start_move_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedDatabaseStartMoveDefinition") - - _request = build_start_move_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: _models.ManagedDatabaseStartMoveDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_start_move( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - parameters: Union[_models.ManagedDatabaseStartMoveDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Starts a managed database move operation. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param parameters: Parameters of the start managed database move operation. Is either a - ManagedDatabaseStartMoveDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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_move_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_inaccessible_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedDatabase"]: - """Gets a list of inaccessible managed databases in a managed instance. - - :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 iterator like instance of either ManagedDatabase or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_inaccessible_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 6102e8f5cd9e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py +++ /dev/null @@ -1,698 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - 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}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceAdministratorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_administrators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceAdministrator"]: - """Gets a list of managed instance administrators. - - :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 iterator like instance of either ManagedInstanceAdministrator or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> _models.ManagedInstanceAdministrator: - """Gets a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :return: ManagedInstanceAdministrator or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAdministrator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: _models.ManagedInstanceAdministrator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator - :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 ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator 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 ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ManagedInstanceAdministrator, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdministrator]: - """Creates or updates a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested administrator parameters. Is either a - ManagedInstanceAdministrator type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceAdministrator or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAdministrator] = 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, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdministrator", pipeline_response.http_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.ManagedInstanceAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a managed instance administrator. - - :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 administrator_name: "ActiveDirectory" Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - administrator_name=administrator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 39ced5ea5550..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,553 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - 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}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceAdvancedThreatProtection"]: - """Get the managed instance's Advanced Threat Protection settings. - - :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 iterator like instance of either ManagedInstanceAdvancedThreatProtection or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ManagedInstanceAdvancedThreatProtection: - """Get a managed instance's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ManagedInstanceAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ManagedInstanceAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection - :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 ManagedInstanceAdvancedThreatProtection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. 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 ManagedInstanceAdvancedThreatProtection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: - """Creates or updates Advanced Threat Protection settings. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The managed instance Advanced Threat Protection state. Is either a - ManagedInstanceAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceAdvancedThreatProtection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = 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, - managed_instance_name=managed_instance_name, - advanced_threat_protection_name=advanced_threat_protection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAdvancedThreatProtection", pipeline_response.http_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.ManagedInstanceAdvancedThreatProtection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceAdvancedThreatProtection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index c7a40c8270fb..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ /dev/null @@ -1,715 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - 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}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_azure_ad_only_authentications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 iterator like instance of either ManagedInstanceAzureADOnlyAuthentication or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceAzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> _models.ManagedInstanceAzureADOnlyAuthentication: - """Gets a specific Azure Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :return: ManagedInstanceAzureADOnlyAuthentication or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceAzureADOnlyAuthentication") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: _models.ManagedInstanceAzureADOnlyAuthentication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication - :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 ManagedInstanceAzureADOnlyAuthentication - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. 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 ManagedInstanceAzureADOnlyAuthentication - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Is either a ManagedInstanceAzureADOnlyAuthentication type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceAzureADOnlyAuthentication - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = 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, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "ManagedInstanceAzureADOnlyAuthentication", pipeline_response.http_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.ManagedInstanceAzureADOnlyAuthentication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing server Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - authentication_name=authentication_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 6a07616ecd1c..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_dtcs_operations.py +++ /dev/null @@ -1,528 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dtcName": _SERIALIZER.url("dtc_name", dtc_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - 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", "2025-01-01")) - 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}/dtc/{dtcName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dtcName": _SERIALIZER.url("dtc_name", dtc_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceDtcsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_dtcs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceDtc"]: - """Gets a list of managed instance DTC settings. - - :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 iterator like instance of either ManagedInstanceDtc or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceDtc] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceDtcListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceDtcListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, dtc_name: Union[str, _models.DtcName], **kwargs: Any - ) -> _models.ManagedInstanceDtc: - """Gets managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :return: ManagedInstanceDtc or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceDtc", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceDtc") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: _models.ManagedInstanceDtc, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc - :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 ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. 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 ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dtc_name: Union[str, _models.DtcName], - parameters: Union[_models.ManagedInstanceDtc, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceDtc]: - """Updates managed instance DTC settings. - - :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 dtc_name: The name of the managed instance DTC. "current" Required. - :type dtc_name: str or ~azure.mgmt.sql.models.DtcName - :param parameters: Managed instance DTC settings. Is either a ManagedInstanceDtc type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceDtc or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceDtc] = 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, - managed_instance_name=managed_instance_name, - dtc_name=dtc_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceDtc", pipeline_response.http_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.ManagedInstanceDtc].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceDtc]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index dda946e2bfcb..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py +++ /dev/null @@ -1,706 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - 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}/encryptionProtector/{encryptionProtectorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_revalidate_request( - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_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) - - -class ManagedInstanceEncryptionProtectorsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_encryption_protectors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceEncryptionProtector"]: - """Gets a list of managed instance encryption protectors. - - :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 iterator like instance of either ManagedInstanceEncryptionProtector or the result - of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceEncryptionProtectorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceEncryptionProtectorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> _models.ManagedInstanceEncryptionProtector: - """Gets a managed instance encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be retrieved. - "current" Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :return: ManagedInstanceEncryptionProtector or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceEncryptionProtector") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: _models.ManagedInstanceEncryptionProtector, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector - :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 ManagedInstanceEncryptionProtector or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. 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 ManagedInstanceEncryptionProtector or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - parameters: Union[_models.ManagedInstanceEncryptionProtector, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: - """Updates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :param parameters: The requested encryption protector resource state. Is either a - ManagedInstanceEncryptionProtector type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceEncryptionProtector or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceEncryptionProtector", pipeline_response.http_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.ManagedInstanceEncryptionProtector].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceEncryptionProtector]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _revalidate_initial( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_revalidate_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_revalidate( - self, - resource_group_name: str, - managed_instance_name: str, - encryption_protector_name: Union[str, _models.EncryptionProtectorName], - **kwargs: Any - ) -> LROPoller[None]: - """Revalidates an existing encryption protector. - - :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 encryption_protector_name: The name of the encryption protector to be updated. "current" - Required. - :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName - :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", self._config.api_version)) - 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._revalidate_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - encryption_protector_name=encryption_protector_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 0c82332cf623..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py +++ /dev/null @@ -1,687 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_request( - resource_group_name: str, - managed_instance_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys", - ) - 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 - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, key_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, managed_instance_name: str, key_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", "2025-01-01")) - 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}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, managed_instance_name: str, key_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceKeysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_keys` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, filter: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceKey"]: - """Gets a list of managed instance keys. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either ManagedInstanceKey or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceKey] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceKeyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceKeyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> _models.ManagedInstanceKey: - """Gets a managed instance key. - - :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 key_name: The name of the managed instance key to be retrieved. Required. - :type key_name: str - :return: ManagedInstanceKey or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceKey", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: Union[_models.ManagedInstanceKey, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceKey") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: _models.ManagedInstanceKey, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey - :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 ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. 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 ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - key_name: str, - parameters: Union[_models.ManagedInstanceKey, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceKey]: - """Creates or updates a managed instance key. - - :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 key_name: The name of the managed instance key to be operated on (updated or created). - Required. - :type key_name: str - :param parameters: The requested managed instance key resource state. Is either a - ManagedInstanceKey type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceKey or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceKey] = 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, - managed_instance_name=managed_instance_name, - key_name=key_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceKey", pipeline_response.http_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.ManagedInstanceKey].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceKey]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the managed instance key with the given name. - - :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 key_name: The name of the managed instance key to be deleted. Required. - :type key_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - key_name=key_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index d703d32302dd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py +++ /dev/null @@ -1,740 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "policyName": _SERIALIZER.url("policy_name", policy_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceLongTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_long_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: - """Gets a database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedInstanceLongTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedInstanceLongTermRetentionPolicy: - """Gets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :return: ManagedInstanceLongTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceLongTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: _models.ManagedInstanceLongTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy - :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 ManagedInstanceLongTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. 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 ManagedInstanceLongTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Sets a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :param parameters: The long term retention policy info. Is either a - ManagedInstanceLongTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstanceLongTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]: - """Deletes a managed database's long term retention policy. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param policy_name: The policy name. Should always be Default. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName - :return: An instance of LROPoller that returns either ManagedInstanceLongTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - policy_name=policy_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstanceLongTermRetentionPolicy", pipeline_response.http_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.ManagedInstanceLongTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstanceLongTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index e12629cecbeb..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations_operations.py +++ /dev/null @@ -1,365 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, managed_instance_name: str, operation_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "operationId": _SERIALIZER.url("operation_id", operation_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceOperation"]: - """Gets a list of operations performed on the managed instance. - - :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 iterator like instance of either ManagedInstanceOperation or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any - ) -> _models.ManagedInstanceOperation: - """Gets a management operation on a managed instance. - - :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 operation_id: Required. - :type operation_id: str - :return: ManagedInstanceOperation or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceOperation", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def cancel( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any - ) -> None: - """Cancels the asynchronous operation on the managed instance. - - :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 operation_id: Required. - :type operation_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - operation_id=operation_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 35dffa4062ac..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py +++ /dev/null @@ -1,698 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_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", "2025-01-01")) - 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}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstancePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 iterator like instance of either ManagedInstancePrivateEndpointConnection or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.ManagedInstancePrivateEndpointConnection: - """Gets a private endpoint connection. - - :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: ManagedInstancePrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstancePrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstancePrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: _models.ManagedInstancePrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection - :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 ManagedInstancePrivateEndpointConnection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: 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 ManagedInstancePrivateEndpointConnection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.ManagedInstancePrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstancePrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Is either a ManagedInstancePrivateEndpointConnection type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection or IO[bytes] - :return: An instance of LROPoller that returns either ManagedInstancePrivateEndpointConnection - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = 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, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "ManagedInstancePrivateEndpointConnection", pipeline_response.http_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.ManagedInstancePrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedInstancePrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index a18bf124b52a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py +++ /dev/null @@ -1,273 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "groupName": _SERIALIZER.url("group_name", 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstancePrivateLinkResourcesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstancePrivateLink"]: - """Gets the private link resources for SQL server. - - :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 iterator like instance of either ManagedInstancePrivateLink or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateLink] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstancePrivateLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, group_name: str, **kwargs: Any - ) -> _models.ManagedInstancePrivateLink: - """Gets a private link resource for SQL server. - - :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 group_name: The name of the private link resource. Required. - :type group_name: str - :return: ManagedInstancePrivateLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstancePrivateLink", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 58c29252e45d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py +++ /dev/null @@ -1,288 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_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", "2025-01-01")) - 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}/tdeCertificates", - ) - 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 - 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 ManagedInstanceTdeCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_tde_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TdeCertificate") - - _request = build_create_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.TdeCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Is either a - TdeCertificate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._create_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 5783fdd34cb4..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py +++ /dev/null @@ -1,589 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedInstanceVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instance_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: - """Gets the managed instance's vulnerability assessment policies. - - :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 for which the vulnerability - assessments is defined. Required. - :type managed_instance_name: str - :return: An iterator like instance of either ManagedInstanceVulnerabilityAssessment or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Gets the managed instance's vulnerability assessment. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.ManagedInstanceVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.ManagedInstanceVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.ManagedInstanceVulnerabilityAssessment: - """Creates or updates the managed instance's vulnerability assessment. Learn more about setting - SQL vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a ManagedInstanceVulnerabilityAssessment - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment or IO[bytes] - :return: ManagedInstanceVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = 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, "ManagedInstanceVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ManagedInstanceVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the managed instance's vulnerability assessment. - - :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 for which the vulnerability - assessment is defined. Required. - :type managed_instance_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 1e70148a08c3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py +++ /dev/null @@ -1,2414 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_instance_pool_request( - resource_group_name: str, - instance_pool_name: str, - subscription_id: str, - *, - expand: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - subscription_id: str, - *, - expand: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}", - ) - 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 - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_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", "2025-01-01")) - 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}", - ) - 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 - 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, 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}", - ) - 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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_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", "2025-01-01")) - 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}", - ) - 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 - 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, - managed_instance_name: str, - subscription_id: str, - *, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover", - ) - 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 - if replica_type is not None: - _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") - _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_list_outbound_network_dependencies_by_managed_instance_request( # pylint: disable=name-too-long - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/outboundNetworkDependenciesEndpoints", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/reevaluateInaccessibleDatabaseState", - ) - 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_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus", - ) - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start", - ) - 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_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop", - ) - 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_list_by_managed_instance_request( - resource_group_name: str, - managed_instance_name: str, - subscription_id: str, - *, - number_of_queries: Optional[int] = None, - databases: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, - observation_metric: Optional[Union[str, _models.MetricType]] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries", - ) - 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 - if number_of_queries is not None: - _params["numberOfQueries"] = _SERIALIZER.query("number_of_queries", number_of_queries, "int") - if databases is not None: - _params["databases"] = _SERIALIZER.query("databases", databases, "str") - if start_time is not None: - _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") - if end_time is not None: - _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") - if interval is not None: - _params["interval"] = _SERIALIZER.query("interval", interval, "str") - if aggregation_function is not None: - _params["aggregationFunction"] = _SERIALIZER.query("aggregation_function", aggregation_function, "str") - if observation_metric is not None: - _params["observationMetric"] = _SERIALIZER.query("observation_metric", observation_metric, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_validate_azure_key_vault_encryption_key_request( # pylint: disable=name-too-long - 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", "2025-01-01")) - 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}/validateAzureKeyVaultEncryptionKey", - ) - 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 - 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 ManagedInstancesOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_instances` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.ManagedInstance"]: - """Gets a list of all managed instances in the subscription. - - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstance"]: - """Gets a list of all managed instances in an instance pool. - - :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 instance_pool_name: The instance pool name. Required. - :type instance_pool_name: str - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.ManagedInstance"]: - """Gets a list of managed instances in a resource 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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either ManagedInstance or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstanceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedInstanceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.ManagedInstance: - """Gets a managed instance. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: ManagedInstance or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedInstance - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedInstance", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstance, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstance") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstance, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstance - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. 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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstance, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Creates or updates a managed instance. - - :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 parameters: The requested managed instance resource state. Is either a ManagedInstance - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstance or IO[bytes] - :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] - :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", self._config.api_version)) - 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) - 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, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - def _delete_initial(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a managed instance. - - :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 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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstanceUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. 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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Updates a managed instance. - - :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 parameters: The requested managed instance resource state. Is either a - ManagedInstanceUpdate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate or IO[bytes] - :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] - :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", self._config.api_version)) - 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) - 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, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - def _failover_initial( - self, - resource_group_name: str, - managed_instance_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - replica_type=replica_type, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, - resource_group_name: str, - managed_instance_name: str, - replica_type: Optional[Union[str, _models.ReplicaType]] = None, - **kwargs: Any - ) -> LROPoller[None]: - """Failovers a managed instance. - - :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 to failover. Required. - :type managed_instance_name: str - :param replica_type: The type of replica to be failed over. Known values are: "Primary" and - "ReadableSecondary". Default value is None. - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :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", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - replica_type=replica_type, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundEnvironmentEndpoint"]: - """Gets the collection of outbound network dependencies for the given managed instance. - - :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 iterator like instance of either OutboundEnvironmentEndpoint or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundEnvironmentEndpoint] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundEnvironmentEndpointCollection] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_outbound_network_dependencies_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundEnvironmentEndpointCollection", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reevaluate_inaccessible_database_state_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Reevaluates the inaccessibility state of all managed databases. - - :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 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", self._config.api_version)) - 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._reevaluate_inaccessible_database_state_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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _refresh_status_initial( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = 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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "RefreshExternalGovernanceStatusOperationResultMI", pipeline_response.http_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(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_start_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_start( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Starts the managed instance. - - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = 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( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - def _stop_initial(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_stop_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_stop( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> LROPoller[_models.ManagedInstance]: - """Stops the managed instance. - - :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 ManagedInstance or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedInstance] = 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( - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedInstance", pipeline_response.http_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.ManagedInstance].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 - ) - - @distributed_trace - def list_by_managed_instance( - self, - resource_group_name: str, - managed_instance_name: str, - number_of_queries: Optional[int] = None, - databases: Optional[str] = None, - start_time: Optional[str] = None, - end_time: Optional[str] = None, - interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, - aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, - observation_metric: Optional[Union[str, _models.MetricType]] = None, - **kwargs: Any - ) -> ItemPaged["_models.TopQueries"]: - """Get top resource consuming queries of a managed instance. - - :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 number_of_queries: How many 'top queries' to return. Default is 5. Default value is - None. - :type number_of_queries: int - :param databases: Comma separated list of databases to be included into search. All DB's are - included if this parameter is not specified. Default value is None. - :type databases: str - :param start_time: Start time for observed period. Default value is None. - :type start_time: str - :param end_time: End time for observed period. Default value is None. - :type end_time: str - :param interval: The time step to be used to summarize the metric values. Default value is - PT1H. Known values are: "PT1H" and "P1D". Default value is None. - :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType - :param aggregation_function: Aggregation function to be used, default value is 'sum'. Known - values are: "avg", "min", "max", "stdev", and "sum". Default value is None. - :type aggregation_function: str or ~azure.mgmt.sql.models.AggregationFunctionType - :param observation_metric: Metric to be used for ranking top queries. Default is 'cpu'. Known - values are: "cpu", "io", "logIo", "duration", and "dtu". Default value is None. - :type observation_metric: str or ~azure.mgmt.sql.models.MetricType - :return: An iterator like instance of either TopQueries or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TopQueries] - :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", self._config.api_version)) - cls: ClsType[_models.TopQueriesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - number_of_queries=number_of_queries, - databases=databases, - start_time=start_time, - end_time=end_time, - interval=interval, - aggregation_function=aggregation_function, - observation_metric=observation_metric, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TopQueriesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest") - - _request = build_validate_azure_key_vault_encryption_key_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key parameters. Required. - :type parameters: - ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Validates customer managed key. - - :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 parameters: The validate azure key vault encryption key parameters. Is either a - ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._validate_azure_key_vault_encryption_key_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index b00272c6b6ec..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_ledger_digest_uploads_operations.py +++ /dev/null @@ -1,742 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, managed_instance_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - 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", "2025-01-01")) - 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}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_disable_request( - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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) - - -class ManagedLedgerDigestUploadsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_ledger_digest_uploads` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedLedgerDigestUploads"]: - """Gets all ledger digest upload settings on a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :return: An iterator like instance of either ManagedLedgerDigestUploads or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploadsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploadsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> _models.ManagedLedgerDigestUploads: - """Gets the current ledger digest upload configuration for a database. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :return: ManagedLedgerDigestUploads or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedLedgerDigestUploads") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: _models.ManagedLedgerDigestUploads, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads - :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 ManagedLedgerDigestUploads or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. 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 ManagedLedgerDigestUploads or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - parameters: Union[_models.ManagedLedgerDigestUploads, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedLedgerDigestUploads]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: The name of the Ledger Digest Upload Configurations. "current" - Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :param parameters: The Ledger Digest Storage Endpoint. Is either a ManagedLedgerDigestUploads - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads or IO[bytes] - :return: An instance of LROPoller that returns either ManagedLedgerDigestUploads or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = 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, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_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.ManagedLedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedLedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _disable_initial( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_disable_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_disable( - self, - resource_group_name: str, - managed_instance_name: str, - database_name: str, - ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], - **kwargs: Any - ) -> LROPoller[_models.ManagedLedgerDigestUploads]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :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 database_name: The name of the database. Required. - :type database_name: str - :param ledger_digest_uploads: "current" Required. - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName - :return: An instance of LROPoller that returns either ManagedLedgerDigestUploads or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedLedgerDigestUploads] = 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._disable_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - ledger_digest_uploads=ledger_digest_uploads, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedLedgerDigestUploads", pipeline_response.http_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.ManagedLedgerDigestUploads].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedLedgerDigestUploads]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 71ccb1229479..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ /dev/null @@ -1,845 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_restorable_dropped_database_request( # pylint: disable=name-too-long - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_id, "str" - ), - "policyName": _SERIALIZER.url("policy_name", policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_id, "str" - ), - "policyName": _SERIALIZER.url("policy_name", policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - 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", "2025-01-01")) - 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}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_id, "str" - ), - "policyName": _SERIALIZER.url("policy_name", policy_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_restorable_dropped_database_backup_short_term_retention_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_restorable_dropped_database( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: - """Gets a dropped database's short term retention policy list. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: An iterator like instance of either ManagedBackupShortTermRetentionPolicy or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_restorable_dropped_database_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - **kwargs: Any - ) -> _models.ManagedBackupShortTermRetentionPolicy: - """Gets a dropped database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :return: ManagedBackupShortTermRetentionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedBackupShortTermRetentionPolicy") - - _request = build_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: _models.ManagedBackupShortTermRetentionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy - :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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_id: str, - policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], - parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: - """Sets a database's short term retention policy. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param policy_name: The policy name. Should always be "default". "default" Required. - :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName - :param parameters: The short term retention policy info. Is either a - ManagedBackupShortTermRetentionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedBackupShortTermRetentionPolicy or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - policy_name=policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedBackupShortTermRetentionPolicy", pipeline_response.http_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.ManagedBackupShortTermRetentionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 5f8ebb455de5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_dns_aliases_operations.py +++ /dev/null @@ -1,921 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, dns_alias_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, managed_instance_name: str, dns_alias_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", "2025-01-01")) - 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}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, managed_instance_name: str, dns_alias_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_acquire_request( - resource_group_name: str, managed_instance_name: str, dns_alias_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", "2025-01-01")) - 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}/dnsAliases/{dnsAliasName}/acquire", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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 ManagedServerDnsAliasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_server_dns_aliases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedServerDnsAlias"]: - """Gets a list of managed server DNS aliases for a managed server. - - :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 iterator like instance of either ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> _models.ManagedServerDnsAlias: - """Gets a server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :return: ManagedServerDnsAlias or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerDnsAliasCreation") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: _models.ManagedServerDnsAliasCreation, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation - :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 ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: 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 ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasCreation, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Creates a managed server DNS alias. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Is either a ManagedServerDnsAliasCreation type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation or IO[bytes] - :return: An instance of LROPoller that returns either ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerDnsAlias] = 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, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_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.ManagedServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the managed server DNS alias with the given name. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _acquire_initial( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerDnsAliasAcquisition") - - _request = build_acquire_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: _models.ManagedServerDnsAliasAcquisition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition - :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 ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: 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 ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_acquire( - self, - resource_group_name: str, - managed_instance_name: str, - dns_alias_name: str, - parameters: Union[_models.ManagedServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedServerDnsAlias]: - """Acquires managed server DNS alias from another managed server. - - :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 dns_alias_name: Required. - :type dns_alias_name: str - :param parameters: Is either a ManagedServerDnsAliasAcquisition type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition or IO[bytes] - :return: An instance of LROPoller that returns either ManagedServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerDnsAlias] = 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._acquire_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerDnsAlias", pipeline_response.http_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.ManagedServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 306d1341965b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py +++ /dev/null @@ -1,541 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - 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", "2025-01-01")) - 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}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ManagedServerSecurityAlertPoliciesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`managed_server_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ManagedServerSecurityAlertPolicy"]: - """Get the managed server's threat detection policies. - - :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 iterator like instance of either ManagedServerSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - **kwargs: Any - ) -> _models.ManagedServerSecurityAlertPolicy: - """Get a managed server's threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :return: ManagedServerSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ManagedServerSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: _models.ManagedServerSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy - :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 ManagedServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. 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 ManagedServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ManagedServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The managed server security alert policy. Is either a - ManagedServerSecurityAlertPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ManagedServerSecurityAlertPolicy or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = 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, - managed_instance_name=managed_instance_name, - security_alert_policy_name=security_alert_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ManagedServerSecurityAlertPolicy", pipeline_response.http_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.ManagedServerSecurityAlertPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ManagedServerSecurityAlertPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_network_security_perimeter_configurations_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index 587f322a7722..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,435 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, nsp_config_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reconcile_request( - resource_group_name: str, server_name: str, nsp_config_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_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) - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets a list of NSP configurations for a server. - - :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 - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] - :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", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets a network security perimeter configuration. - - :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 nsp_config_name: Required. - :type nsp_config_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _reconcile_initial( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reconcile( - self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any - ) -> LROPoller[_models.NetworkSecurityPerimeterConfiguration]: - """Reconcile network security perimeter configuration for SQL Resource Provider. - - :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 nsp_config_name: Required. - :type nsp_config_name: str - :return: An instance of LROPoller that returns either NetworkSecurityPerimeterConfiguration or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] - :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", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( - resource_group_name=resource_group_name, - server_name=server_name, - nsp_config_name=nsp_config_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_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.NetworkSecurityPerimeterConfiguration].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.NetworkSecurityPerimeterConfiguration]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 245c234273d4..b7cb920b8535 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 @@ -1,12 +1,16 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar +import datetime +from io import IOBase +import json +from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload import urllib.parse from azure.core import PipelineClient @@ -16,36 +20,42 @@ ResourceExistsError, ResourceNotFoundError, ResourceNotModifiedError, + StreamClosedError, + StreamConsumedError, map_error, ) from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.core.rest import HttpRequest, HttpResponse from azure.core.tracing.decorator import distributed_trace from azure.core.utils import case_insensitive_dict from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models -from .._configuration import SqlManagementClientConfiguration +from .._configuration import SqlClientConfiguration +from .._utils.model_base import SdkJSONEncoder, _deserialize, _failsafe_deserialize from .._utils.serialization import Deserializer, Serializer T = TypeVar("T") ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] +JSON = MutableMapping[str, Any] List = list _SERIALIZER = Serializer() _SERIALIZER.client_side_validation = False -def build_list_request(**kwargs: Any) -> HttpRequest: +def build_operations_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) accept = _headers.pop("Accept", "application/json") # Construct URL - _url = kwargs.pop("template_url", "/providers/Microsoft.Sql/operations") + _url = "/providers/Microsoft.Sql/operations" # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") @@ -56,38 +66,93299 @@ def build_list_request(**kwargs: Any) -> HttpRequest: return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) +def build_backup_short_term_retention_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_backup_short_term_retention_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_backup_short_term_retention_policies_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_backup_short_term_retention_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_columns_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_columns_list_by_table_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_columns_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if schema is not None: + _params["schema"] = [_SERIALIZER.query("schema", q, "str") if q is not None else "" for q in schema] + if table is not None: + _params["table"] = [_SERIALIZER.query("table", q, "str") if q is not None else "" for q in table] + if column is not None: + _params["column"] = [_SERIALIZER.query("column", q, "str") if q is not None else "" for q in column] + if order_by is not None: + _params["orderBy"] = [_SERIALIZER.query("order_by", q, "str") if q is not None else "" for q in order_by] + if skiptoken is not None: + _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restore_points_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + restore_point_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "restorePointName": _SERIALIZER.url("restore_point_name", restore_point_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restore_points_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + restore_point_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "restorePointName": _SERIALIZER.url("restore_point_name", restore_point_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_restore_points_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restore_points_create_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_list_current_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if count is not None: + _params["$count"] = _SERIALIZER.query("count", count, "bool") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_update_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_list_recommended_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if include_disabled_recommendations is not None: + _params["includeDisabledRecommendations"] = _SERIALIZER.query( + "include_disabled_recommendations", include_disabled_recommendations, "bool" + ) + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sensitivity_labels_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_sensitivity_labels_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_sensitivity_labels_disable_recommendation_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sensitivity_labels_enable_recommendation_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_databases_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_create_or_update_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_update_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_delete_request( + resource_group_name: str, server_name: str, database_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_databases_list_by_server_request( + resource_group_name: str, + server_name: str, + subscription_id: str, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if orderby is not None: + _params["$orderby"] = _SERIALIZER.query("orderby", orderby, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_export_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_failover_request( + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if replica_type is not None: + _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_databases_import_method_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_rename_request( + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_pause_request( + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_resume_request( + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_upgrade_data_warehouse_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_databases_list_inaccessible_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_databases_list_by_elastic_pool_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, elastic_pool_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_rules_get_request( + resource_group_name: str, server_name: str, firewall_rule_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, firewall_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_rules_delete_request( + resource_group_name: str, server_name: str, firewall_rule_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_firewall_rules_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_firewall_rules_replace_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_replication_links_get_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_replication_links_create_or_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_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_replication_links_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_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_replication_links_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_replication_links_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_replication_links_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_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_replication_links_failover_allow_data_loss_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "linkId": _SERIALIZER.url("link_id", link_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_replication_links_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_get_request( + resource_group_name: str, server_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_create_or_update_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_update_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_delete_request( + resource_group_name: str, server_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_servers_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_list_request(subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers" + path_format_arguments = { + "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") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_import_database_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_refresh_status_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/refreshExternalGovernanceStatus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_servers_check_name_availability_request( # pylint: disable=name-too-long + subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability" + path_format_arguments = { + "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_server_blob_auditing_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_blob_auditing_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_blob_auditing_policies_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_blob_auditing_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_blob_auditing_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_blob_auditing_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/auditingSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_database_blob_auditing_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_database_blob_auditing_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_database_blob_auditing_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_server_blob_auditing_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_server_blob_auditing_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings/{blobAuditingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_extended_server_blob_auditing_policies_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/extendedAuditingSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_advisors_get_request( + resource_group_name: str, server_name: str, advisor_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_advisors_update_request( + resource_group_name: str, server_name: str, advisor_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_advisors_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_columns_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_columns_list_by_table_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_columns_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if schema is not None: + _params["schema"] = [_SERIALIZER.query("schema", q, "str") if q is not None else "" for q in schema] + if table is not None: + _params["table"] = [_SERIALIZER.query("table", q, "str") if q is not None else "" for q in table] + if column is not None: + _params["column"] = [_SERIALIZER.query("column", q, "str") if q is not None else "" for q in column] + if order_by is not None: + _params["orderBy"] = [_SERIALIZER.query("order_by", q, "str") if q is not None else "" for q in order_by] + if skiptoken is not None: + _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_tables_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_tables_list_by_schema_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_tables_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_tables_list_by_schema_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_schemas_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + schema_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_schemas_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_schemas_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_schemas_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_security_alert_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_security_alert_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_security_alert_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_baseline_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_sql_vulnerability_assessments_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessments_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessments_settings_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_rule_baselines_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_rule_baselines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_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_database_sql_vulnerability_assessment_rule_baselines_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_rule_baseline_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_rule_baseline_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "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_sql_vulnerability_assessment_rule_baseline_list_by_baseline_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_scan_result_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + "scanResultId": _SERIALIZER.url("scan_result_id", scan_result_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_scan_result_list_by_scan_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_scan_result_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + "scanResultId": _SERIALIZER.url("scan_result_id", scan_result_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_scan_result_list_by_scan_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_scans_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_rule_baselines_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_rule_baselines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_rule_baselines_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_database_vulnerability_assessment_rule_baselines_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessment_rule_baselines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessment_rule_baselines_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_database_vulnerability_assessments_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessments_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_database_vulnerability_assessments_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessments_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessments_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_database_vulnerability_assessments_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessment_scans_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessment_scans_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_vulnerability_assessment_scans_export_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_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_managed_database_vulnerability_assessment_scans_initiate_scan_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_data_masking_policies_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_masking_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deleted_servers_get_request( + location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deleted_servers_list_by_location_request( # pylint: disable=name-too-long + location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deleted_servers_recover_request( + location_name: str, deleted_server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "deletedServerName": _SERIALIZER.url("deleted_server_name", deleted_server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_deleted_servers_list_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers" + path_format_arguments = { + "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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_distributed_availability_groups_get_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_distributed_availability_groups_create_or_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _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_distributed_availability_groups_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _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_distributed_availability_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_distributed_availability_groups_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_distributed_availability_groups_failover_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _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_distributed_availability_groups_set_role_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "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" + ), + } + + _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_managed_databases_get_request( + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_update_request( + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_delete_request( + resource_group_name: str, managed_instance_name: str, database_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_databases_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_cancel_move_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_complete_move_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_complete_restore_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeRestore" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/reevaluateInaccessibleDatabaseState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_start_move_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_databases_list_inaccessible_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/inaccessibleManagedDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_groups_get_request( + resource_group_name: str, location_name: str, server_trust_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, server_trust_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_groups_delete_request( + resource_group_name: str, location_name: str, server_trust_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_trust_groups_list_by_location_request( # pylint: disable=name-too-long + resource_group_name: str, location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_groups_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_get_request( + resource_group_name: str, + managed_instance_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_create_or_update_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_update_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_delete_request( + resource_group_name: str, managed_instance_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instances_list_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_list_request( + subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances" + path_format_arguments = { + "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") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_failover_request( + resource_group_name: str, + managed_instance_name: str, + subscription_id: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if replica_type is not None: + _params["replicaType"] = _SERIALIZER.query("replica_type", replica_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_instances_list_outbound_network_dependencies_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/outboundNetworkDependenciesEndpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_reevaluate_inaccessible_database_state_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/reevaluateInaccessibleDatabaseState" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_instances_refresh_status_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/refreshExternalGovernanceStatus" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_list_by_managed_instance_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + subscription_id: str, + *, + number_of_queries: Optional[int] = None, + databases: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, + observation_metric: Optional[Union[str, _models.MetricType]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/topqueries" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if number_of_queries is not None: + _params["numberOfQueries"] = _SERIALIZER.query("number_of_queries", number_of_queries, "int") + if databases is not None: + _params["databases"] = _SERIALIZER.query("databases", databases, "str") + if start_time is not None: + _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") + if end_time is not None: + _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") + if interval is not None: + _params["interval"] = _SERIALIZER.query("interval", interval, "str") + if aggregation_function is not None: + _params["aggregationFunction"] = _SERIALIZER.query("aggregation_function", aggregation_function, "str") + if observation_metric is not None: + _params["observationMetric"] = _SERIALIZER.query("observation_metric", observation_metric, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_validate_azure_key_vault_encryption_key_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/validateAzureKeyVaultEncryptionKey" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instances_list_by_instance_pool_request( # pylint: disable=name-too-long + resource_group_name: str, + instance_pool_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pools_get_request( + resource_group_name: str, server_name: str, elastic_pool_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pools_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, elastic_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pools_update_request( + resource_group_name: str, server_name: str, elastic_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pools_delete_request( + resource_group_name: str, server_name: str, elastic_pool_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_elastic_pools_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, *, skip: Optional[int] = None, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pools_failover_request( + resource_group_name: str, server_name: str, elastic_pool_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_encryption_protectors_get_request( + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_encryption_protectors_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_encryption_protectors_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_encryption_protectors_revalidate_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_endpoint_certificates_get_request( + resource_group_name: str, managed_instance_name: str, endpoint_type: 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates/{endpointType}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "endpointType": _SERIALIZER.url("endpoint_type", endpoint_type, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_endpoint_certificates_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/endpointCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_get_request( + resource_group_name: str, server_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, failover_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_update_request( + resource_group_name: str, server_name: str, failover_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_delete_request( + resource_group_name: str, server_name: str, failover_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_failover_groups_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_failover_request( + resource_group_name: str, server_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_force_failover_allow_data_loss_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_failover_groups_try_planned_before_forced_failover_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_geo_backup_policies_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_geo_backup_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "geoBackupPolicyName": _SERIALIZER.url("geo_backup_policy_name", geo_backup_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_geo_backup_policies_list_request( + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_failover_groups_get_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_failover_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, failover_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_failover_groups_delete_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, failover_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_instance_failover_groups_list_by_location_request( # pylint: disable=name-too-long + resource_group_name: str, location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_failover_groups_failover_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_failover_groups_force_failover_allow_data_loss_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, failover_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "failoverGroupName": _SERIALIZER.url("failover_group_name", failover_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pool_operations_get_request( # pylint: disable=name-too-long + resource_group_name: str, instance_pool_name: str, operation_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pool_operations_list_by_instance_pool_request( # pylint: disable=name-too-long + resource_group_name: str, instance_pool_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pools_get_request( + resource_group_name: str, instance_pool_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pools_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, instance_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pools_update_request( + resource_group_name: str, instance_pool_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pools_delete_request( + resource_group_name: str, instance_pool_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_instance_pools_list_by_resource_group_request( # pylint: disable=name-too-long + resource_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_instance_pools_list_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools" + path_format_arguments = { + "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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ipv6_firewall_rules_get_request( + resource_group_name: str, server_name: str, firewall_rule_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ipv6_firewall_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, firewall_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ipv6_firewall_rules_delete_request( + resource_group_name: str, server_name: str, firewall_rule_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules/{firewallRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "firewallRuleName": _SERIALIZER.url("firewall_rule_name", firewall_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_ipv6_firewall_rules_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/ipv6FirewallRules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_executions_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_executions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_executions_cancel_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_job_executions_list_by_job_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_executions_list_by_agent_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/executions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_executions_create_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/start" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_agents_get_request( + resource_group_name: str, server_name: str, job_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_agents_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, job_agent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_agents_update_request( + resource_group_name: str, server_name: str, job_agent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_agents_delete_request( + resource_group_name: str, server_name: str, job_agent_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_job_agents_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_credentials_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "credentialName": _SERIALIZER.url("credential_name", credential_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_credentials_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "credentialName": _SERIALIZER.url("credential_name", credential_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_credentials_delete_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials/{credentialName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "credentialName": _SERIALIZER.url("credential_name", credential_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_job_credentials_list_by_agent_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, job_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/credentials" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_step_executions_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_step_executions_list_by_job_execution_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_executions_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + target_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets/{targetId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + "targetId": _SERIALIZER.url("target_id", target_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_executions_list_by_step_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/steps/{stepName}/targets" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_executions_list_by_job_execution_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + subscription_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/executions/{jobExecutionId}/targets" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobExecutionId": _SERIALIZER.url("job_execution_id", job_execution_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if create_time_min is not None: + _params["createTimeMin"] = _SERIALIZER.query("create_time_min", create_time_min, "iso-8601") + if create_time_max is not None: + _params["createTimeMax"] = _SERIALIZER.query("create_time_max", create_time_max, "iso-8601") + if end_time_min is not None: + _params["endTimeMin"] = _SERIALIZER.query("end_time_min", end_time_min, "iso-8601") + if end_time_max is not None: + _params["endTimeMax"] = _SERIALIZER.query("end_time_max", end_time_max, "iso-8601") + if is_active is not None: + _params["isActive"] = _SERIALIZER.query("is_active", is_active, "bool") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_get_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_create_or_update_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_jobs_delete_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_jobs_list_by_agent_request( + resource_group_name: str, server_name: str, job_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_private_endpoints_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_private_endpoints_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_private_endpoints_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints/{privateEndpointName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "privateEndpointName": _SERIALIZER.url("private_endpoint_name", private_endpoint_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_job_private_endpoints_list_by_agent_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, job_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/privateEndpoints" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_steps_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_steps_create_or_update_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_steps_delete_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps/{stepName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_job_steps_list_by_job_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/steps" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_steps_get_by_version_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + step_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps/{stepName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), + "stepName": _SERIALIZER.url("step_name", step_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_steps_list_by_version_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}/steps" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_groups_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "targetGroupName": _SERIALIZER.url("target_group_name", target_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "targetGroupName": _SERIALIZER.url("target_group_name", target_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_target_groups_delete_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups/{targetGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "targetGroupName": _SERIALIZER.url("target_group_name", target_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_job_target_groups_list_by_agent_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, job_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/targetGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_versions_get_request( + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions/{jobVersion}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + "jobVersion": _SERIALIZER.url("job_version", job_version, "int"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_job_versions_list_by_job_request( + resource_group_name: str, server_name: str, job_agent_name: str, job_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/jobAgents/{jobAgentName}/jobs/{jobName}/versions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "jobAgentName": _SERIALIZER.url("job_agent_name", job_agent_name, "str"), + "jobName": _SERIALIZER.url("job_name", job_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_get_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_delete_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_long_term_retention_backups_list_by_database_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_change_access_tier_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_copy_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_lock_time_based_immutability_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/lockTimeBasedImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_remove_legal_hold_immutability_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeLegalHoldImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_remove_time_based_immutability_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeTimeBasedImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_set_legal_hold_immutability_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/setLegalHoldImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_update_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_get_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_delete_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_long_term_retention_backups_list_by_resource_group_database_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_change_access_tier_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/changeAccessTier" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_copy_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_lock_time_based_immutability_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/lockTimeBasedImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_remove_legal_hold_immutability_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeLegalHoldImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_remove_time_based_immutability_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/removeTimeBasedImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_set_legal_hold_immutability_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/setLegalHoldImmutability" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_update_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + "longTermRetentionDatabaseName": _SERIALIZER.url( + "long_term_retention_database_name", long_term_retention_database_name, "str" + ), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_list_by_location_request( # pylint: disable=name-too-long + location_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_list_by_server_request( # pylint: disable=name-too-long + location_name: str, + long_term_retention_server_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_list_by_resource_group_location_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_backups_list_by_resource_group_server_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "longTermRetentionServerName": _SERIALIZER.url( + "long_term_retention_server_name", long_term_retention_server_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_get_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_delete_by_resource_group_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_resource_group_database_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_get_request( # pylint: disable=name-too-long + location_name: str, + managed_instance_name: str, + database_name: str, + backup_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_delete_request( # pylint: disable=name-too-long + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups/{backupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "backupName": _SERIALIZER.url("backup_name", backup_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_database_request( # pylint: disable=name-too-long + location_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionDatabases/{databaseName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_location_request( # pylint: disable=name-too-long + location_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_instance_request( # pylint: disable=name-too-long + location_name: str, + managed_instance_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_resource_group_location_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_managed_instance_backups_list_by_resource_group_instance_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + managed_instance_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionManagedInstances/{managedInstanceName}/longTermRetentionManagedInstanceBackups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if database_state is not None: + _params["databaseState"] = _SERIALIZER.query("database_state", database_state, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_long_term_retention_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_backup_short_term_retention_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_backup_short_term_retention_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_backup_short_term_retention_policies_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_backup_short_term_retention_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupShortTermRetentionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_restorable_dropped_database_backup_short_term_retention_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_restorable_dropped_database_backup_short_term_retention_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_restorable_dropped_database_backup_short_term_retention_policies_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}/backupShortTermRetentionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_security_alert_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_security_alert_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_security_alert_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityAlertPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_administrators_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_administrators_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_administrators_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instance_administrators_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/administrators" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_azure_ad_only_authentications_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_azure_ad_only_authentications_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_azure_ad_only_authentications_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instance_azure_ad_only_authentications_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/azureADOnlyAuthentications" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_dtcs_get_request( + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dtcName": _SERIALIZER.url("dtc_name", dtc_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_dtcs_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dtcName": _SERIALIZER.url("dtc_name", dtc_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_dtcs_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_encryption_protectors_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_encryption_protectors_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_encryption_protectors_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_encryption_protectors_revalidate_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}/revalidate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_instance_keys_get_request( + resource_group_name: str, managed_instance_name: str, key_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_keys_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, key_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_keys_delete_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, key_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instance_keys_list_by_instance_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_long_term_retention_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_long_term_retention_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_long_term_retention_policies_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "policyName": _SERIALIZER.url("policy_name", policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_long_term_retention_policies_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_operations_get_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, operation_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_operations_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_operations_cancel_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, operation_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_instance_private_endpoint_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_private_endpoint_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_private_endpoint_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instance_private_endpoint_connections_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_vulnerability_assessments_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_vulnerability_assessments_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_vulnerability_assessments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_instance_vulnerability_assessments_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/vulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_dns_aliases_get_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, dns_alias_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_dns_aliases_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, dns_alias_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_dns_aliases_delete_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, dns_alias_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_server_dns_aliases_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_dns_aliases_acquire_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, dns_alias_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_security_alert_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_security_alert_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_server_security_alert_policies_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_perimeter_configurations_get_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, nsp_config_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_perimeter_configurations_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_network_security_perimeter_configurations_reconcile_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, nsp_config_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/networkSecurityPerimeterConfigurations/{nspConfigName}/reconcile" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "nspConfigName": _SERIALIZER.url("nsp_config_name", nsp_config_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_outbound_firewall_rules_get_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_outbound_firewall_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "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="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_outbound_firewall_rules_delete_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_outbound_firewall_rules_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + private_endpoint_connection_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_endpoint_connections_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "privateEndpointConnectionName": _SERIALIZER.url( + "private_endpoint_connection_name", private_endpoint_connection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_private_endpoint_connections_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_resources_get_request( + resource_group_name: str, server_name: str, 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_private_link_resources_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_recoverable_databases_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_recoverable_databases_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_recoverable_managed_databases_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + recoverable_database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "recoverableDatabaseName": _SERIALIZER.url("recoverable_database_name", recoverable_database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_recoverable_managed_databases_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restorable_dropped_databases_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + restorable_dropped_database_id: str, + subscription_id: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restorable_dropped_databases_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restorable_dropped_managed_databases_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "restorableDroppedDatabaseId": _SERIALIZER.url( + "restorable_dropped_database_id", restorable_dropped_database_id, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_restorable_dropped_managed_databases_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_administrators_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_administrators_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_administrators_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "administratorName": _SERIALIZER.url("administrator_name", administrator_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_azure_ad_administrators_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_only_authentications_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_only_authentications_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_azure_ad_only_authentications_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "authenticationName": _SERIALIZER.url("authentication_name", authentication_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_azure_ad_only_authentications_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_configuration_options_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "serverConfigurationOptionName": _SERIALIZER.url( + "server_configuration_option_name", server_configuration_option_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_configuration_options_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "serverConfigurationOptionName": _SERIALIZER.url( + "server_configuration_option_name", server_configuration_option_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_configuration_options_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_connection_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_connection_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_connection_policies_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dev_ops_audit_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "devOpsAuditingSettingsName": _SERIALIZER.url( + "dev_ops_auditing_settings_name", dev_ops_auditing_settings_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dev_ops_audit_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "devOpsAuditingSettingsName": _SERIALIZER.url( + "dev_ops_auditing_settings_name", dev_ops_auditing_settings_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dev_ops_audit_settings_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dns_aliases_get_request( + resource_group_name: str, server_name: str, dns_alias_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dns_aliases_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, dns_alias_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dns_aliases_delete_request( + resource_group_name: str, server_name: str, dns_alias_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_dns_aliases_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_dns_aliases_acquire_request( + resource_group_name: str, server_name: str, dns_alias_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}/acquire" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_keys_get_request( + resource_group_name: str, server_name: str, key_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_keys_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, key_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_keys_delete_request( + resource_group_name: str, server_name: str, key_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "keyName": _SERIALIZER.url("key_name", key_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_keys_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_security_alert_policies_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_security_alert_policies_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_security_alert_policies_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_certificates_get_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, certificate_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_certificates_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, certificate_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_trust_certificates_delete_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, certificate_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "certificateName": _SERIALIZER.url("certificate_name", certificate_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_trust_certificates_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_vulnerability_assessments_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_vulnerability_assessments_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_vulnerability_assessments_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_server_vulnerability_assessments_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_stop_managed_instance_schedules_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_stop_managed_instance_schedules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_start_stop_managed_instance_schedules_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_start_stop_managed_instance_schedules_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_usages_get_request( + location_name: str, usage_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "usageName": _SERIALIZER.url("usage_name", usage_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_subscription_usages_list_by_location_request( # pylint: disable=name-too-long + location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_agents_get_request( + resource_group_name: str, server_name: str, sync_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_agents_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, sync_agent_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_agents_delete_request( + resource_group_name: str, server_name: str, sync_agent_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_sync_agents_list_by_server_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_agents_generate_key_request( + resource_group_name: str, server_name: str, sync_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_agents_list_linked_databases_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, sync_agent_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_sync_groups_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_cancel_sync_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sync_groups_list_hub_schemas_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_list_logs_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + subscription_id: str, + *, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") + _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") + _params["type"] = _SERIALIZER.query("type", type, "str") + if continuation_token_parameter is not None: + _params["continuationToken"] = _SERIALIZER.query( + "continuation_token_parameter", continuation_token_parameter, "str" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_groups_refresh_hub_schema_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sync_groups_trigger_sync_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sync_groups_list_sync_database_ids_request( # pylint: disable=name-too-long + location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_members_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_members_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_members_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_members_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_sync_members_list_by_sync_group_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sync_members_refresh_member_schema_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sync_members_list_member_schemas_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), + "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_time_zones_get_request( + location_name: str, time_zone_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "timeZoneId": _SERIALIZER.url("time_zone_id", time_zone_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_time_zones_list_by_location_request( # pylint: disable=name-too-long + location_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_get_request( + resource_group_name: str, virtual_cluster_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_update_request( + resource_group_name: str, virtual_cluster_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_delete_request( + resource_group_name: str, virtual_cluster_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_virtual_clusters_list_by_resource_group_request( # pylint: disable=name-too-long + resource_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_list_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters" + path_format_arguments = { + "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="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_clusters_update_dns_servers_request( # pylint: disable=name-too-long + resource_group_name: str, virtual_cluster_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_rules_get_request( + resource_group_name: str, server_name: str, virtual_network_rule_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, virtual_network_rule_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_virtual_network_rules_delete_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, virtual_network_rule_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_virtual_network_rules_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_classifiers_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_classifiers_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_classifiers_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_workload_classifiers_list_by_workload_group_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + workload_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_groups_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + workload_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_groups_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + workload_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_workload_groups_delete_request( + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_workload_groups_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_sensitivity_labels_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_sensitivity_labels_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_managed_database_sensitivity_labels_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_managed_database_sensitivity_labels_disable_recommendation_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_database_sensitivity_labels_enable_recommendation_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), + "tableName": _SERIALIZER.url("table_name", table_name, "str"), + "columnName": _SERIALIZER.url("column_name", column_name, "str"), + "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_managed_database_sensitivity_labels_list_current_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if count is not None: + _params["$count"] = _SERIALIZER.query("count", count, "bool") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_sensitivity_labels_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_sensitivity_labels_list_recommended_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip_token is not None: + _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") + if include_disabled_recommendations is not None: + _params["includeDisabledRecommendations"] = _SERIALIZER.query( + "include_disabled_recommendations", include_disabled_recommendations, "bool" + ) + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_sensitivity_labels_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_encryption_protectors_revalidate_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revalidate" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_database_encryption_protectors_revert_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revert" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "encryptionProtectorName": _SERIALIZER.url("encryption_protector_name", encryption_protector_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_database_operations_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_operations_cancel_request( + resource_group_name: str, + server_name: str, + database_name: str, + operation_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/operations/{operationId}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_database_usages_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/usages" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_recommended_sensitivity_labels_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_synapse_link_workspaces_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_operations_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_usages_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_tde_certificates_create_request( + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/tdeCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advanced_threat_protection_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advanced_threat_protection_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advanced_threat_protection_settings_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advancedThreatProtectionSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advisors_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + advisor_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advisors_update_request( + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_advisors_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + expand: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand is not None: + _params["$expand"] = _SERIALIZER.query("expand", expand, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_automatic_tuning_get_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_automatic_tuning_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/automaticTuning/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_extensions_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="GET", url=_url, params=_params, **kwargs) + + +def build_database_extensions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "extensionName": _SERIALIZER.url("extension_name", extension_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_extensions_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_recommended_actions_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + "recommendedActionName": _SERIALIZER.url("recommended_action_name", recommended_action_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_recommended_actions_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + "recommendedActionName": _SERIALIZER.url("recommended_action_name", recommended_action_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_recommended_actions_list_by_database_advisor_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + advisor_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advisorName": _SERIALIZER.url("advisor_name", advisor_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_baselines_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_baselines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_vulnerability_assessment_baselines_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "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_database_sql_vulnerability_assessments_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessments_settings_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_execute_scan_execute_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sql_vulnerability_assessment_execute_scan_execute_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_sql_vulnerability_assessment_rule_baselines_delete_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + subscription_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any +) -> HttpRequest: + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), + "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") + + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) + + +def build_database_sql_vulnerability_assessment_scans_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_scans_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_scans_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_database_vulnerability_assessment_scans_export_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_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_database_vulnerability_assessment_scans_initiate_scan_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "vulnerabilityAssessmentName": _SERIALIZER.url( + "vulnerability_assessment_name", vulnerability_assessment_name, "str" + ), + "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_data_masking_rules_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + subscription_id: str, + *, + skip: Optional[int] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_masking_rules_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "dataMaskingPolicyName": _SERIALIZER.url("data_masking_policy_name", data_masking_policy_name, "str"), + "dataMaskingRuleName": _SERIALIZER.url("data_masking_rule_name", data_masking_rule_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_warehouse_user_activities_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "dataWarehouseUserActivityName": _SERIALIZER.url( + "data_warehouse_user_activity_name", data_warehouse_user_activity_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_data_warehouse_user_activities_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_security_events_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + subscription_id: str, + *, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + if skip is not None: + _params["$skip"] = _SERIALIZER.query("skip", skip, "int") + if top is not None: + _params["$top"] = _SERIALIZER.query("top", top, "int") + if skiptoken is not None: + _params["$skiptoken"] = _SERIALIZER.query("skiptoken", skiptoken, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_recommended_sensitivity_labels_update_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_tde_certificates_create_request( # pylint: disable=name-too-long + 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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/tdeCertificates" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pool_operations_list_by_elastic_pool_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, elastic_pool_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_elastic_pool_operations_cancel_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + operation_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", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/operations/{operationId}/cancel" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "elasticPoolName": _SERIALIZER.url("elastic_pool_name", elastic_pool_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + return HttpRequest(method="POST", url=_url, params=_params, **kwargs) + + +def build_usages_list_by_instance_pool_request( # pylint: disable=name-too-long + resource_group_name: str, + instance_pool_name: str, + subscription_id: str, + *, + expand_children: Optional[bool] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if expand_children is not None: + _params["expandChildren"] = _SERIALIZER.query("expand_children", expand_children, "bool") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ledger_digest_uploads_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ledger_digest_uploads_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_ledger_digest_uploads_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_ledger_digest_uploads_disable_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_maintenance_window_options_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + maintenance_window_options_name: 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["maintenanceWindowOptionsName"] = _SERIALIZER.query( + "maintenance_window_options_name", maintenance_window_options_name, "str" + ) + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_windows_get_request( + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + maintenance_window_name: 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_maintenance_windows_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + subscription_id: str, + *, + maintenance_window_name: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + _params["maintenanceWindowName"] = _SERIALIZER.query("maintenance_window_name", maintenance_window_name, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_advanced_threat_protection_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_advanced_threat_protection_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_advanced_threat_protection_settings_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_move_operations_get_request( # pylint: disable=name-too-long + resource_group_name: str, location_name: str, operation_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + "operationId": _SERIALIZER.url("operation_id", operation_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_move_operations_list_by_location_request( # pylint: disable=name-too-long + resource_group_name: str, + location_name: str, + subscription_id: str, + *, + only_latest_per_database: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if only_latest_per_database is not None: + _params["onlyLatestPerDatabase"] = _SERIALIZER.query( + "only_latest_per_database", only_latest_per_database, "bool" + ) + if filter is not None: + _params["$filter"] = _SERIALIZER.query("filter", filter, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_queries_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + query_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "queryId": _SERIALIZER.url("query_id", query_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_queries_list_by_query_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + query_id: str, + subscription_id: str, + *, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "queryId": _SERIALIZER.url("query_id", query_id, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if start_time is not None: + _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") + if end_time is not None: + _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") + if interval is not None: + _params["interval"] = _SERIALIZER.query("interval", interval, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_restore_details_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + restore_details_name: Union[str, _models.RestoreDetailsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/restoreDetails/{restoreDetailsName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "restoreDetailsName": _SERIALIZER.url("restore_details_name", restore_details_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_transparent_data_encryption_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_transparent_data_encryption_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_database_transparent_data_encryption_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_advanced_threat_protection_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_advanced_threat_protection_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_advanced_threat_protection_settings_list_by_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_private_link_resources_get_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "groupName": _SERIALIZER.url("group_name", group_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_instance_private_link_resources_list_by_managed_instance_request( # pylint: disable=name-too-long + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_ledger_digest_uploads_get_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_ledger_digest_uploads_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_managed_ledger_digest_uploads_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, managed_instance_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_managed_ledger_digest_uploads_disable_request( # pylint: disable=name-too-long + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "ledgerDigestUploads": _SERIALIZER.url("ledger_digest_uploads", ledger_digest_uploads, "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_server_advanced_threat_protection_settings_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_advanced_threat_protection_settings_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "advancedThreatProtectionName": _SERIALIZER.url( + "advanced_threat_protection_name", advanced_threat_protection_name, "str" + ), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_advanced_threat_protection_settings_list_by_server_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_automatic_tuning_get_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_server_automatic_tuning_update_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_agent_get_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_sql_agent_create_or_update_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 {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_get_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_create_or_update_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + subscription_id: str, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_list_by_database_request( # pylint: disable=name-too-long + resource_group_name: str, server_name: str, database_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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_resume_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/resume" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_transparent_data_encryptions_suspend_request( # pylint: disable=name-too-long + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + 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", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/suspend" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), + "serverName": _SERIALIZER.url("server_name", server_name, "str"), + "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "tdeName": _SERIALIZER.url("tde_name", tde_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + + +def build_capabilities_list_by_location_request( # pylint: disable=name-too-long + location_name: str, + subscription_id: str, + *, + include: Optional[Union[str, _models.CapabilityGroup]] = None, + **kwargs: Any +) -> HttpRequest: + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-02-01-preview")) + accept = _headers.pop("Accept", "application/json") + + # Construct URL + _url = "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/capabilities" + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), + "locationName": _SERIALIZER.url("location_name", location_name, "str"), + } + + _url: str = _url.format(**path_format_arguments) # type: ignore + + # Construct parameters + _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") + if include is not None: + _params["include"] = _SERIALIZER.query("include", include, "str") + + # Construct headers + _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") + + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + + class Operations: """ .. warning:: **DO NOT** instantiate this class directly. Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`operations` attribute. + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: + """Lists all of the available SQL Rest API operations. + + :return: An iterator like instance of Operation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Operation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Operation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_operations_list_request( + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Operation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class BackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.BackupShortTermRetentionPolicy: + """Gets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :return: BackupShortTermRetentionPolicy. The BackupShortTermRetentionPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.BackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: _models.BackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + BackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackupShortTermRetentionPolicy]( + 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, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: _models.BackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy + :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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.ShortTermRetentionPolicyName], + parameters: Union[_models.BackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.BackupShortTermRetentionPolicy]: + """Updates a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + BackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.BackupShortTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns BackupShortTermRetentionPolicy. The + BackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.BackupShortTermRetentionPolicy] = 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, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.BackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.BackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.BackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.BackupShortTermRetentionPolicy"]: + """Gets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of BackupShortTermRetentionPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.BackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.BackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_backup_short_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.BackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseColumnsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_columns` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> _models.DatabaseColumn: + """Get database column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: DatabaseColumn. The DatabaseColumn is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseColumn + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) + + _request = build_database_columns_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseColumn, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_table( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseColumn"]: + """List database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_columns_list_by_table_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseColumn"]: + """List database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword schema: Default value is None. + :paramtype schema: list[str] + :keyword table: Default value is None. + :paramtype table: list[str] + :keyword column: Default value is None. + :paramtype column: list[str] + :keyword order_by: Default value is None. + :paramtype order_by: list[str] + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_columns_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + schema=schema, + table=table, + column=column, + order_by=order_by, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RestorePointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`restore_points` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any + ) -> _models.RestorePoint: + """Gets a restore point. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_point_name: The name of the restore point. Required. + :type restore_point_name: str + :return: RestorePoint. The RestorePoint is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorePoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) + + _request = build_restore_points_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + restore_point_name=restore_point_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorePoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any + ) -> None: + """Deletes a restore point. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_point_name: The name of the restore point. Required. + :type restore_point_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_restore_points_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + restore_point_name=restore_point_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.RestorePoint"]: + """Gets a list of database restore points. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of RestorePoint + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorePoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restore_points_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorePoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _create_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.CreateDatabaseRestorePointDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_restore_points_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.CreateDatabaseRestorePointDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Required. + :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition + :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 RestorePoint. The RestorePoint is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns RestorePoint. The RestorePoint is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. 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 RestorePoint. The RestorePoint is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.CreateDatabaseRestorePointDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.RestorePoint]: + """Creates a restore point for a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for creating the restore point of this database. Is one of + the following types: CreateDatabaseRestorePointDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition or JSON or + IO[bytes] + :return: An instance of LROPoller that returns RestorePoint. The RestorePoint is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RestorePoint] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.RestorePoint, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RestorePoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RestorePoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SensitivityLabelsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword count: Default value is None. + :paramtype count: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_current_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: SensitivityLabelUpdateList, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword include_disabled_recommendations: Specifies whether to include disabled + recommendations or not. Default value is None. + :paramtype include_disabled_recommendations: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_recommended_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sensitivity_labels_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Gets the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. Known values are: + "current" and "recommended". Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: _models.SensitivityLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. 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: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: Union[_models.SensitivityLabel, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Is one of the following types: + SensitivityLabel, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or JSON or IO[bytes] + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sensitivity_labels_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Deletes the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def disable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_disable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def enable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sensitivity_labels_enable_recommendation_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabasesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.Database: + """Gets a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: Database. The Database is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Database + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = kwargs.pop("cls", None) + + _request = build_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Database, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.Database, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.Database, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Database + :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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.Database, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + Database, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Database or JSON or IO[bytes] + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + 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, + parameters: Union[_models.DatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.DatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate + :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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.DatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + DatabaseUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Database] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, + resource_group_name: str, + server_name: str, + *, + top: Optional[int] = None, + skip: Optional[int] = None, + filter: Optional[str] = None, + orderby: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.Database"]: + """Gets a list of databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :keyword orderby: How the results should be ordered. Default value is None. + :paramtype orderby: str + :return: An iterator like instance of Database + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + top=top, + skip=skip, + filter=filter, + orderby=orderby, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _export_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ExportDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_export_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ExportDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ExportDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Exports a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database export request parameters. Is one of the following types: + ExportDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._export_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ImportExportOperationResult]( + 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, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + replica_type=replica_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Failovers a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword replica_type: The type of replica to be failed over. Known values are: "Primary" and + "ReadableSecondary". Default value is None. + :paramtype replica_type: str or ~azure.mgmt.sql.models.ReplicaType + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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, + server_name=server_name, + database_name=database_name, + replica_type=replica_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _import_method_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ImportExistingDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_import_method_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ImportExistingDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_import_method( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ImportExistingDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The database import request parameters. Is one of the following types: + ImportExistingDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_method_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ImportExportOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.ResourceMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Required. + :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def rename( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def rename( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.ResourceMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Renames a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The resource move definition for renaming this database. Is one of the + following types: ResourceMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ResourceMoveDefinition or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_databases_rename_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def _pause_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_pause_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_pause( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[_models.Database]: + """Pauses a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._pause_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _resume_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_resume( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[_models.Database]: + """Resumes a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _upgrade_data_warehouse_initial( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_databases_upgrade_data_warehouse_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_upgrade_data_warehouse( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[_models.Database]: + """Upgrades a data warehouse. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._upgrade_data_warehouse_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_inaccessible_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.Database"]: + """Gets a list of inaccessible databases in a logical server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of Database + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_inaccessible_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_elastic_pool( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.Database"]: + """Gets a list of databases in an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An iterator like instance of Database + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Database]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_databases_list_by_elastic_pool_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Database], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.FirewallRule: + """Gets a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + + _request = build_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: _models.FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. 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: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: Union[_models.FirewallRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.FirewallRule: + """Creates or updates a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a firewall rule. Is one of + the following types: FirewallRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRule or JSON or IO[bytes] + :return: FirewallRule. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FirewallRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> None: + """Deletes a firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.FirewallRule"]: + """Gets a list of firewall rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of FirewallRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def replace( + self, + resource_group_name: str, + server_name: str, + parameters: _models.FirewallRuleList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def replace( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param 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: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def replace( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.FirewallRuleList, JSON, IO[bytes]], + **kwargs: Any + ) -> Optional[_models.FirewallRule]: + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: Is one of the following types: FirewallRuleList, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FirewallRuleList or JSON or IO[bytes] + :return: FirewallRule or None. The FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FirewallRule or None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Optional[_models.FirewallRule]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_firewall_rules_replace_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ReplicationLinksOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`replication_links` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> _models.ReplicationLink: + """Gets a replication link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: ReplicationLink. The ReplicationLink is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ReplicationLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) + + _request = build_replication_links_get_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ReplicationLink, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + 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, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_replication_links_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Is one of the following types: ReplicationLink, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLink or JSON or IO[bytes] + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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 _update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + link_id: str, + parameters: Union[_models.ReplicationLinkUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_replication_links_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + 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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. 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 ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :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, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Updates the replication link type. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :param parameters: Is one of the following types: ReplicationLinkUpdate, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.ReplicationLinkUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_delete_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the replication link. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ReplicationLink"]: + """Gets a list of replication links on database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ReplicationLink + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ReplicationLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_replication_links_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ReplicationLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_failover_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Fails over from the current primary server to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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._failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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_allow_data_loss_initial( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_replication_links_failover_allow_data_loss_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover_allow_data_loss( + self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any + ) -> LROPoller[_models.ReplicationLink]: + """Fails over from the current primary server to this server allowing data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param link_id: The name of the replication link. Required. + :type link_id: str + :return: An instance of LROPoller that returns ReplicationLink. The ReplicationLink is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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._failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + link_id=link_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ReplicationLink, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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 + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ReplicationLink"]: + """Gets a list of replication links. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ReplicationLink + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ReplicationLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ReplicationLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_replication_links_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ReplicationLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.Server: + """Gets a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: Server. The Server is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Server + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Server] = kwargs.pop("cls", None) + + _request = build_servers_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Server, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.Server, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.Server, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Server + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.Server, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates or updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Is one of the following types: Server, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Server or JSON or IO[bytes] + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ServerUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerUpdate + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Updates a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested server resource state. Is one of the following types: + ServerUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_servers_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.Server"]: + """Gets a list of servers in a resource groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Server + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Server]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_servers_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Server"]: + """Gets a list of all servers in the subscription. + + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of Server + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Server]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_servers_list_request( + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Server], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _import_database_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ImportNewDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_import_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ImportNewDatabaseDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition + :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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import 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 ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_import_database( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ImportNewDatabaseDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ImportExportOperationResult]: + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The database import request parameters. Is one of the following types: + ImportNewDatabaseDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ImportExportOperationResult. The + ImportExportOperationResult is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ImportExportOperationResult] = 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._import_database_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ImportExportOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ImportExportOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ImportExportOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _refresh_status_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_servers_refresh_status_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_refresh_status( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> LROPoller[_models.RefreshExternalGovernanceStatusOperationResult]: + """Refresh external governance enablement status. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An instance of LROPoller that returns RefreshExternalGovernanceStatusOperationResult. + The RefreshExternalGovernanceStatusOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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, + server_name=server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RefreshExternalGovernanceStatusOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.RefreshExternalGovernanceStatusOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.RefreshExternalGovernanceStatusOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @overload + def check_name_availability( + self, parameters: _models.CheckNameAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Required. + :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, parameters: JSON, *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def check_name_availability( + self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. 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: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def check_name_availability( + self, parameters: Union[_models.CheckNameAvailabilityRequest, JSON, IO[bytes]], **kwargs: Any + ) -> _models.CheckNameAvailabilityResponse: + """Determines whether a resource can be created with the specified name. + + :param parameters: The request body. Is one of the following types: + CheckNameAvailabilityRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest or JSON or IO[bytes] + :return: CheckNameAvailabilityResponse. The CheckNameAvailabilityResponse is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.CheckNameAvailabilityResponse] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_servers_check_name_availability_request( + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.CheckNameAvailabilityResponse, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ServerBlobAuditingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ServerBlobAuditingPolicy: + """Gets a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ServerBlobAuditingPolicy. The ServerBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_server_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ServerBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy + :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 ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. 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 ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerBlobAuditingPolicy]: + """Creates or updates a server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of blob auditing policy. Is one of the following types: + ServerBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerBlobAuditingPolicy. The + ServerBlobAuditingPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerBlobAuditingPolicy] = 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, + blob_auditing_policy_name=blob_auditing_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerBlobAuditingPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerBlobAuditingPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerBlobAuditingPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerBlobAuditingPolicy"]: + """Lists auditing settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerBlobAuditingPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_blob_auditing_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseBlobAuditingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Gets a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_database_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.DatabaseBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. 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: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.DatabaseBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseBlobAuditingPolicy: + """Creates or updates a database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The database blob auditing policy. Is one of the following types: + DatabaseBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy or JSON or IO[bytes] + :return: DatabaseBlobAuditingPolicy. The DatabaseBlobAuditingPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseBlobAuditingPolicy"]: + """Lists auditing settings of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseBlobAuditingPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_blob_auditing_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExtendedDatabaseBlobAuditingPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`extended_database_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Gets an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_extended_database_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedDatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ExtendedDatabaseBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. 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: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedDatabaseBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ExtendedDatabaseBlobAuditingPolicy: + """Creates or updates an extended database's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: The extended database blob auditing policy. Is one of the following types: + ExtendedDatabaseBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy or JSON or + IO[bytes] + :return: ExtendedDatabaseBlobAuditingPolicy. The ExtendedDatabaseBlobAuditingPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ExtendedDatabaseBlobAuditingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extended_database_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedDatabaseBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ExtendedDatabaseBlobAuditingPolicy"]: + """Lists extended auditing settings of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ExtendedDatabaseBlobAuditingPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ExtendedDatabaseBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExtendedDatabaseBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extended_database_blob_auditing_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExtendedDatabaseBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ExtendedServerBlobAuditingPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`extended_server_blob_auditing_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + **kwargs: Any + ) -> _models.ExtendedServerBlobAuditingPolicy: + """Gets an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :return: ExtendedServerBlobAuditingPolicy. The ExtendedServerBlobAuditingPolicy is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ExtendedServerBlobAuditingPolicy] = kwargs.pop("cls", None) + + _request = build_extended_server_blob_auditing_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ExtendedServerBlobAuditingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_extended_server_blob_auditing_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: _models.ExtendedServerBlobAuditingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + blob_auditing_policy_name: Union[str, _models.BlobAuditingPolicyName], + parameters: Union[_models.ExtendedServerBlobAuditingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Creates or updates an extended server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param blob_auditing_policy_name: The name of the blob auditing policy. "default" Required. + :type blob_auditing_policy_name: str or ~azure.mgmt.sql.models.BlobAuditingPolicyName + :param parameters: Properties of extended blob auditing policy. Is one of the following types: + ExtendedServerBlobAuditingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + blob_auditing_policy_name=blob_auditing_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ExtendedServerBlobAuditingPolicy"]: + """Lists extended auditing settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ExtendedServerBlobAuditingPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ExtendedServerBlobAuditingPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ExtendedServerBlobAuditingPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_extended_server_blob_auditing_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ExtendedServerBlobAuditingPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerAdvisorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_advisors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any) -> _models.Advisor: + """Gets a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + _request = build_server_advisors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: _models.Advisor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Advisor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. 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: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + server_name: str, + advisor_name: str, + parameters: Union[_models.Advisor, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Advisor: + """Updates a server advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advisor_name: The name of the Server Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Is one of the following types: + Advisor, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Advisor or JSON or IO[bytes] + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_advisors_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> List[_models.Advisor]: + """Gets a list of server advisors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: list of Advisor + :rtype: list[~azure.mgmt.sql.models.Advisor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) + + _request = build_server_advisors_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.Advisor], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ManagedDatabaseColumnsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_columns` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + **kwargs: Any + ) -> _models.DatabaseColumn: + """Get managed database column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :return: DatabaseColumn. The DatabaseColumn is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseColumn + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseColumn] = kwargs.pop("cls", None) + + _request = build_managed_database_columns_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseColumn, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_table( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseColumn"]: + """List managed database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_columns_list_by_table_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + schema: Optional[List[str]] = None, + table: Optional[List[str]] = None, + column: Optional[List[str]] = None, + order_by: Optional[List[str]] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseColumn"]: + """List managed database columns. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword schema: Default value is None. + :paramtype schema: list[str] + :keyword table: Default value is None. + :paramtype table: list[str] + :keyword column: Default value is None. + :paramtype column: list[str] + :keyword order_by: Default value is None. + :paramtype order_by: list[str] + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of DatabaseColumn + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseColumn]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_columns_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + schema=schema, + table=table, + column=column, + order_by=order_by, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseColumn], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_tables` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + table_name: str, + **kwargs: Any + ) -> _models.DatabaseTable: + """Get database table. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :return: DatabaseTable. The DatabaseTable is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) + + _request = build_database_tables_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseTable, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_schema( + self, + resource_group_name: str, + server_name: str, + database_name: str, + schema_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseTable"]: + """List database tables. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseTable + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseTable]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_tables_list_by_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseTable], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseTablesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_tables` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + **kwargs: Any + ) -> _models.DatabaseTable: + """Get managed database table. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :return: DatabaseTable. The DatabaseTable is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseTable + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseTable] = kwargs.pop("cls", None) + + _request = build_managed_database_tables_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseTable, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_schema( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseTable"]: + """List managed database tables. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseTable + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseTable] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseTable]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_tables_list_by_schema_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseTable], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_schemas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, schema_name: str, **kwargs: Any + ) -> _models.DatabaseSchema: + """Get database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :return: DatabaseSchema. The DatabaseSchema is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) + + _request = build_database_schemas_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSchema, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSchema"]: + """List database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseSchema + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSchema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_schemas_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSchema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseSchemasOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_schemas` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, schema_name: str, **kwargs: Any + ) -> _models.DatabaseSchema: + """Get managed database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :return: DatabaseSchema. The DatabaseSchema is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSchema + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSchema] = kwargs.pop("cls", None) + + _request = build_managed_database_schemas_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSchema, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSchema"]: + """List managed database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of DatabaseSchema + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSchema] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSchema]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_schemas_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSchema], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseSecurityAlertPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Gets a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_database_security_alert_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.DatabaseSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. 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: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.DatabaseSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Is one of the following types: + DatabaseSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or JSON or IO[bytes] + :return: DatabaseSecurityAlertPolicy. The DatabaseSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseSecurityAlertPolicy"]: + """Gets a list of database's security alert policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseSecurityAlertPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_security_alert_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentBaselineOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_baseline` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_baseline_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessment( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentBaselineSet + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes SQL Vulnerability Assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class SqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessments_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Gets SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessments_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.SqlVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.SqlVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Creates or updates SQL Vulnerability Assessment policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + SqlVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment or JSON or IO[bytes] + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessments_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessment"]: + """Lists SQL Vulnerability Assessment policies associated with a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of SqlVulnerabilityAssessment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessments_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Gets a database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or + JSON or IO[bytes] + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_sql_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_baseline( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentRuleBaseline + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentRuleBaselineOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_rule_baseline` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Gets a system database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_rule_baseline_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: JSON, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: IO[bytes], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Required. + :type parameters: IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes]], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or + JSON or IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline. The + DatabaseSqlVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessment_rule_baseline_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_baseline( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: + """Gets a system database's sql vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentRuleBaseline + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_rule_baseline_list_by_baseline_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_scan_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_id: str, + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanResults: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :param scan_result_id: The scan result id of the specific result to retrieve. Required. + :type scan_result_id: str + :return: SqlVulnerabilityAssessmentScanResults. The SqlVulnerabilityAssessmentScanResults is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_scan_result_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + scan_result_id=scan_result_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :return: An iterator like instance of SqlVulnerabilityAssessmentScanResults + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanResults]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessment_scan_result_list_by_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanResults], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_scan_result` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + scan_result_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanResults: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :param scan_result_id: The scan result id of the specific result to retrieve. Required. + :type scan_result_id: str + :keyword system_database_name: The SQL vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: SqlVulnerabilityAssessmentScanResults. The SqlVulnerabilityAssessmentScanResults is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_scan_result_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + scan_result_id=scan_result_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanResults, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_scan( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + scan_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. + Required. + :type scan_id: str + :keyword system_database_name: The SQL vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanResults + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanResults]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_scan_result_list_by_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanResults], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanRecord: + """Get a system database vulnerability assessment scan record. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: Required. + :type scan_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: SqlVulnerabilityAssessmentScanRecord. The SqlVulnerabilityAssessmentScanRecord is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessments( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Gets a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or JSON or + IO[bytes] + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Gets a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_rule_baselines_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: _models.DatabaseVulnerabilityAssessmentRuleBaseline, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + parameters: Union[_models.DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentRuleBaseline: + """Creates or updates a database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseVulnerabilityAssessmentRuleBaseline, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline or JSON or + IO[bytes] + :return: DatabaseVulnerabilityAssessmentRuleBaseline. The + DatabaseVulnerabilityAssessmentRuleBaseline is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentRuleBaseline + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_vulnerability_assessment_rule_baselines_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentRuleBaseline, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + rule_id: str, + baseline_name: Union[str, _models.VulnerabilityAssessmentPolicyBaselineName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment rule + baseline is defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule baseline (default implies a + baseline on a database level rule and master for server level rule). Known values are: "master" + and "default". Required. + :type baseline_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentPolicyBaselineName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + rule_id=rule_id, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Gets the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.DatabaseVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.DatabaseVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + DatabaseVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or JSON or IO[bytes] + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of DatabaseVulnerabilityAssessment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_vulnerability_assessments_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Gets the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.DatabaseVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.DatabaseVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessment: + """Creates or updates the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + DatabaseVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment or JSON or IO[bytes] + :return: DatabaseVulnerabilityAssessment. The DatabaseVulnerabilityAssessment is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseVulnerabilityAssessment"]: + """Lists the vulnerability assessments of a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database for which the vulnerability assessment is + defined. Required. + :type database_name: str + :return: An iterator like instance of DatabaseVulnerabilityAssessment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_vulnerability_assessments_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: VulnerabilityAssessmentScanRecord. The VulnerabilityAssessmentScanRecord is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of VulnerabilityAssessmentScanRecord + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_vulnerability_assessment_scans_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def export( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentScansExport: + """Convert an existing scan result to a human readable format. If already exists nothing happens. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: DatabaseVulnerabilityAssessmentScansExport. The + DatabaseVulnerabilityAssessmentScansExport is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_export_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentScansExport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _initiate_scan_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_database_vulnerability_assessment_scans_initiate_scan_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_initiate_scan( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> LROPoller[_models.VulnerabilityAssessmentScanRecord]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: An instance of LROPoller that returns VulnerabilityAssessmentScanRecord. The + VulnerabilityAssessmentScanRecord is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = 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._initiate_scan_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VulnerabilityAssessmentScanRecord].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VulnerabilityAssessmentScanRecord]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DataMaskingPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`data_masking_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Gets the database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + _request = build_data_masking_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: _models.DataMaskingPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. 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: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + parameters: Union[_models.DataMaskingPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DataMaskingPolicy: + """Creates or updates a database data masking policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param parameters: Parameters for creating or updating a data masking policy. Is one of the + following types: DataMaskingPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingPolicy or JSON or IO[bytes] + :return: DataMaskingPolicy. The DataMaskingPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_masking_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DeletedServersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`deleted_servers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> _models.DeletedServer: + """Gets a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: DeletedServer. The DeletedServer is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DeletedServer + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeletedServer] = kwargs.pop("cls", None) + + _request = build_deleted_servers_get_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DeletedServer, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: + """Gets a list of deleted servers for a location. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of DeletedServer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeletedServer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deleted_servers_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DeletedServer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _recover_initial(self, location_name: str, deleted_server_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_deleted_servers_recover_request( + location_name=location_name, + deleted_server_name=deleted_server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_recover( + self, location_name: str, deleted_server_name: str, **kwargs: Any + ) -> LROPoller[_models.DeletedServer]: + """Recovers a deleted server. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param deleted_server_name: The name of the deleted server. Required. + :type deleted_server_name: str + :return: An instance of LROPoller that returns DeletedServer. The DeletedServer is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DeletedServer] = 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._recover_initial( + location_name=location_name, + deleted_server_name=deleted_server_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DeletedServer, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.DeletedServer].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.DeletedServer]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.DeletedServer"]: + """Gets a list of all deleted servers in a subscription. + + :return: An iterator like instance of DeletedServer + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DeletedServer] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DeletedServer]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_deleted_servers_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DeletedServer], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DistributedAvailabilityGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`distributed_availability_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> _models.DistributedAvailabilityGroup: + """Gets a distributed availability group info. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 + :return: DistributedAvailabilityGroup. The DistributedAvailabilityGroup is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DistributedAvailabilityGroup] = kwargs.pop("cls", None) + + _request = build_distributed_availability_groups_get_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_create_or_update_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: _models.DistributedAvailabilityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + 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]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Is one of the following types: + DistributedAvailabilityGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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 _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_update_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: _models.DistributedAvailabilityGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup + :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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + 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]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.DistributedAvailabilityGroup]: + """Updates a distributed availability group replication mode. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 info. Is one of the following types: + DistributedAvailabilityGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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._update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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 _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_distributed_availability_groups_delete_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=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + distributed_availability_group_name=distributed_availability_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.DistributedAvailabilityGroup"]: + """Gets a list of a distributed availability groups in instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of DistributedAvailabilityGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DistributedAvailabilityGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_distributed_availability_groups_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DistributedAvailabilityGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + distributed_availability_group_name: str, + parameters: Union[_models.DistributedAvailabilityGroupsFailoverRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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, JSON, 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. The name is case insensitive. + 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 one of + the following types: DistributedAvailabilityGroupsFailoverRequest, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupsFailoverRequest or JSON + or IO[bytes] + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_distributed_availability_groups_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, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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: JSON, + *, + 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. The name is case insensitive. + 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: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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. The name is case insensitive. + 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 DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :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, JSON, 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. The name is case insensitive. + 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 one of + the following types: DistributedAvailabilityGroupSetRole, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DistributedAvailabilityGroupSetRole or JSON or + IO[bytes] + :return: An instance of LROPoller that returns DistributedAvailabilityGroup. The + DistributedAvailabilityGroup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.DistributedAvailabilityGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.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, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.DistributedAvailabilityGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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 + ) + + +class ManagedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> _models.ManagedDatabase: + """Gets a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: ManagedDatabase. The ManagedDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabase] = kwargs.pop("cls", None) + + _request = build_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabase, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabase + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabase, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Creates a new database or updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + ManagedDatabase, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabase or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Updates an existing database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested database resource state. Is one of the following types: + ManagedDatabaseUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_databases_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabase"]: + """Gets a list of managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _cancel_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_cancel_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_cancel_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Cancels a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the cancel managed database move operation. Is one of the + following types: ManagedDatabaseMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._cancel_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _complete_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_complete_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_complete_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the complete managed database move operation. Is one of the + following types: ManagedDatabaseMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseMoveDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._complete_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _complete_restore_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.CompleteDatabaseRestoreDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_complete_restore_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.CompleteDatabaseRestoreDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + Required. + :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. + 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_complete_restore( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.CompleteDatabaseRestoreDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Completes the restore operation on a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The definition for completing the restore of this managed database. Is one + of the following types: CompleteDatabaseRestoreDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CompleteDatabaseRestoreDefinition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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._complete_restore_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_databases_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Reevaluates the inaccessibility state of a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabase] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _start_move_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseStartMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_databases_start_move_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.ManagedDatabaseStartMoveDefinition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition + :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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. 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 ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_start_move( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.ManagedDatabaseStartMoveDefinition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedDatabase]: + """Starts a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Parameters of the start managed database move operation. Is one of the + following types: ManagedDatabaseStartMoveDefinition, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseStartMoveDefinition or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedDatabase. The ManagedDatabase is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabase] = 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_move_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedDatabase, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedDatabase].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedDatabase]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_inaccessible_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabase"]: + """Gets a list of inaccessible managed databases in a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_databases_list_inaccessible_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerTrustGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_trust_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> _models.ServerTrustGroup: + """Gets a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :return: ServerTrustGroup. The ServerTrustGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerTrustGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) + + _request = build_server_trust_groups_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerTrustGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: Union[_models.ServerTrustGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_trust_groups_create_or_update_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: _models.ServerTrustGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup + :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 ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group 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 ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + server_trust_group_name: str, + parameters: Union[_models.ServerTrustGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerTrustGroup]: + """Creates or updates a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :param parameters: The server trust group parameters. Is one of the following types: + ServerTrustGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerTrustGroup. The ServerTrustGroup is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerTrustGroup] = 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, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerTrustGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerTrustGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerTrustGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_trust_groups_delete_request( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param server_trust_group_name: The name of the server trust group. Required. + :type server_trust_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + location_name=location_name, + server_trust_group_name=server_trust_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerTrustGroup"]: + """Lists a server trust group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of ServerTrustGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_groups_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerTrustGroup"]: + """Gets a server trust groups by instance name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerTrustGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_groups_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstancesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instances` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> _models.ManagedInstance: + """Gets a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: ManagedInstance. The ManagedInstance is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstance + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = kwargs.pop("cls", None) + + _request = build_managed_instances_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstance, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstance, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstance, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstance + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstance, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Is one of the following + types: ManagedInstance, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstance or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Updates a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. Is one of the following + types: ManagedInstanceUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + def _delete_initial(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group( + self, resource_group_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstance"]: + """Gets a list of managed instances in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, *, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.ManagedInstance"]: + """Gets a list of all managed instances in the subscription. + + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_request( + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, + resource_group_name: str, + managed_instance_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_failover_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + replica_type=replica_type, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, + resource_group_name: str, + managed_instance_name: str, + *, + replica_type: Optional[Union[str, _models.ReplicaType]] = None, + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Failovers a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword replica_type: The type of replica to be failed over. Known values are: "Primary" and + "ReadableSecondary". Default value is None. + :paramtype replica_type: str or ~azure.mgmt.sql.models.ReplicaType + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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, + replica_type=replica_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_outbound_network_dependencies_by_managed_instance( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.OutboundEnvironmentEndpoint"]: + """Gets the collection of outbound network dependencies for the given managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of OutboundEnvironmentEndpoint + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundEnvironmentEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundEnvironmentEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_outbound_network_dependencies_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundEnvironmentEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _reevaluate_inaccessible_database_state_initial( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_reevaluate_inaccessible_database_state_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reevaluate_inaccessible_database_state( # pylint: disable=name-too-long + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Reevaluates the inaccessibility state of all managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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._reevaluate_inaccessible_database_state_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + def _refresh_status_initial( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_refresh_status_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_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. The name is case insensitive. + 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 + RefreshExternalGovernanceStatusOperationResultMI. The + RefreshExternalGovernanceStatusOperationResultMI is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResultMI] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.RefreshExternalGovernanceStatusOperationResultMI, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.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(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_start_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_start( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Starts the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + def _stop_initial(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instances_stop_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_stop( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Stops the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstance] = 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( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_by_managed_instance( + self, + resource_group_name: str, + managed_instance_name: str, + *, + number_of_queries: Optional[int] = None, + databases: Optional[str] = None, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + aggregation_function: Optional[Union[str, _models.AggregationFunctionType]] = None, + observation_metric: Optional[Union[str, _models.MetricType]] = None, + **kwargs: Any + ) -> ItemPaged["_models.TopQueries"]: + """Get top resource consuming queries of a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword number_of_queries: How many 'top queries' to return. Default is 5. Default value is + None. + :paramtype number_of_queries: int + :keyword databases: Comma separated list of databases to be included into search. All DB's are + included if this parameter is not specified. Default value is None. + :paramtype databases: str + :keyword start_time: Start time for observed period. Default value is None. + :paramtype start_time: str + :keyword end_time: End time for observed period. Default value is None. + :paramtype end_time: str + :keyword interval: The time step to be used to summarize the metric values. Default value is + PT1H. Known values are: "PT1H" and "P1D". Default value is None. + :paramtype interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :keyword aggregation_function: Aggregation function to be used, default value is 'sum'. Known + values are: "avg", "min", "max", "stdev", and "sum". Default value is None. + :paramtype aggregation_function: str or ~azure.mgmt.sql.models.AggregationFunctionType + :keyword observation_metric: Metric to be used for ranking top queries. Default is 'cpu'. Known + values are: "cpu", "io", "logIo", "duration", and "dtu". Default value is None. + :paramtype observation_metric: str or ~azure.mgmt.sql.models.MetricType + :return: An iterator like instance of TopQueries + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TopQueries] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TopQueries]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + number_of_queries=number_of_queries, + databases=databases, + start_time=start_time, + end_time=end_time, + interval=interval, + aggregation_function=aggregation_function, + observation_metric=observation_metric, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TopQueries], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _validate_azure_key_vault_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instances_validate_azure_key_vault_encryption_key_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_validate_azure_key_vault_encryption_key( # pylint: disable=name-too-long + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Validates customer managed key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The validate azure key vault encryption key parameters. Is one of the + following types: ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest, JSON, IO[bytes] + Required. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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._validate_azure_key_vault_encryption_key_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + @distributed_trace + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, *, expand: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstance"]: + """Gets a list of all managed instances in an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: An iterator like instance of ManagedInstance + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstance]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instances_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstance], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ElasticPoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`elastic_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> _models.ElasticPool: + """Gets an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: ElasticPool. The ElasticPool is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ElasticPool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ElasticPool] = kwargs.pop("cls", None) + + _request = build_elastic_pools_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ElasticPool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPool, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_elastic_pools_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: _models.ElasticPool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPool + :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 ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool 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 ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPool, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Creates or updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool parameters. Is one of the following types: ElasticPool, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPool or JSON or IO[bytes] + :return: An instance of LROPoller that returns ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ElasticPool] = 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, + elastic_pool_name=elastic_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_elastic_pools_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: _models.ElasticPoolUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate + :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 ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update 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 ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + elastic_pool_name: str, + parameters: Union[_models.ElasticPoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Updates an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param parameters: The elastic pool update parameters. Is one of the following types: + ElasticPoolUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ElasticPool] = 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, + elastic_pool_name=elastic_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_elastic_pools_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, *, skip: Optional[int] = None, **kwargs: Any + ) -> ItemPaged["_models.ElasticPool"]: + """Gets all elastic pools in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of ElasticPool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ElasticPool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_elastic_pools_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ElasticPool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_elastic_pools_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> LROPoller[_models.ElasticPool]: + """Failovers an elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An instance of LROPoller that returns ElasticPool. The ElasticPool is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ElasticPool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ElasticPool] = 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, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ElasticPool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ElasticPool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ElasticPool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class EncryptionProtectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> _models.EncryptionProtector: + """Gets a server encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: EncryptionProtector. The EncryptionProtector is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.EncryptionProtector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EncryptionProtector] = kwargs.pop("cls", None) + + _request = build_encryption_protectors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EncryptionProtector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.EncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_encryption_protectors_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: _models.EncryptionProtector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: ~azure.mgmt.sql.models.EncryptionProtector + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.EncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Is one of the following + types: EncryptionProtector, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.EncryptionProtector or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.EncryptionProtector"]: + """Gets a list of server encryption protectors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of EncryptionProtector + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.EncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EncryptionProtector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_encryption_protectors_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EncryptionProtector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _revalidate_initial( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_revalidate( + self, + resource_group_name: str, + server_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> LROPoller[_models.EncryptionProtector]: + """Revalidates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of LROPoller that returns EncryptionProtector. The EncryptionProtector is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.EncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EncryptionProtector] = 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._revalidate_initial( + resource_group_name=resource_group_name, + server_name=server_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.EncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.EncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.EncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class EndpointCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`endpoint_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, endpoint_type: str, **kwargs: Any + ) -> _models.EndpointCertificate: + """Gets a certificate used on the endpoint with the given id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param endpoint_type: Type of the endpoint whose certificate the customer is looking for. + Required. + :type endpoint_type: str + :return: EndpointCertificate. The EndpointCertificate is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.EndpointCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.EndpointCertificate] = kwargs.pop("cls", None) + + _request = build_endpoint_certificates_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + endpoint_type=endpoint_type, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.EndpointCertificate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.EndpointCertificate"]: + """List certificates used on endpoints on the target instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of EndpointCertificate + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.EndpointCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.EndpointCertificate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_endpoint_certificates_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.EndpointCertificate], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class FailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`failover_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.FailoverGroup: + """Gets a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: FailoverGroup. The FailoverGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.FailoverGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.FailoverGroup] = kwargs.pop("cls", None) + + _request = build_failover_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.FailoverGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: _models.FailoverGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroup + :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 FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: FailoverGroup, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FailoverGroup] = 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, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_failover_groups_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: _models.FailoverGroupUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate + :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 FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + failover_group_name: str, + parameters: Union[_models.FailoverGroupUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: + FailoverGroupUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.FailoverGroupUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.FailoverGroup] = 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, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.FailoverGroup"]: + """Lists the failover groups in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of FailoverGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.FailoverGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_failover_groups_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.FailoverGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + 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, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_force_failover_allow_data_loss( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation might result in data + loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + 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 + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_failover_groups_try_planned_before_forced_failover_request( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_try_planned_before_forced_failover( + self, resource_group_name: str, server_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.FailoverGroup]: + """Fails over from the current primary server to this server. This operation tries planned before + forced failover but might still result in data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns FailoverGroup. The FailoverGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.FailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + 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) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._try_planned_before_forced_failover_initial( + resource_group_name=resource_group_name, + server_name=server_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.FailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.FailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.FailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class GeoBackupPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`geo_backup_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Gets a Geo backup policy for the given database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + _request = build_geo_backup_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GeoBackupPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: _models.GeoBackupPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + Required. + :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. + 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: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + geo_backup_policy_name: Union[str, _models.GeoBackupPolicyName], + parameters: Union[_models.GeoBackupPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.GeoBackupPolicy: + """Create or update a database default Geo backup policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param geo_backup_policy_name: The name of the Geo backup policy. This should always be + 'Default'. "Default" Required. + :type geo_backup_policy_name: str or ~azure.mgmt.sql.models.GeoBackupPolicyName + :param parameters: The required parameters for creating or updating the geo backup policy. Is + one of the following types: GeoBackupPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.GeoBackupPolicy or JSON or IO[bytes] + :return: GeoBackupPolicy. The GeoBackupPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.GeoBackupPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_geo_backup_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + geo_backup_policy_name=geo_backup_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.GeoBackupPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.GeoBackupPolicy"]: + """Gets a list of Geo backup policies for the given database resource. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of GeoBackupPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.GeoBackupPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.GeoBackupPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_geo_backup_policies_list_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.GeoBackupPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class InstanceFailoverGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`instance_failover_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> _models.InstanceFailoverGroup: + """Gets a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: InstanceFailoverGroup. The InstanceFailoverGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: Union[_models.InstanceFailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_failover_groups_create_or_update_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: _models.InstanceFailoverGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup + :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 InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group 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 InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + location_name: str, + failover_group_name: str, + parameters: Union[_models.InstanceFailoverGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :param parameters: The failover group parameters. Is one of the following types: + InstanceFailoverGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstanceFailoverGroup] = 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, + location_name=location_name, + failover_group_name=failover_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_delete_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a failover group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_location( + self, resource_group_name: str, location_name: str, **kwargs: Any + ) -> ItemPaged["_models.InstanceFailoverGroup"]: + """Lists the failover groups in a location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of InstanceFailoverGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstanceFailoverGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_failover_groups_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstanceFailoverGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _failover_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_failover_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_failover( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Fails over from the current primary managed instance to this managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = 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, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _force_failover_allow_data_loss_initial( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_failover_groups_force_failover_allow_data_loss_request( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_force_failover_allow_data_loss( + self, resource_group_name: str, location_name: str, failover_group_name: str, **kwargs: Any + ) -> LROPoller[_models.InstanceFailoverGroup]: + """Fails over from the current primary managed instance to this managed instance. This operation + might result in data loss. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param failover_group_name: The name of the failover group. Required. + :type failover_group_name: str + :return: An instance of LROPoller that returns InstanceFailoverGroup. The InstanceFailoverGroup + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstanceFailoverGroup] = 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._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstanceFailoverGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InstanceFailoverGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InstanceFailoverGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class InstancePoolOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`instance_pool_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, instance_pool_name: str, operation_id: str, **kwargs: Any + ) -> _models.InstancePoolOperation: + """Gets a management operation on a instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param operation_id: Required. + :type operation_id: str + :return: InstancePoolOperation. The InstancePoolOperation is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstancePoolOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstancePoolOperation] = kwargs.pop("cls", None) + + _request = build_instance_pool_operations_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstancePoolOperation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance_pool( + self, resource_group_name: str, instance_pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.InstancePoolOperation"]: + """Gets a list of operations performed on the instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: An iterator like instance of InstancePoolOperation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePoolOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePoolOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pool_operations_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePoolOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class InstancePoolsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`instance_pools` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> _models.InstancePool: + """Gets an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: InstancePool. The InstancePool is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.InstancePool + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.InstancePool] = kwargs.pop("cls", None) + + _request = build_instance_pools_get_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.InstancePool, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePool, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_pools_create_or_update_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: _models.InstancePool, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: ~azure.mgmt.sql.models.InstancePool + :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 InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. 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 InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePool, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Creates or updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Is one of the following types: + InstancePool, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstancePool or JSON or IO[bytes] + :return: An instance of LROPoller that returns InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstancePool] = 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, + instance_pool_name=instance_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstancePool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InstancePool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InstancePool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_instance_pools_update_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: _models.InstancePoolUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate + :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 InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. 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 InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + instance_pool_name: str, + parameters: Union[_models.InstancePoolUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.InstancePool]: + """Updates an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. Is one of the following types: + InstancePoolUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.InstancePoolUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns InstancePool. The InstancePool is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.InstancePool] = 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, + instance_pool_name=instance_pool_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.InstancePool, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.InstancePool].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.InstancePool]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_instance_pools_delete_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, instance_pool_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes an instance pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.InstancePool"]: + """Gets a list of instance pools in the resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of InstancePool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pools_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.InstancePool"]: + """Gets a list of all instance pools in the subscription. + + :return: An iterator like instance of InstancePool + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.InstancePool] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.InstancePool]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_instance_pools_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.InstancePool], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class IPv6FirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`ipv6_firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Gets an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) + + _request = build_ipv6_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IPv6FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: _models.IPv6FirewallRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + Required. + :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. + 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: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + firewall_rule_name: str, + parameters: Union[_models.IPv6FirewallRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.IPv6FirewallRule: + """Creates or updates an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating an IPv6 firewall rule. Is + one of the following types: IPv6FirewallRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.IPv6FirewallRule or JSON or IO[bytes] + :return: IPv6FirewallRule. The IPv6FirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.IPv6FirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.IPv6FirewallRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ipv6_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.IPv6FirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, firewall_rule_name: str, **kwargs: Any + ) -> None: + """Deletes an IPv6 firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param firewall_rule_name: The name of the firewall rule. Required. + :type firewall_rule_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_ipv6_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + firewall_rule_name=firewall_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.IPv6FirewallRule"]: + """Gets a list of IPv6 firewall rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of IPv6FirewallRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.IPv6FirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.IPv6FirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ipv6_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.IPv6FirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_executions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Creates or updates a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: An instance of LROPoller that returns JobExecution. The JobExecution is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = 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, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobExecution, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + **kwargs: Any + ) -> None: + """Requests cancellation of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_executions_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_job( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists a job's executions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_executions_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_agent( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists all executions in a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_executions_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _create_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_executions_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> LROPoller[_models.JobExecution]: + """Starts an elastic job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: An instance of LROPoller that returns JobExecution. The JobExecution is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.JobExecution, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobExecution].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobExecution]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class JobAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_agents` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any) -> _models.JobAgent: + """Gets a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: JobAgent. The JobAgent is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobAgent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobAgent] = kwargs.pop("cls", None) + + _request = build_job_agents_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobAgent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_agents_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: _models.JobAgent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Required. + :type parameters: ~azure.mgmt.sql.models.JobAgent + :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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. 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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Creates or updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The requested job agent resource state. Is one of the following types: + JobAgent, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobAgent or JSON or IO[bytes] + :return: An instance of LROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobAgent] = 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, + job_agent_name=job_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgentUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_agents_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: _models.JobAgentUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Required. + :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate + :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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. 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 JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + parameters: Union[_models.JobAgentUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JobAgent]: + """Updates a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param parameters: The update to the job agent. Is one of the following types: JobAgentUpdate, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobAgentUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns JobAgent. The JobAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobAgent] = 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, + job_agent_name=job_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_agents_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a job agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobAgent"]: + """Gets a list of job agents in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of JobAgent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobAgent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_agents_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobAgent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobCredentialsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_credentials` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any + ) -> _models.JobCredential: + """Gets a jobs credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) + + _request = build_job_credentials_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: _models.JobCredential, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Required. + :type parameters: ~azure.mgmt.sql.models.JobCredential + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. 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: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + credential_name: str, + parameters: Union[_models.JobCredential, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobCredential: + """Creates or updates a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :param parameters: The requested job credential state. Is one of the following types: + JobCredential, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobCredential or JSON or IO[bytes] + :return: JobCredential. The JobCredential is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobCredential + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobCredential] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_credentials_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobCredential, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, job_agent_name: str, credential_name: str, **kwargs: Any + ) -> None: + """Deletes a job credential. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param credential_name: The name of the credential. Required. + :type credential_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_credentials_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + credential_name=credential_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobCredential"]: + """Gets a list of jobs credentials. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobCredential + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobCredential] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobCredential]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_credentials_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobCredential], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobStepExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_step_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a step execution of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_step_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists the step executions of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_step_executions_list_by_job_execution_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobTargetExecutionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_target_executions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + target_id: str, + **kwargs: Any + ) -> _models.JobExecution: + """Gets a target execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :param target_id: The target id. Required. + :type target_id: str + :return: JobExecution. The JobExecution is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobExecution + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobExecution] = kwargs.pop("cls", None) + + _request = build_job_target_executions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + target_id=target_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobExecution, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_step( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + step_name: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists the target executions of a job step execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param job_execution_id: The unique id of the job execution. Required. + :type job_execution_id: str + :param step_name: The name of the step. Required. + :type step_name: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_executions_list_by_step_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + step_name=step_name, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_job_execution( # pylint: disable=too-many-locals + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_execution_id: str, + *, + create_time_min: Optional[datetime.datetime] = None, + create_time_max: Optional[datetime.datetime] = None, + end_time_min: Optional[datetime.datetime] = None, + end_time_max: Optional[datetime.datetime] = None, + is_active: Optional[bool] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.JobExecution"]: + """Lists target executions for all steps of a job execution. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_execution_id: The id of the job execution. Required. + :type job_execution_id: str + :keyword create_time_min: If specified, only job executions created at or after the specified + time are included. Default value is None. + :paramtype create_time_min: ~datetime.datetime + :keyword create_time_max: If specified, only job executions created before the specified time + are included. Default value is None. + :paramtype create_time_max: ~datetime.datetime + :keyword end_time_min: If specified, only job executions completed at or after the specified + time are included. Default value is None. + :paramtype end_time_min: ~datetime.datetime + :keyword end_time_max: If specified, only job executions completed before the specified time + are included. Default value is None. + :paramtype end_time_max: ~datetime.datetime + :keyword is_active: If specified, only active or only completed job executions are included. + Default value is None. + :paramtype is_active: bool + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :return: An iterator like instance of JobExecution + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobExecution] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobExecution]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_executions_list_by_job_execution_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_execution_id=job_execution_id, + subscription_id=self._config.subscription_id, + create_time_min=create_time_min, + create_time_max=create_time_max, + end_time_min=end_time_min, + end_time_max=end_time_max, + is_active=is_active, + skip=skip, + top=top, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobExecution], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`jobs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> _models.Job: + """Gets a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Job] = kwargs.pop("cls", None) + + _request = build_jobs_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Job, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: _models.Job, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Required. + :type parameters: ~azure.mgmt.sql.models.Job + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. 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: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + parameters: Union[_models.Job, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Job: + """Creates or updates a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :param parameters: The requested job state. Is one of the following types: Job, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.Job or JSON or IO[bytes] + :return: Job. The Job is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Job + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Job] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_jobs_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Job, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> None: + """Deletes a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_jobs_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> ItemPaged["_models.Job"]: + """Gets a list of jobs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of Job + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Job] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Job]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_jobs_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Job], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobPrivateEndpointsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_private_endpoints` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> _models.JobPrivateEndpoint: + """Gets a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :return: JobPrivateEndpoint. The JobPrivateEndpoint is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobPrivateEndpoint + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobPrivateEndpoint] = kwargs.pop("cls", None) + + _request = build_job_private_endpoints_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobPrivateEndpoint, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: Union[_models.JobPrivateEndpoint, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_private_endpoints_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: _models.JobPrivateEndpoint, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Required. + :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint + :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 JobPrivateEndpoint. The JobPrivateEndpoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns JobPrivateEndpoint. The JobPrivateEndpoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. 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 JobPrivateEndpoint. The JobPrivateEndpoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + private_endpoint_name: str, + parameters: Union[_models.JobPrivateEndpoint, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.JobPrivateEndpoint]: + """Creates or updates a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :param parameters: The requested private endpoint state. Is one of the following types: + JobPrivateEndpoint, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobPrivateEndpoint or JSON or IO[bytes] + :return: An instance of LROPoller that returns JobPrivateEndpoint. The JobPrivateEndpoint is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobPrivateEndpoint] = 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, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.JobPrivateEndpoint, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.JobPrivateEndpoint].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.JobPrivateEndpoint]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_job_private_endpoints_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, job_agent_name: str, private_endpoint_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param private_endpoint_name: The name of the private endpoint to get. Required. + :type private_endpoint_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + private_endpoint_name=private_endpoint_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobPrivateEndpoint"]: + """Gets a list of job agent private endpoints. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobPrivateEndpoint + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobPrivateEndpoint] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobPrivateEndpoint]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_private_endpoints_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobPrivateEndpoint], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobStepsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_steps` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets a job step in a job's current version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_job_steps_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: _models.JobStep, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Required. + :type parameters: ~azure.mgmt.sql.models.JobStep + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. 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: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + parameters: Union[_models.JobStep, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobStep: + """Creates or updates a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :param parameters: The requested state of the job step. Is one of the following types: JobStep, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobStep or JSON or IO[bytes] + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_steps_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + step_name: str, + **kwargs: Any + ) -> None: + """Deletes a job step. This will implicitly create a new job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param step_name: The name of the job step. Required. + :type step_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_steps_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_job( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobStep"]: + """Gets all job steps for a job's current version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :return: An iterator like instance of JobStep + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobStep]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_steps_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobStep], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + step_name: str, + **kwargs: Any + ) -> _models.JobStep: + """Gets the specified version of a job step. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :param step_name: The name of the job step. Required. + :type step_name: str + :return: JobStep. The JobStep is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobStep + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobStep] = kwargs.pop("cls", None) + + _request = build_job_steps_get_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + step_name=step_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobStep, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_version( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> ItemPaged["_models.JobStep"]: + """Gets all job steps in the specified job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: An iterator like instance of JobStep + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobStep] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobStep]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_steps_list_by_version_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobStep], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobTargetGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_target_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any + ) -> _models.JobTargetGroup: + """Gets a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) + + _request = build_job_target_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobTargetGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: _models.JobTargetGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Required. + :type parameters: ~azure.mgmt.sql.models.JobTargetGroup + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. 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: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + target_group_name: str, + parameters: Union[_models.JobTargetGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.JobTargetGroup: + """Creates or updates a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :param parameters: The requested state of the target group. Is one of the following types: + JobTargetGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.JobTargetGroup or JSON or IO[bytes] + :return: JobTargetGroup. The JobTargetGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobTargetGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.JobTargetGroup] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_job_target_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobTargetGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, job_agent_name: str, target_group_name: str, **kwargs: Any + ) -> None: + """Deletes a target group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param target_group_name: The name of the target group. Required. + :type target_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_job_target_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + target_group_name=target_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_agent( + self, resource_group_name: str, server_name: str, job_agent_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobTargetGroup"]: + """Gets all target groups in an agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :return: An iterator like instance of JobTargetGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobTargetGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobTargetGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_target_groups_list_by_agent_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobTargetGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class JobVersionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`job_versions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + job_agent_name: str, + job_name: str, + job_version: int, + **kwargs: Any + ) -> _models.JobVersion: + """Gets a job version. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent. Required. + :type job_agent_name: str + :param job_name: The name of the job. Required. + :type job_name: str + :param job_version: The version of the job to get. Required. + :type job_version: int + :return: JobVersion. The JobVersion is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.JobVersion + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.JobVersion] = kwargs.pop("cls", None) + + _request = build_job_versions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + job_version=job_version, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.JobVersion, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_job( + self, resource_group_name: str, server_name: str, job_agent_name: str, job_name: str, **kwargs: Any + ) -> ItemPaged["_models.JobVersion"]: + """Gets all versions of a job. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param job_agent_name: The name of the job agent to be retrieved. Required. + :type job_agent_name: str + :param job_name: The name of the job to get. Required. + :type job_name: str + :return: An iterator like instance of JobVersion + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.JobVersion] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.JobVersion]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_job_versions_list_by_job_request( + resource_group_name=resource_group_name, + server_name=server_name, + job_agent_name=job_agent_name, + job_name=job_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.JobVersion], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LongTermRetentionBackupsOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`long_term_retention_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.LongTermRetentionBackup: + """Gets a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: LongTermRetentionBackup. The LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_get_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_delete_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists all long term retention backups for a database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_database_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _change_access_tier_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_change_access_tier_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters + :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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: 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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_change_access_tier( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Is one of the following types: + ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or + JSON or IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _copy_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_copy_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.CopyLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_copy( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Is one of the + following types: CopyLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _lock_time_based_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_lock_time_based_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_lock_time_based_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Lock time based immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _remove_legal_hold_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_legal_hold_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_remove_legal_hold_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Remove legal hold immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _remove_time_based_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_time_based_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_remove_time_based_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Remove time based immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_legal_hold_immutability_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_set_legal_hold_immutability_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_set_legal_hold_immutability( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Set legal hold immutability of an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_update_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.UpdateLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Is one of the following types: + UpdateLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def get_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.LongTermRetentionBackup: + """Gets a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: LongTermRetentionBackup. The LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_get_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_delete_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group_database( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists all long term retention backups for a database based on a particular resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_database_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _change_access_tier_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_change_access_tier_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.ChangeLongTermRetentionBackupAccessTierParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters + :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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: 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 LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_change_access_tier_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Change a long term retention backup access tier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: Is one of the following types: + ChangeLongTermRetentionBackupAccessTierParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ChangeLongTermRetentionBackupAccessTierParameters or + JSON or IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackup] = 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._change_access_tier_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _copy_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_copy_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.CopyLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_copy_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.CopyLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy request. Is one of the + following types: CopyLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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._copy_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _lock_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_lock_time_based_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_lock_time_based_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Lock time based immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._lock_time_based_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _remove_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_legal_hold_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_remove_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Remove legal hold immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_legal_hold_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _remove_time_based_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_remove_time_based_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_remove_time_based_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Remove time based immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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._remove_time_based_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _set_legal_hold_immutability_by_resource_group_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_backups_set_legal_hold_immutability_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_set_legal_hold_immutability_by_resource_group( # pylint: disable=name-too-long + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackup]: + """Set legal hold immutability of an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns LongTermRetentionBackup. The + LongTermRetentionBackup is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionBackup] = 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_legal_hold_immutability_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_backups_update_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: _models.UpdateLongTermRetentionBackupParameters, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters + :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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. 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 LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update_by_resource_group( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + long_term_retention_database_name: str, + backup_name: str, + parameters: Union[_models.UpdateLongTermRetentionBackupParameters, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LongTermRetentionBackupOperationResult]: + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database. Required. + :type long_term_retention_database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :param parameters: The requested backup resource state. Is one of the following types: + UpdateLongTermRetentionBackupParameters, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.UpdateLongTermRetentionBackupParameters or JSON or + IO[bytes] + :return: An instance of LROPoller that returns LongTermRetentionBackupOperationResult. The + LongTermRetentionBackupOperationResult is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LongTermRetentionBackupOperationResult] = 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_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LongTermRetentionBackupOperationResult, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LongTermRetentionBackupOperationResult].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LongTermRetentionBackupOperationResult]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_location( + self, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_server( + self, + location_name: str, + long_term_retention_server_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given server. + + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_server_request( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given location based on resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_server( + self, + resource_group_name: str, + location_name: str, + long_term_retention_server_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionBackup"]: + """Lists the long term retention backups for a given server based on resource groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param long_term_retention_server_name: The name of the server. Required. + :type long_term_retention_server_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of LongTermRetentionBackup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_backups_list_by_resource_group_server_request( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LongTermRetentionManagedInstanceBackupsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`long_term_retention_managed_instance_backups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get_by_resource_group( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionBackup: + """Gets a long term retention backup for a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: ManagedInstanceLongTermRetentionBackup. The ManagedInstanceLongTermRetentionBackup is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_get_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_by_resource_group_initial( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_delete_by_resource_group_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete_by_resource_group( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + backup_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a long term retention backup. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group_database( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_database_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionBackup: + """Gets a long term retention backup for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: ManagedInstanceLongTermRetentionBackup. The ManagedInstanceLongTermRetentionBackup is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionBackup] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_get_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionBackup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _delete_initial( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_long_term_retention_managed_instance_backups_delete_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, location_name: str, managed_instance_name: str, database_name: str, backup_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a long term retention backup. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :param backup_name: The backup name. Required. + :type backup_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + backup_name=backup_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, + location_name: str, + managed_instance_name: str, + database_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists all long term retention backups for a managed database. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the managed database. Required. + :type database_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_database_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_location( + self, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_instance( + self, + location_name: str, + managed_instance_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for a given managed instance. + + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_instance_request( + location_name=location_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for managed databases in a given location. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + skip=skip, + top=top, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_resource_group_instance( + self, + resource_group_name: str, + location_name: str, + managed_instance_name: str, + *, + only_latest_per_database: Optional[bool] = None, + database_state: Optional[Union[str, _models.DatabaseState]] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionBackup"]: + """Lists the long term retention backups for a given managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The location of the database. Required. + :type location_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword only_latest_per_database: Whether or not to only get the latest backup for each + database. Default value is None. + :paramtype only_latest_per_database: bool + :keyword database_state: Whether to query against just live databases, just deleted databases, + or all databases. Known values are: "All", "Live", and "Deleted". Default value is None. + :paramtype database_state: str or ~azure.mgmt.sql.models.DatabaseState + :return: An iterator like instance of ManagedInstanceLongTermRetentionBackup + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionBackup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionBackup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_managed_instance_backups_list_by_resource_group_instance_request( + resource_group_name=resource_group_name, + location_name=location_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + database_state=database_state, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionBackup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LongTermRetentionPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`long_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + **kwargs: Any + ) -> _models.LongTermRetentionPolicy: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :return: LongTermRetentionPolicy. The LongTermRetentionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LongTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_long_term_retention_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LongTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: Union[_models.LongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_long_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: _models.LongTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + policy_name: Union[str, _models.LongTermRetentionPolicyName], + parameters: Union[_models.LongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Set or update a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.LongTermRetentionPolicyName + :param parameters: The long term retention policy info. Is one of the following types: + LongTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.LongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LongTermRetentionPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LongTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LongTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_long_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LongTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedBackupShortTermRetentionPolicy: + """Gets a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :return: ManagedBackupShortTermRetentionPolicy. The ManagedBackupShortTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Updates a managed database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedBackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a managed database's short term retention policy list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedBackupShortTermRetentionPolicy + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_backup_short_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedBackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_restorable_dropped_database_backup_short_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedBackupShortTermRetentionPolicy: + """Gets a dropped database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :return: ManagedBackupShortTermRetentionPolicy. The ManagedBackupShortTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = ( + build_managed_restorable_dropped_database_backup_short_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: _models.ManagedBackupShortTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy + :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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. 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 ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + managed_instance_name: str, + restorable_dropped_database_id: str, + policy_name: Union[str, _models.ManagedShortTermRetentionPolicyName], + parameters: Union[_models.ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedBackupShortTermRetentionPolicy]: + """Sets a database's short term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :param policy_name: The policy name. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedShortTermRetentionPolicyName + :param parameters: The short term retention policy info. Is one of the following types: + ManagedBackupShortTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedBackupShortTermRetentionPolicy. The + ManagedBackupShortTermRetentionPolicy is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedBackupShortTermRetentionPolicy] = 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, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedBackupShortTermRetentionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedBackupShortTermRetentionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedBackupShortTermRetentionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_restorable_dropped_database( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedBackupShortTermRetentionPolicy"]: + """Gets a dropped database's short term retention policy list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: An iterator like instance of ManagedBackupShortTermRetentionPolicy + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedBackupShortTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedBackupShortTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedBackupShortTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseSecurityAlertPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Gets a managed database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_managed_database_security_alert_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ManagedDatabaseSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. 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: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedDatabaseSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedDatabaseSecurityAlertPolicy: + """Creates or updates a database's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The database security alert policy. Is one of the following types: + ManagedDatabaseSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy or JSON or + IO[bytes] + :return: ManagedDatabaseSecurityAlertPolicy. The ManagedDatabaseSecurityAlertPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseSecurityAlertPolicy] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabaseSecurityAlertPolicy"]: + """Gets a list of managed database's security alert policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedDatabaseSecurityAlertPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_security_alert_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceAdministratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> _models.ManagedInstanceAdministrator: + """Gets a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: ManagedInstanceAdministrator. The ManagedInstanceAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAdministrator] = kwargs.pop("cls", None) + + _request = build_managed_instance_administrators_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ManagedInstanceAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_administrators_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: _models.ManagedInstanceAdministrator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator + :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 ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator 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 ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ManagedInstanceAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdministrator]: + """Creates or updates a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested administrator parameters. Is one of the following types: + ManagedInstanceAdministrator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdministrator or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceAdministrator. The + ManagedInstanceAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAdministrator] = 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, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAdministrator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_administrators_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed instance administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param administrator_name: "ActiveDirectory" Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + administrator_name=administrator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceAdministrator"]: + """Gets a list of managed instance administrators. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAdministrator + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAdministrator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_administrators_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAdministrator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_azure_ad_only_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> _models.ManagedInstanceAzureADOnlyAuthentication: + """Gets a specific Azure Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: ManagedInstanceAzureADOnlyAuthentication. The ManagedInstanceAzureADOnlyAuthentication + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = kwargs.pop("cls", None) + + _request = build_managed_instance_azure_ad_only_authentications_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAzureADOnlyAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_azure_ad_only_authentications_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: _models.ManagedInstanceAzureADOnlyAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication + :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 ManagedInstanceAzureADOnlyAuthentication. The + ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceAzureADOnlyAuthentication. The + ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. 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 ManagedInstanceAzureADOnlyAuthentication. The + ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Is one of the following types: + ManagedInstanceAzureADOnlyAuthentication, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceAzureADOnlyAuthentication. The + ManagedInstanceAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAzureADOnlyAuthentication] = 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, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAzureADOnlyAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceAzureADOnlyAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_azure_ad_only_authentications_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an existing server Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + authentication_name=authentication_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAzureADOnlyAuthentication + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAzureADOnlyAuthentication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_azure_ad_only_authentications_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAzureADOnlyAuthentication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceDtcsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_dtcs` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, dtc_name: Union[str, _models.DtcName], **kwargs: Any + ) -> _models.ManagedInstanceDtc: + """Gets managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :return: ManagedInstanceDtc. The ManagedInstanceDtc is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceDtc + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceDtc] = kwargs.pop("cls", None) + + _request = build_managed_instance_dtcs_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceDtc, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: Union[_models.ManagedInstanceDtc, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_dtcs_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: _models.ManagedInstanceDtc, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc + :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 ManagedInstanceDtc. The ManagedInstanceDtc is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceDtc. The ManagedInstanceDtc is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. 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 ManagedInstanceDtc. The ManagedInstanceDtc is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dtc_name: Union[str, _models.DtcName], + parameters: Union[_models.ManagedInstanceDtc, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceDtc]: + """Updates managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dtc_name: The name of the managed instance DTC. "current" Required. + :type dtc_name: str or ~azure.mgmt.sql.models.DtcName + :param parameters: Managed instance DTC settings. Is one of the following types: + ManagedInstanceDtc, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceDtc or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceDtc. The ManagedInstanceDtc is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceDtc] = 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, + managed_instance_name=managed_instance_name, + dtc_name=dtc_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.ManagedInstanceDtc, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceDtc].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceDtc]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceDtc"]: + """Gets a list of managed instance DTC settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceDtc + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceDtc] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceDtc]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_dtcs_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceDtc], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceEncryptionProtectorsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> _models.ManagedInstanceEncryptionProtector: + """Gets a managed instance encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: ManagedInstanceEncryptionProtector. The ManagedInstanceEncryptionProtector is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = kwargs.pop("cls", None) + + _request = build_managed_instance_encryption_protectors_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.ManagedInstanceEncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_encryption_protectors_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: _models.ManagedInstanceEncryptionProtector, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector + :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 ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. 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 ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + parameters: Union[_models.ManagedInstanceEncryptionProtector, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :param parameters: The requested encryption protector resource state. Is one of the following + types: ManagedInstanceEncryptionProtector, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceEncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceEncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceEncryptionProtector"]: + """Gets a list of managed instance encryption protectors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceEncryptionProtector + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceEncryptionProtector]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_encryption_protectors_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceEncryptionProtector], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _revalidate_initial( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_revalidate( + self, + resource_group_name: str, + managed_instance_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceEncryptionProtector]: + """Revalidates an existing encryption protector. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param encryption_protector_name: The name of the encryption protector to be retrieved. + "current" Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of LROPoller that returns ManagedInstanceEncryptionProtector. The + ManagedInstanceEncryptionProtector is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceEncryptionProtector] = 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._revalidate_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceEncryptionProtector, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceEncryptionProtector].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceEncryptionProtector]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ManagedInstanceKeysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_keys` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> _models.ManagedInstanceKey: + """Gets a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :return: ManagedInstanceKey. The ManagedInstanceKey is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceKey] = kwargs.pop("cls", None) + + _request = build_managed_instance_keys_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceKey, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: Union[_models.ManagedInstanceKey, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_keys_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: _models.ManagedInstanceKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey + :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 ManagedInstanceKey. The ManagedInstanceKey is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceKey. The ManagedInstanceKey is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. 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 ManagedInstanceKey. The ManagedInstanceKey is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + key_name: str, + parameters: Union[_models.ManagedInstanceKey, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceKey]: + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :param parameters: The requested managed instance key resource state. Is one of the following + types: ManagedInstanceKey, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceKey or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceKey. The ManagedInstanceKey is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceKey] = 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, + managed_instance_name=managed_instance_name, + key_name=key_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceKey, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_keys_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, managed_instance_name: str, key_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the managed instance key with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. Required. + :type key_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, *, filter: Optional[str] = None, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceKey"]: + """Gets a list of managed instance keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedInstanceKey + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceKey]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_keys_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceKey], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceLongTermRetentionPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_long_term_retention_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> _models.ManagedInstanceLongTermRetentionPolicy: + """Gets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: ManagedInstanceLongTermRetentionPolicy. The ManagedInstanceLongTermRetentionPolicy is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceLongTermRetentionPolicy] = kwargs.pop("cls", None) + + _request = build_managed_instance_long_term_retention_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceLongTermRetentionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_long_term_retention_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: _models.ManagedInstanceLongTermRetentionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + parameters: Union[_models.ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Sets a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :param parameters: The long term retention policy info. Is one of the following types: + ManagedInstanceLongTermRetentionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_long_term_retention_policies_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + policy_name: Union[str, _models.ManagedInstanceLongTermRetentionPolicyName], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a managed database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param policy_name: The policy name. Should always be Default. "default" Required. + :type policy_name: str or ~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicyName + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + policy_name=policy_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceLongTermRetentionPolicy"]: + """Gets a database's long term retention policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedInstanceLongTermRetentionPolicy + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceLongTermRetentionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceLongTermRetentionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_long_term_retention_policies_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceLongTermRetentionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any + ) -> _models.ManagedInstanceOperation: + """Gets a management operation on a managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param operation_id: Required. + :type operation_id: str + :return: ManagedInstanceOperation. The ManagedInstanceOperation is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceOperation + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceOperation] = kwargs.pop("cls", None) + + _request = build_managed_instance_operations_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceOperation, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceOperation"]: + """Gets a list of operations performed on the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceOperation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_operations_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, managed_instance_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the managed instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param operation_id: Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_instance_operations_cancel_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedInstancePrivateEndpointConnectionsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.ManagedInstancePrivateEndpointConnection: + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: ManagedInstancePrivateEndpointConnection. The ManagedInstancePrivateEndpointConnection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstancePrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstancePrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.ManagedInstancePrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_private_endpoint_connections_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: _models.ManagedInstancePrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.ManagedInstancePrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Is one of the following types: ManagedInstancePrivateEndpointConnection, + JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection or JSON or + IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, managed_instance_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstancePrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstancePrivateEndpointConnection + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstancePrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_private_endpoint_connections_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstancePrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceVulnerabilityAssessmentsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Gets the managed instance's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_managed_instance_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.ManagedInstanceVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.ManagedInstanceVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedInstanceVulnerabilityAssessment: + """Creates or updates the managed instance's vulnerability assessment. Learn more about setting + SQL vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + ManagedInstanceVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment or JSON or + IO[bytes] + :return: ManagedInstanceVulnerabilityAssessment. The ManagedInstanceVulnerabilityAssessment is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the managed instance's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_instance_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceVulnerabilityAssessment"]: + """Gets the managed instance's vulnerability assessment policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceVulnerabilityAssessment + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_vulnerability_assessments_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedServerDnsAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_server_dns_aliases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> _models.ManagedServerDnsAlias: + """Gets a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :return: ManagedServerDnsAlias. The ManagedServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedServerDnsAlias + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedServerDnsAlias] = kwargs.pop("cls", None) + + _request = build_managed_server_dns_aliases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasCreation, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_dns_aliases_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: _models.ManagedServerDnsAliasCreation, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation + :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 ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: 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 ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasCreation, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Creates a managed server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ManagedServerDnsAliasCreation, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasCreation or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerDnsAlias] = 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, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_server_dns_aliases_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, managed_instance_name: str, dns_alias_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the managed server DNS alias with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedServerDnsAlias"]: + """Gets a list of managed server DNS aliases for a managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedServerDnsAlias + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedServerDnsAlias]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_server_dns_aliases_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedServerDnsAlias], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _acquire_initial( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_dns_aliases_acquire_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: _models.ManagedServerDnsAliasAcquisition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition + :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 ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: 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 ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_acquire( + self, + resource_group_name: str, + managed_instance_name: str, + dns_alias_name: str, + parameters: Union[_models.ManagedServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedServerDnsAlias]: + """Acquires managed server DNS alias from another managed server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param dns_alias_name: Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ManagedServerDnsAliasAcquisition, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerDnsAliasAcquisition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedServerDnsAlias. The ManagedServerDnsAlias + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerDnsAlias] = 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._acquire_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ManagedServerSecurityAlertPoliciesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_server_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ManagedServerSecurityAlertPolicy: + """Get a managed server's threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ManagedServerSecurityAlertPolicy. The ManagedServerSecurityAlertPolicy is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_managed_server_security_alert_policies_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedServerSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_server_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ManagedServerSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy + :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 ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. 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 ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ManagedServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The managed server security alert policy. Is one of the following types: + ManagedServerSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedServerSecurityAlertPolicy. The + ManagedServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedServerSecurityAlertPolicy] = 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, + managed_instance_name=managed_instance_name, + security_alert_policy_name=security_alert_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedServerSecurityAlertPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedServerSecurityAlertPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedServerSecurityAlertPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedServerSecurityAlertPolicy"]: + """Get the managed server's threat detection policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedServerSecurityAlertPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedServerSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_server_security_alert_policies_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedServerSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`network_security_perimeter_configurations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> _models.NetworkSecurityPerimeterConfiguration: + """Gets a network security perimeter configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: NetworkSecurityPerimeterConfiguration. The NetworkSecurityPerimeterConfiguration is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) + + _request = build_network_security_perimeter_configurations_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.NetworkSecurityPerimeterConfiguration"]: + """Gets a list of NSP configurations for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of NetworkSecurityPerimeterConfiguration + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.NetworkSecurityPerimeterConfiguration]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_network_security_perimeter_configurations_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.NetworkSecurityPerimeterConfiguration], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _reconcile_initial( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_network_security_perimeter_configurations_reconcile_request( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_reconcile( + self, resource_group_name: str, server_name: str, nsp_config_name: str, **kwargs: Any + ) -> LROPoller[_models.NetworkSecurityPerimeterConfiguration]: + """Reconcile network security perimeter configuration for SQL Resource Provider. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param nsp_config_name: Required. + :type nsp_config_name: str + :return: An instance of LROPoller that returns NetworkSecurityPerimeterConfiguration. The + NetworkSecurityPerimeterConfiguration is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.NetworkSecurityPerimeterConfiguration] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = 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._reconcile_initial( + resource_group_name=resource_group_name, + server_name=server_name, + nsp_config_name=nsp_config_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.NetworkSecurityPerimeterConfiguration, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.NetworkSecurityPerimeterConfiguration].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.NetworkSecurityPerimeterConfiguration]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class OutboundFirewallRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`outbound_firewall_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> _models.OutboundFirewallRule: + """Gets an outbound firewall rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: OutboundFirewallRule. The OutboundFirewallRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.OutboundFirewallRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> LROPoller[_models.OutboundFirewallRule]: + """Create a outbound firewall rule with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: An instance of LROPoller that returns OutboundFirewallRule. The OutboundFirewallRule + is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.OutboundFirewallRule] = 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, + outbound_rule_fqdn=outbound_rule_fqdn, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.OutboundFirewallRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.OutboundFirewallRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.OutboundFirewallRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_outbound_firewall_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a outbound firewall rule with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param outbound_rule_fqdn: Required. + :type outbound_rule_fqdn: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.OutboundFirewallRule"]: + """Gets all outbound firewall rules on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of OutboundFirewallRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.OutboundFirewallRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_outbound_firewall_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.OutboundFirewallRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateEndpointConnectionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`private_endpoint_connections` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> _models.PrivateEndpointConnection: + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: PrivateEndpointConnection. The PrivateEndpointConnection is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_private_endpoint_connections_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: _models.PrivateEndpointConnection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection + :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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: 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 PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + private_endpoint_connection_name: str, + parameters: Union[_models.PrivateEndpointConnection, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.PrivateEndpointConnection]: + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :param parameters: Is one of the following types: PrivateEndpointConnection, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection or JSON or IO[bytes] + :return: An instance of LROPoller that returns PrivateEndpointConnection. The + PrivateEndpointConnection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.PrivateEndpointConnection] = 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, + private_endpoint_connection_name=private_endpoint_connection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.PrivateEndpointConnection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.PrivateEndpointConnection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.PrivateEndpointConnection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_private_endpoint_connections_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param private_endpoint_connection_name: The name of the private endpoint connection. Required. + :type private_endpoint_connection_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + private_endpoint_connection_name=private_endpoint_connection_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateEndpointConnection"]: + """Gets all private endpoint connections on a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of PrivateEndpointConnection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.PrivateEndpointConnection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateEndpointConnection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_endpoint_connections_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateEndpointConnection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class PrivateLinkResourcesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, group_name: str, **kwargs: Any + ) -> _models.PrivateLinkResource: + """Gets a private link resource for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: PrivateLinkResource. The PrivateLinkResource is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.PrivateLinkResource + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) + + _request = build_private_link_resources_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.PrivateLinkResource, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.PrivateLinkResource"]: + """Gets the private link resources for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of PrivateLinkResource + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.PrivateLinkResource] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.PrivateLinkResource]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_private_link_resources_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.PrivateLinkResource], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RecoverableDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`recoverable_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.RecoverableDatabase: + """Gets a recoverable database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: RecoverableDatabase. The RecoverableDatabase is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecoverableDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) + + _request = build_recoverable_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecoverableDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.RecoverableDatabase"]: + """Gets a list of recoverable databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of RecoverableDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RecoverableDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecoverableDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_recoverable_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RecoverableDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RecoverableManagedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`recoverable_managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, recoverable_database_name: str, **kwargs: Any + ) -> _models.RecoverableManagedDatabase: + """Gets a recoverable managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param recoverable_database_name: Required. + :type recoverable_database_name: str + :return: RecoverableManagedDatabase. The RecoverableManagedDatabase is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) + + _request = build_recoverable_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + recoverable_database_name=recoverable_database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecoverableManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.RecoverableManagedDatabase"]: + """Gets a list of recoverable managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of RecoverableManagedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RecoverableManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecoverableManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_recoverable_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RecoverableManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RestorableDroppedDatabasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`restorable_dropped_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + restorable_dropped_database_id: str, + *, + expand: Optional[str] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> _models.RestorableDroppedDatabase: + """Gets a restorable dropped database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: RestorableDroppedDatabase. The RestorableDroppedDatabase is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) + + _request = build_restorable_dropped_databases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + expand=expand, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorableDroppedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.RestorableDroppedDatabase"]: + """Gets a list of restorable dropped databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of RestorableDroppedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorableDroppedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorableDroppedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restorable_dropped_databases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorableDroppedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RestorableDroppedManagedDatabasesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`restorable_dropped_managed_databases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any + ) -> _models.RestorableDroppedManagedDatabase: + """Gets a restorable dropped managed database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param restorable_dropped_database_id: Required. + :type restorable_dropped_database_id: str + :return: RestorableDroppedManagedDatabase. The RestorableDroppedManagedDatabase is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) + + _request = build_restorable_dropped_managed_databases_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + restorable_dropped_database_id=restorable_dropped_database_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RestorableDroppedManagedDatabase, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.RestorableDroppedManagedDatabase"]: + """Gets a list of restorable dropped managed databases. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of RestorableDroppedManagedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorableDroppedManagedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RestorableDroppedManagedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_restorable_dropped_managed_databases_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.RestorableDroppedManagedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerAzureADAdministratorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_azure_ad_administrators` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> _models.ServerAzureADAdministrator: + """Gets a Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: ServerAzureADAdministrator. The ServerAzureADAdministrator is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_administrators_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAzureADAdministrator, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ServerAzureADAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_azure_ad_administrators_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: _models.ServerAzureADAdministrator, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator + :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 ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. 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 ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + parameters: Union[_models.ServerAzureADAdministrator, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADAdministrator]: + """Creates or updates an existing Azure Active Directory administrator. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :param parameters: The requested Azure Active Directory administrator Resource state. Is one of + the following types: ServerAzureADAdministrator, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerAzureADAdministrator. The + ServerAzureADAdministrator is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAzureADAdministrator] = 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, + administrator_name=administrator_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAzureADAdministrator, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerAzureADAdministrator].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerAzureADAdministrator]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_administrators_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + server_name: str, + administrator_name: Union[str, _models.AdministratorName], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes the Azure Active Directory administrator with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param administrator_name: The name of server active directory administrator. "ActiveDirectory" + Required. + :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + administrator_name=administrator_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerAzureADAdministrator"]: + """Gets a list of Azure Active Directory administrators in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAzureADAdministrator + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAzureADAdministrator]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_azure_ad_administrators_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAzureADAdministrator], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_azure_ad_only_authentications` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> _models.ServerAzureADOnlyAuthentication: + """Gets a specific Azure Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: ServerAzureADOnlyAuthentication. The ServerAzureADOnlyAuthentication is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_only_authentications_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAzureADOnlyAuthentication, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ServerAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_azure_ad_only_authentications_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: _models.ServerAzureADOnlyAuthentication, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication + :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 ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. 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 ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + parameters: Union[_models.ServerAzureADOnlyAuthentication, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: + """Sets Server Active Directory only authentication property or updates an existing server Active + Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :param parameters: The required parameters for creating or updating an Active Directory only + authentication property. Is one of the following types: ServerAzureADOnlyAuthentication, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerAzureADOnlyAuthentication. The + ServerAzureADOnlyAuthentication is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAzureADOnlyAuthentication] = 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, + authentication_name=authentication_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAzureADOnlyAuthentication, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerAzureADOnlyAuthentication].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerAzureADOnlyAuthentication]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_azure_ad_only_authentications_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + server_name: str, + authentication_name: Union[str, _models.AuthenticationName], + **kwargs: Any + ) -> LROPoller[None]: + """Deletes an existing server Active Directory only authentication property. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param authentication_name: The name of server azure active directory only authentication. + "Default" Required. + :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + authentication_name=authentication_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerAzureADOnlyAuthentication"]: + """Gets a list of server Azure Active Directory only authentications. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAzureADOnlyAuthentication + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAzureADOnlyAuthentication]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_azure_ad_only_authentications_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAzureADOnlyAuthentication], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerConfigurationOptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_configuration_options` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + **kwargs: Any + ) -> _models.ServerConfigurationOption: + """Gets managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :return: ServerConfigurationOption. The ServerConfigurationOption is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) + + _request = build_server_configuration_options_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerConfigurationOption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: Union[_models.ServerConfigurationOption, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_configuration_options_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: _models.ServerConfigurationOption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Required. + :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption + :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 ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option 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 ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], + parameters: Union[_models.ServerConfigurationOption, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerConfigurationOption]: + """Updates managed instance server configuration option. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param server_configuration_option_name: The name of the server configuration option. + "allowPolybaseExport" Required. + :type server_configuration_option_name: str or + ~azure.mgmt.sql.models.ServerConfigurationOptionName + :param parameters: Server configuration option parameters. Is one of the following types: + ServerConfigurationOption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerConfigurationOption. The + ServerConfigurationOption is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerConfigurationOption] = 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, + managed_instance_name=managed_instance_name, + server_configuration_option_name=server_configuration_option_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = _deserialize(_models.ServerConfigurationOption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerConfigurationOption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerConfigurationOption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerConfigurationOption"]: + """Gets a list of managed instance server configuration options. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerConfigurationOption + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConfigurationOption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerConfigurationOption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_configuration_options_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerConfigurationOption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerConnectionPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_connection_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + **kwargs: Any + ) -> _models.ServerConnectionPolicy: + """Gets a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :return: ServerConnectionPolicy. The ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) + + _request = build_server_connection_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerConnectionPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: Union[_models.ServerConnectionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_connection_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: _models.ServerConnectionPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy + :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 ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. 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 ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, _models.ConnectionPolicyName], + parameters: Union[_models.ServerConnectionPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerConnectionPolicy]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param connection_policy_name: The name of the connection policy. "default" Required. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. Is one of + the following types: ServerConnectionPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerConnectionPolicy. The + ServerConnectionPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerConnectionPolicy] = 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, + connection_policy_name=connection_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerConnectionPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerConnectionPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerConnectionPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerConnectionPolicy"]: + """Lists connection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerConnectionPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerConnectionPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_connection_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerConnectionPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerDevOpsAuditSettingsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_dev_ops_audit_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + **kwargs: Any + ) -> _models.ServerDevOpsAuditingSettings: + """Gets a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :return: ServerDevOpsAuditingSettings. The ServerDevOpsAuditingSettings is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) + + _request = build_server_dev_ops_audit_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerDevOpsAuditingSettings, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: Union[_models.ServerDevOpsAuditingSettings, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_dev_ops_audit_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: _models.ServerDevOpsAuditingSettings, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Required. + :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings + :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 ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. 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 ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], + parameters: Union[_models.ServerDevOpsAuditingSettings, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: + """Creates or updates a server's DevOps audit settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dev_ops_auditing_settings_name: "Default" Required. + :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName + :param parameters: Properties of DevOps audit settings. Is one of the following types: + ServerDevOpsAuditingSettings, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerDevOpsAuditingSettings. The + ServerDevOpsAuditingSettings is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerDevOpsAuditingSettings] = 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, + dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerDevOpsAuditingSettings, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerDevOpsAuditingSettings].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerDevOpsAuditingSettings]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerDevOpsAuditingSettings"]: + """Lists DevOps audit settings of a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerDevOpsAuditingSettings + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerDevOpsAuditingSettings]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_dev_ops_audit_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerDevOpsAuditingSettings], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerDnsAliasesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_dns_aliases` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> _models.ServerDnsAlias: + """Gets a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: ServerDnsAlias. The ServerDnsAlias is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerDnsAlias + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_create_or_update( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> LROPoller[_models.ServerDnsAlias]: + """Creates a server DNS alias. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: An instance of LROPoller that returns ServerDnsAlias. The ServerDnsAlias is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerDnsAlias] = 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, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_dns_aliases_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the server DNS alias with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerDnsAlias"]: + """Gets a list of server DNS aliases for a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerDnsAlias + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerDnsAlias]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_dns_aliases_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerDnsAlias], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _acquire_initial( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: Union[_models.ServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_dns_aliases_acquire_request( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: _models.ServerDnsAliasAcquisition, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition + :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 ServerDnsAlias. The ServerDnsAlias is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerDnsAlias. The ServerDnsAlias is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: 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 ServerDnsAlias. The ServerDnsAlias is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_acquire( + self, + resource_group_name: str, + server_name: str, + dns_alias_name: str, + parameters: Union[_models.ServerDnsAliasAcquisition, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerDnsAlias]: + """Acquires server DNS alias from another server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param dns_alias_name: The name of the server dns alias. Required. + :type dns_alias_name: str + :param parameters: Is one of the following types: ServerDnsAliasAcquisition, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerDnsAlias. The ServerDnsAlias is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerDnsAlias] = 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._acquire_initial( + resource_group_name=resource_group_name, + server_name=server_name, + dns_alias_name=dns_alias_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ServerDnsAlias, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerDnsAlias].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerDnsAlias]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ServerKeysOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_keys` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: + """Gets a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :return: ServerKey. The ServerKey is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerKey + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) + + _request = build_server_keys_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerKey, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: Union[_models.ServerKey, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_keys_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: _models.ServerKey, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerKey + :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 ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. 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 ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + key_name: str, + parameters: Union[_models.ServerKey, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerKey]: + """Creates or updates a server key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :param parameters: The requested server key resource state. Is one of the following types: + ServerKey, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerKey or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerKey. The ServerKey is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerKey] = 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, + key_name=key_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerKey, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerKey].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerKey]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_keys_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes the server key with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param key_name: The name of the server key to be retrieved. Required. + :type key_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + key_name=key_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerKey"]: + """Gets a list of server keys. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerKey + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerKey] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerKey]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_keys_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerKey], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerSecurityAlertPoliciesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_security_alert_policies` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + **kwargs: Any + ) -> _models.ServerSecurityAlertPolicy: + """Get a server's security alert policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :return: ServerSecurityAlertPolicy. The ServerSecurityAlertPolicy is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) + + _request = build_server_security_alert_policies_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerSecurityAlertPolicy, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_security_alert_policies_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + security_alert_policy_name=security_alert_policy_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: _models.ServerSecurityAlertPolicy, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Required. + :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy + :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 ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. 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 ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + security_alert_policy_name: Union[str, _models.SecurityAlertPolicyName], + parameters: Union[_models.ServerSecurityAlertPolicy, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerSecurityAlertPolicy]: + """Creates or updates a threat detection policy. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param security_alert_policy_name: The name of the security alert policy. "Default" Required. + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName + :param parameters: The server security alert policy. Is one of the following types: + ServerSecurityAlertPolicy, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerSecurityAlertPolicy. The + ServerSecurityAlertPolicy is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerSecurityAlertPolicy] = 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, + security_alert_policy_name=security_alert_policy_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerSecurityAlertPolicy, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerSecurityAlertPolicy].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerSecurityAlertPolicy]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerSecurityAlertPolicy"]: + """Get the server's threat detection policies. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerSecurityAlertPolicy + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerSecurityAlertPolicy]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_security_alert_policies_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerSecurityAlertPolicy], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerTrustCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_trust_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> _models.ServerTrustCertificate: + """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :return: ServerTrustCertificate. The ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) + + _request = build_server_trust_certificates_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerTrustCertificate, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: Union[_models.ServerTrustCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_trust_certificates_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: _models.ServerTrustCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate + :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 ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. 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 ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + certificate_name: str, + parameters: Union[_models.ServerTrustCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerTrustCertificate]: + """Uploads a server trust certificate from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :param parameters: The server trust certificate info. Is one of the following types: + ServerTrustCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerTrustCertificate. The + ServerTrustCertificate is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerTrustCertificate] = 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, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerTrustCertificate, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerTrustCertificate].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerTrustCertificate]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_server_trust_certificates_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param certificate_name: Name of of the certificate to get. Required. + :type certificate_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + certificate_name=certificate_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerTrustCertificate"]: + """Gets a list of the server trust certificates used to secure communication between SQL Server + and the specified SQL Managed Instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ServerTrustCertificate + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustCertificate] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerTrustCertificate]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_trust_certificates_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerTrustCertificate], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerVulnerabilityAssessmentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_vulnerability_assessments` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Gets the server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_server_vulnerability_assessments_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: _models.ServerVulnerabilityAssessment, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. 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: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + parameters: Union[_models.ServerVulnerabilityAssessment, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ServerVulnerabilityAssessment: + """Creates or updates the server's vulnerability assessment. Learn more about setting SQL + vulnerability assessment with managed identity - + `https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage + `_. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param parameters: The requested resource. Is one of the following types: + ServerVulnerabilityAssessment, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment or JSON or IO[bytes] + :return: ServerVulnerabilityAssessment. The ServerVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_vulnerability_assessments_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> None: + """Removes the server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_server_vulnerability_assessments_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerVulnerabilityAssessment"]: + """Lists the vulnerability assessment policies associated with a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerVulnerabilityAssessment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_vulnerability_assessments_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class StartStopManagedInstanceSchedulesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`start_stop_managed_instance_schedules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Gets the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) + + _request = build_start_stop_managed_instance_schedules_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StartStopManagedInstanceSchedule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: _models.StartStopManagedInstanceSchedule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Required. + :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. 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: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + parameters: Union[_models.StartStopManagedInstanceSchedule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.StartStopManagedInstanceSchedule: + """Creates or updates the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :param parameters: The requested managed instance Start/Stop schedule. Is one of the following + types: StartStopManagedInstanceSchedule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule or JSON or IO[bytes] + :return: StartStopManagedInstanceSchedule. The StartStopManagedInstanceSchedule is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_start_stop_managed_instance_schedules_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.StartStopManagedInstanceSchedule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + start_stop_schedule_name: Union[str, _models.StartStopScheduleName], + **kwargs: Any + ) -> None: + """Deletes the managed instance's Start/Stop schedule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" + Required. + :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_start_stop_managed_instance_schedules_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + start_stop_schedule_name=start_stop_schedule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.StartStopManagedInstanceSchedule"]: + """Lists the managed instance's Start/Stop schedules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of StartStopManagedInstanceSchedule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.StartStopManagedInstanceSchedule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.StartStopManagedInstanceSchedule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_start_stop_managed_instance_schedules_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.StartStopManagedInstanceSchedule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SubscriptionUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`subscription_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: + """Gets a subscription usage metric. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param usage_name: Name of usage metric to return. Required. + :type usage_name: str + :return: SubscriptionUsage. The SubscriptionUsage is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SubscriptionUsage + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) + + _request = build_subscription_usages_get_request( + location_name=location_name, + usage_name=usage_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SubscriptionUsage, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.SubscriptionUsage"]: + """Gets all subscription usage metrics in a given location. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of SubscriptionUsage + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SubscriptionUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SubscriptionUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_subscription_usages_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SubscriptionUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SyncAgentsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sync_agents` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any) -> _models.SyncAgent: + """Gets a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: SyncAgent. The SyncAgent is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncAgent + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) + + _request = build_sync_agents_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncAgent, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: Union[_models.SyncAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_agents_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: _models.SyncAgent, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncAgent + :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 SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. 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 SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + sync_agent_name: str, + parameters: Union[_models.SyncAgent, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncAgent]: + """Creates or updates a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :param parameters: The requested sync agent resource state. Is one of the following types: + SyncAgent, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncAgent or JSON or IO[bytes] + :return: An instance of LROPoller that returns SyncAgent. The SyncAgent is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncAgent] = 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, + sync_agent_name=sync_agent_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncAgent, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncAgent].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncAgent]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_agents_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncAgent"]: + """Lists sync agents in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of SyncAgent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncAgent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_agents_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncAgent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def generate_key( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> _models.SyncAgentKeyProperties: + """Generates a sync agent key. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: SyncAgentKeyProperties. The SyncAgentKeyProperties is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) + + _request = build_sync_agents_generate_key_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncAgentKeyProperties, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_linked_databases( + self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncAgentLinkedDatabase"]: + """Lists databases linked to a sync agent. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param sync_agent_name: The name of the sync agent. Required. + :type sync_agent_name: str + :return: An iterator like instance of SyncAgentLinkedDatabase + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgentLinkedDatabase] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncAgentLinkedDatabase]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_agents_list_linked_databases_request( + resource_group_name=resource_group_name, + server_name=server_name, + sync_agent_name=sync_agent_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncAgentLinkedDatabase], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SyncGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sync_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> _models.SyncGroup: + """Gets a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: SyncGroup. The SyncGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) + + _request = build_sync_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: _models.SyncGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup + :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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. 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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Creates or updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Is one of the following types: + SyncGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncGroup] = 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, + sync_group_name=sync_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncGroup]( + 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, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_groups_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: _models.SyncGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup + :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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. 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 SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + parameters: Union[_models.SyncGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Updates a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param parameters: The requested sync group resource state. Is one of the following types: + SyncGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncGroup] = 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, + sync_group_name=sync_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncGroup"]: + """Lists sync groups under a hub database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SyncGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel_sync( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Cancels a sync group synchronization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sync_groups_cancel_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_hub_schemas( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a collection of hub database schemas. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of SyncFullSchemaProperties + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncFullSchemaProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_hub_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncFullSchemaProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_logs( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + *, + start_time: str, + end_time: str, + type: Union[str, _models.SyncGroupsType], + continuation_token_parameter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SyncGroupLogProperties"]: + """Gets a collection of sync group logs. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :keyword start_time: Get logs generated after this time. Required. + :paramtype start_time: str + :keyword end_time: Get logs generated before this time. Required. + :paramtype end_time: str + :keyword type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and + "Success". Required. + :paramtype type: str or ~azure.mgmt.sql.models.SyncGroupsType + :keyword continuation_token_parameter: The continuation token for this operation. Default value + is None. + :paramtype continuation_token_parameter: str + :return: An iterator like instance of SyncGroupLogProperties + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncGroupLogProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_logs_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + type=type, + continuation_token_parameter=continuation_token_parameter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncGroupLogProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _refresh_hub_schema_initial( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_groups_refresh_hub_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_refresh_hub_schema( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> LROPoller[_models.SyncGroup]: + """Refreshes a hub database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An instance of LROPoller that returns SyncGroup. The SyncGroup is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncGroup] = 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_hub_schema_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def trigger_sync( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> None: + """Triggers a sync group synchronization. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sync_groups_trigger_sync_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_sync_database_ids( + self, location_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncDatabaseIdProperties"]: + """Gets a collection of sync database ids. + + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :return: An iterator like instance of SyncDatabaseIdProperties + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncDatabaseIdProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncDatabaseIdProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_groups_list_sync_database_ids_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncDatabaseIdProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SyncMembersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sync_members` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> _models.SyncMember: + """Gets a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: SyncMember. The SyncMember is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SyncMember + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) + + _request = build_sync_members_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SyncMember, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_members_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: _models.SyncMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember + :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 SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. 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 SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Creates or updates a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Is one of the following types: + SyncMember, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember or JSON or IO[bytes] + :return: An instance of LROPoller that returns SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncMember] = 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, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncMember]( + 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, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sync_members_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: _models.SyncMember, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember + :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 SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. 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 SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + parameters: Union[_models.SyncMember, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Updates an existing sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :param parameters: The requested sync member resource state. Is one of the following types: + SyncMember, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SyncMember or JSON or IO[bytes] + :return: An instance of LROPoller that returns SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SyncMember] = 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, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncMember]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_members_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a sync member. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_sync_group( + self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.SyncMember"]: + """Lists sync members in the given sync group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :return: An iterator like instance of SyncMember + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncMember]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_members_list_by_sync_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncMember], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _refresh_member_schema_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sync_members_refresh_member_schema_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_refresh_member_schema( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> LROPoller[_models.SyncMember]: + """Refreshes a sync member database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An instance of LROPoller that returns SyncMember. The SyncMember is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SyncMember] = 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_member_schema_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SyncMember, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SyncMember].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SyncMember]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_member_schemas( + self, + resource_group_name: str, + server_name: str, + database_name: str, + sync_group_name: str, + sync_member_name: str, + **kwargs: Any + ) -> ItemPaged["_models.SyncFullSchemaProperties"]: + """Gets a sync member database schema. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param sync_group_name: The name of the sync group. Required. + :type sync_group_name: str + :param sync_member_name: The name of the sync member. Required. + :type sync_member_name: str + :return: An iterator like instance of SyncFullSchemaProperties + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SyncFullSchemaProperties]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_sync_members_list_member_schemas_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + sync_group_name=sync_group_name, + sync_member_name=sync_member_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SyncFullSchemaProperties], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TimeZonesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`time_zones` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: + """Gets a managed instance time zone. + + :param location_name: The location of the database. Required. + :type location_name: str + :param time_zone_id: The time zone ID. Required. + :type time_zone_id: str + :return: TimeZone. The TimeZone is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.TimeZone + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) + + _request = build_time_zones_get_request( + location_name=location_name, + time_zone_id=time_zone_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.TimeZone, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.TimeZone"]: + """Gets a list of managed instance time zones by location. + + :param location_name: The location of the database. Required. + :type location_name: str + :return: An iterator like instance of TimeZone + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TimeZone] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.TimeZone]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_time_zones_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.TimeZone], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class VirtualClustersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`virtual_clusters` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: + """Gets a virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: VirtualCluster. The VirtualCluster is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.VirtualCluster + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_get_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VirtualCluster, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_clusters_create_or_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualCluster, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster + :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 VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualCluster, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Creates virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is one of the following types: + VirtualCluster, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualCluster or JSON or IO[bytes] + :return: An instance of LROPoller that returns VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _update_initial( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_clusters_update_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: _models.VirtualClusterUpdate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate + :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 VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. 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 VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_update( + self, + resource_group_name: str, + virtual_cluster_name: str, + parameters: Union[_models.VirtualClusterUpdate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualCluster]: + """Updates an existing virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :param parameters: The requested virtual cluster resource state. Is one of the following types: + VirtualClusterUpdate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate or JSON or IO[bytes] + :return: An instance of LROPoller that returns VirtualCluster. The VirtualCluster is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualCluster] = 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, + virtual_cluster_name=virtual_cluster_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualCluster, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualCluster].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualCluster]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_delete_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> LROPoller[None]: + """Deletes a virtual cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.VirtualCluster"]: + """Gets a list of virtual clusters in a resource group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :return: An iterator like instance of VirtualCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_clusters_list_by_resource_group_request( + resource_group_name=resource_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list(self, **kwargs: Any) -> ItemPaged["_models.VirtualCluster"]: + """Gets a list of all virtualClusters in the subscription. + + :return: An iterator like instance of VirtualCluster + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualCluster] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualCluster]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_clusters_list_request( + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualCluster], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _update_dns_servers_initial( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_clusters_update_dns_servers_request( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_update_dns_servers( + self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any + ) -> LROPoller[_models.UpdateVirtualClusterDnsServersOperation]: + """Synchronizes the DNS server settings used by the managed instances inside the given virtual + cluster. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param virtual_cluster_name: The name of the virtual cluster. Required. + :type virtual_cluster_name: str + :return: An instance of LROPoller that returns UpdateVirtualClusterDnsServersOperation. The + UpdateVirtualClusterDnsServersOperation is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( + resource_group_name=resource_group_name, + virtual_cluster_name=virtual_cluster_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.UpdateVirtualClusterDnsServersOperation, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.UpdateVirtualClusterDnsServersOperation].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.UpdateVirtualClusterDnsServersOperation]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class VirtualNetworkRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`virtual_network_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> _models.VirtualNetworkRule: + """Gets a virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :return: VirtualNetworkRule. The VirtualNetworkRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) + + _request = build_virtual_network_rules_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VirtualNetworkRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: Union[_models.VirtualNetworkRule, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_virtual_network_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: _models.VirtualNetworkRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Required. + :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule + :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 VirtualNetworkRule. The VirtualNetworkRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns VirtualNetworkRule. The VirtualNetworkRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. 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 VirtualNetworkRule. The VirtualNetworkRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + virtual_network_rule_name: str, + parameters: Union[_models.VirtualNetworkRule, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.VirtualNetworkRule]: + """Creates or updates an existing virtual network rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :param parameters: The requested virtual Network Rule Resource state. Is one of the following + types: VirtualNetworkRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule or JSON or IO[bytes] + :return: An instance of LROPoller that returns VirtualNetworkRule. The VirtualNetworkRule is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.VirtualNetworkRule] = 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, + virtual_network_rule_name=virtual_network_rule_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VirtualNetworkRule, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VirtualNetworkRule].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VirtualNetworkRule]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_virtual_network_rules_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes the virtual network rule with the given name. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param virtual_network_rule_name: The name of the virtual network rule. Required. + :type virtual_network_rule_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + virtual_network_rule_name=virtual_network_rule_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.VirtualNetworkRule"]: + """Gets a list of virtual network rules in a server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of VirtualNetworkRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VirtualNetworkRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_virtual_network_rules_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VirtualNetworkRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class WorkloadClassifiersOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`workload_classifiers` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> _models.WorkloadClassifier: + """Gets a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :return: WorkloadClassifier. The WorkloadClassifier is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.WorkloadClassifier + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) + + _request = build_workload_classifiers_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.WorkloadClassifier, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: Union[_models.WorkloadClassifier, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_workload_classifiers_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: _models.WorkloadClassifier, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier + :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 WorkloadClassifier. The WorkloadClassifier is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns WorkloadClassifier. The WorkloadClassifier is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. 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 WorkloadClassifier. The WorkloadClassifier is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + parameters: Union[_models.WorkloadClassifier, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.WorkloadClassifier]: + """Creates or updates a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. Is one of the following types: + WorkloadClassifier, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier or JSON or IO[bytes] + :return: An instance of LROPoller that returns WorkloadClassifier. The WorkloadClassifier is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadClassifier] = 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, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.WorkloadClassifier, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.WorkloadClassifier].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.WorkloadClassifier]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_workload_classifiers_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + workload_classifier_name: str, + **kwargs: Any + ) -> LROPoller[None]: + """Deletes a workload classifier. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. Required. + :type workload_classifier_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_workload_group( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> ItemPaged["_models.WorkloadClassifier"]: + """Gets the list of workload classifiers for a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: An iterator like instance of WorkloadClassifier + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.WorkloadClassifier]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_workload_classifiers_list_by_workload_group_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.WorkloadClassifier], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class WorkloadGroupsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`workload_groups` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> _models.WorkloadGroup: + """Gets a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: WorkloadGroup. The WorkloadGroup is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.WorkloadGroup + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) + + _request = build_workload_groups_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.WorkloadGroup, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: Union[_models.WorkloadGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_workload_groups_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: _models.WorkloadGroup, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadGroup + :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 WorkloadGroup. The WorkloadGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns WorkloadGroup. The WorkloadGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. 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 WorkloadGroup. The WorkloadGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + workload_group_name: str, + parameters: Union[_models.WorkloadGroup, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.WorkloadGroup]: + """Creates or updates a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :param parameters: The requested workload group state. Is one of the following types: + WorkloadGroup, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.WorkloadGroup or JSON or IO[bytes] + :return: An instance of LROPoller that returns WorkloadGroup. The WorkloadGroup is compatible + with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.WorkloadGroup] = 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, + workload_group_name=workload_group_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.WorkloadGroup, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.WorkloadGroup].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.WorkloadGroup]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _delete_initial( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_workload_groups_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_delete( + self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes a workload group. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param workload_group_name: The name of the workload group. Required. + :type workload_group_name: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + workload_group_name=workload_group_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.WorkloadGroup"]: + """Gets the list of workload groups. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of WorkloadGroup + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadGroup] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.WorkloadGroup]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_workload_groups_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.WorkloadGroup], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseSensitivityLabelsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.SensitivityLabelSource], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Gets the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. Known values are: + "current" and "recommended". Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: _models.SensitivityLabel, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. 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: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + parameters: Union[_models.SensitivityLabel, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SensitivityLabel: + """Creates or updates the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :param parameters: The column sensitivity label resource. Is one of the following types: + SensitivityLabel, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or JSON or IO[bytes] + :return: SensitivityLabel. The SensitivityLabel is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SensitivityLabel + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_sensitivity_labels_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SensitivityLabel, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.CurrentSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Deletes the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "current" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.CurrentSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_delete_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def disable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Disables sensitivity recommendations on a given column. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_disable_recommendation_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def enable_recommendation( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + schema_name: str, + table_name: str, + column_name: str, + sensitivity_label_source: Union[str, _models.RecommendedSensitivityLabelSource], + **kwargs: Any + ) -> None: + """Enables sensitivity recommendations on a given column (recommendations are enabled by default + on all columns). + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param schema_name: The name of the schema. Required. + :type schema_name: str + :param table_name: The name of the table. Required. + :type table_name: str + :param column_name: The name of the column. Required. + :type column_name: str + :param sensitivity_label_source: The source of the sensitivity label. "recommended" Required. + :type sensitivity_label_source: str or ~azure.mgmt.sql.models.RecommendedSensitivityLabelSource + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_managed_database_sensitivity_labels_enable_recommendation_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + schema_name=schema_name, + table_name=table_name, + column_name=column_name, + sensitivity_label_source=sensitivity_label_source, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_current_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + count: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword count: Default value is None. + :paramtype count: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_current_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + count=count, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.SensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.SensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update sensitivity labels of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: SensitivityLabelUpdateList, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or JSON or IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + @distributed_trace + def list_recommended_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + skip_token: Optional[str] = None, + include_disabled_recommendations: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword skip_token: Default value is None. + :paramtype skip_token: str + :keyword include_disabled_recommendations: Specifies whether to include disabled + recommendations or not. Default value is None. + :paramtype include_disabled_recommendations: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_recommended_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + skip_token=skip_token, + include_disabled_recommendations=include_disabled_recommendations, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SensitivityLabel"]: + """Gets the sensitivity labels of a given database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of SensitivityLabel + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SensitivityLabel]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_sensitivity_labels_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SensitivityLabel], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseEncryptionProtectorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_encryption_protectors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _revalidate_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_encryption_protectors_revalidate_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_revalidate( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Revalidates an existing encryption protector for a particular database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._revalidate_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _revert_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_encryption_protectors_revert_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_revert( + self, + resource_group_name: str, + server_name: str, + database_name: str, + encryption_protector_name: Union[str, _models.EncryptionProtectorName], + **kwargs: Any + ) -> LROPoller[_models.Database]: + """Reverts an existing encryption protector for a particular database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param encryption_protector_name: The name of the encryption protector to be updated. "current" + Required. + :type encryption_protector_name: str or ~azure.mgmt.sql.models.EncryptionProtectorName + :return: An instance of LROPoller that returns Database. The Database is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Database] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Database] = 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._revert_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + encryption_protector_name=encryption_protector_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Database, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Database].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Database]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DatabaseOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseOperation"]: + """Gets a list of operations performed on the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseOperation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_operations_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_operations_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseUsage"]: + """Gets database usages. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseUsage + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_usages_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class RecommendedSensitivityLabelsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`recommended_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.RecommendedSensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.RecommendedSensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: RecommendedSensitivityLabelUpdateList, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or JSON or + IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_recommended_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class SynapseLinkWorkspacesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`synapse_link_workspaces` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.SynapseLinkWorkspace"]: + """Gets all synapselink workspaces for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SynapseLinkWorkspace + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SynapseLinkWorkspace] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SynapseLinkWorkspace]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_synapse_link_workspaces_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SynapseLinkWorkspace], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerOperation"]: + """Gets a list of operations performed on the server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerOperation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_operations_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerUsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerUsage"]: + """Gets server usages. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerUsage + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerUsage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerUsage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_usages_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerUsage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class TdeCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`tde_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_initial( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_tde_certificates_create_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: _models.TdeCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate + :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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. 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 Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.Server]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested TDE certificate to be created or updated. Is one of the + following types: TdeCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate or JSON or IO[bytes] + :return: An instance of LROPoller that returns Server. The Server is compatible with + MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Server] = 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_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.Server, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.Server].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.Server]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Gets a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_database_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.DatabaseAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. 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: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.DatabaseAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseAdvancedThreatProtection: + """Creates or updates a database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The database Advanced Threat Protection state. Is one of the following + types: DatabaseAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection or JSON or IO[bytes] + :return: DatabaseAdvancedThreatProtection. The DatabaseAdvancedThreatProtection is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DatabaseAdvancedThreatProtection"]: + """Gets a list of database's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DatabaseAdvancedThreatProtection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_advanced_threat_protection_settings_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseAdvisorsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_advisors` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any + ) -> _models.Advisor: + """Gets a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + _request = build_database_advisors_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: _models.Advisor, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: ~azure.mgmt.sql.models.Advisor + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. 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: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + parameters: Union[_models.Advisor, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.Advisor: + """Updates a database advisor. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param parameters: The requested advisor resource state. Is one of the following types: + Advisor, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.Advisor or JSON or IO[bytes] + :return: Advisor. The Advisor is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.Advisor + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_advisors_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.Advisor, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + expand: Optional[str] = None, + **kwargs: Any + ) -> List[_models.Advisor]: + """Gets a list of database advisors. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword expand: The child resources to include in the response. Default value is None. + :paramtype expand: str + :return: list of Advisor + :rtype: list[~azure.mgmt.sql.models.Advisor] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) + + _request = build_database_advisors_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + expand=expand, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.Advisor], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseAutomaticTuningOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_automatic_tuning` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Gets a database's automatic tuning. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) + + _request = build_database_automatic_tuning_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.DatabaseAutomaticTuning, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. 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: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.DatabaseAutomaticTuning, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseAutomaticTuning: + """Update automatic tuning properties for target database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: The requested automatic tuning resource state. Is one of the following + types: DatabaseAutomaticTuning, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseAutomaticTuning or JSON or IO[bytes] + :return: DatabaseAutomaticTuning. The DatabaseAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseAutomaticTuning] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_automatic_tuning_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseExtensionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_extensions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, database_name: str, extension_name: str, **kwargs: Any + ) -> None: + """Gets a database extension. This will return resource not found as it is not supported. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_database_extensions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: Union[_models.DatabaseExtensions, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_extensions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: _models.DatabaseExtensions, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + extension_name: str, + parameters: Union[_models.DatabaseExtensions, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Perform a database extension operation, like database import, database export, or polybase + import. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param extension_name: Required. + :type extension_name: str + :param parameters: The database import request parameters. Is one of the following types: + DatabaseExtensions, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ImportExportExtensionsOperationResult"]: + """List database extension. This will return an empty list as it is not supported. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ImportExportExtensionsOperationResult + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ImportExportExtensionsOperationResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_extensions_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ImportExportExtensionsOperationResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseRecommendedActionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_recommended_actions` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + **kwargs: Any + ) -> _models.RecommendedAction: + """Gets a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + + _request = build_database_recommended_actions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + recommended_action_name=recommended_action_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecommendedAction, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: _models.RecommendedAction, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedAction + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. 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: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + advisor_name: str, + recommended_action_name: str, + parameters: Union[_models.RecommendedAction, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.RecommendedAction: + """Updates a database recommended action. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended Action. Required. + :type recommended_action_name: str + :param parameters: The requested recommended action resource state. Is one of the following + types: RecommendedAction, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedAction or JSON or IO[bytes] + :return: RecommendedAction. The RecommendedAction is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.RecommendedAction + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.RecommendedAction] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_recommended_actions_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + recommended_action_name=recommended_action_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.RecommendedAction, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database_advisor( + self, resource_group_name: str, server_name: str, database_name: str, advisor_name: str, **kwargs: Any + ) -> List[_models.RecommendedAction]: + """Gets list of Database Recommended Actions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advisor_name: The name of the Database Advisor. Required. + :type advisor_name: str + :return: list of RecommendedAction + :rtype: list[~azure.mgmt.sql.models.RecommendedAction] + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.RecommendedAction]] = kwargs.pop("cls", None) + + _request = build_database_recommended_actions_list_by_database_advisor_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + advisor_name=advisor_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(List[_models.RecommendedAction], response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_baselines_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes] Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or JSON or + IO[bytes] + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_database_sql_vulnerability_assessment_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessment( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: + """Gets a list of database's sql vulnerability assessment rule baselines. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of DatabaseSqlVulnerabilityAssessmentBaselineSet + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class SqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: JSON, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: JSON + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: IO[bytes], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Required. + :type parameters: IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes]], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: + """Add a database's vulnerability assessment rule baseline list. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param parameters: The requested rule baseline resource. Is one of the following types: + DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, JSON, IO[bytes] Required. + :type parameters: + ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or JSON or + IO[bytes] + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: DatabaseSqlVulnerabilityAssessmentBaselineSet. The + DatabaseSqlVulnerabilityAssessmentBaselineSet is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_vulnerability_assessment_baselines_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseSqlVulnerabilityAssessmentBaselineSet, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessments_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessment: + """Gets SQL Vulnerability Assessment policy for database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or + ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName + :return: SqlVulnerabilityAssessment. The SqlVulnerabilityAssessment is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessments_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessment"]: + """Lists SQL Vulnerability Assessment policies associated with a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of SqlVulnerabilityAssessment + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessment]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_sql_vulnerability_assessments_settings_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessment], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseSqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_execute_scan` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _execute_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_execute_scan_execute_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_execute( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> LROPoller[_models.SqlVulnerabilityAssessment]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An instance of LROPoller that returns SqlVulnerabilityAssessment. The + SqlVulnerabilityAssessment is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = 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._execute_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SqlVulnerabilityAssessment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlVulnerabilityAssessment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_execute_scan` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _execute_initial( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_execute_scan_execute_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_execute( + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> LROPoller[_models.SqlVulnerabilityAssessment]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: An instance of LROPoller that returns SqlVulnerabilityAssessment. The + SqlVulnerabilityAssessment is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessment] = 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._execute_initial( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + system_database_name=system_database_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.SqlVulnerabilityAssessment, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.SqlVulnerabilityAssessment].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.SqlVulnerabilityAssessment]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class SqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_vulnerability_assessment_rule_baselines` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + baseline_name: Union[str, _models.BaselineName], + rule_id: str, + *, + system_database_name: Union[str, _models.VulnerabilityAssessmentSystemDatabaseName], + **kwargs: Any + ) -> None: + """Removes the database's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param baseline_name: "default" Required. + :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName + :param rule_id: The vulnerability assessment rule ID. Required. + :type rule_id: str + :keyword system_database_name: The vulnerability assessment system database name. "master" + Required. + :paramtype system_database_name: str or + ~azure.mgmt.sql.models.VulnerabilityAssessmentSystemDatabaseName + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_sql_vulnerability_assessment_rule_baselines_delete_request( + resource_group_name=resource_group_name, + server_name=server_name, + vulnerability_assessment_name=vulnerability_assessment_name, + baseline_name=baseline_name, + rule_id=rule_id, + subscription_id=self._config.subscription_id, + system_database_name=system_database_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class DatabaseSqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_sql_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.SqlVulnerabilityAssessmentScanRecord: + """Get a database vulnerability assessment scan result. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: SqlVulnerabilityAssessmentScanRecord. The SqlVulnerabilityAssessmentScanRecord is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_database_sql_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlVulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_sql_vulnerability_assessments( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of SqlVulnerabilityAssessmentScanRecord + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SqlVulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = ( + build_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SqlVulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class DatabaseVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`database_vulnerability_assessment_scans` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.VulnerabilityAssessmentScanRecord: + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: VulnerabilityAssessmentScanRecord. The VulnerabilityAssessmentScanRecord is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + **kwargs: Any + ) -> ItemPaged["_models.VulnerabilityAssessmentScanRecord"]: + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :return: An iterator like instance of VulnerabilityAssessmentScanRecord + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.VulnerabilityAssessmentScanRecord]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_database_vulnerability_assessment_scans_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.VulnerabilityAssessmentScanRecord], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def export( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> _models.DatabaseVulnerabilityAssessmentScansExport: + """Convert an existing scan result to a human readable format. If already exists nothing happens. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: DatabaseVulnerabilityAssessmentScansExport. The + DatabaseVulnerabilityAssessmentScansExport is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DatabaseVulnerabilityAssessmentScansExport + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DatabaseVulnerabilityAssessmentScansExport] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_export_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DatabaseVulnerabilityAssessmentScansExport, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _initiate_scan_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_database_vulnerability_assessment_scans_initiate_scan_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_initiate_scan( + self, + resource_group_name: str, + server_name: str, + database_name: str, + vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], + scan_id: str, + **kwargs: Any + ) -> LROPoller[_models.VulnerabilityAssessmentScanRecord]: + """Executes a Vulnerability Assessment database scan. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" + Required. + :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName + :param scan_id: The vulnerability assessment scan Id of the scan to retrieve. Required. + :type scan_id: str + :return: An instance of LROPoller that returns VulnerabilityAssessmentScanRecord. The + VulnerabilityAssessmentScanRecord is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.VulnerabilityAssessmentScanRecord] = 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._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + vulnerability_assessment_name=vulnerability_assessment_name, + scan_id=scan_id, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.VulnerabilityAssessmentScanRecord, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.VulnerabilityAssessmentScanRecord].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.VulnerabilityAssessmentScanRecord]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class DataMaskingRulesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`data_masking_rules` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + *, + skip: Optional[int] = None, + **kwargs: Any + ) -> ItemPaged["_models.DataMaskingRule"]: + """Gets a list of database data masking rules. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :return: An iterator like instance of DataMaskingRule + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataMaskingRule] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataMaskingRule]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_data_masking_rules_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + subscription_id=self._config.subscription_id, + skip=skip, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DataMaskingRule], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: _models.DataMaskingRule, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingRule + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. + 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: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_masking_policy_name: Union[str, _models.DataMaskingPolicyName], + data_masking_rule_name: str, + parameters: Union[_models.DataMaskingRule, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.DataMaskingRule: + """Creates or updates a database data masking rule. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_masking_policy_name: The name of the database for which the data masking policy + applies. "Default" Required. + :type data_masking_policy_name: str or ~azure.mgmt.sql.models.DataMaskingPolicyName + :param data_masking_rule_name: The name of the data masking rule. Required. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a data masking rule. Is one + of the following types: DataMaskingRule, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.DataMaskingRule or JSON or IO[bytes] + :return: DataMaskingRule. The DataMaskingRule is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.DataMaskingRule + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.DataMaskingRule] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_data_masking_rules_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_masking_policy_name=data_masking_policy_name, + data_masking_rule_name=data_masking_rule_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataMaskingRule, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class DataWarehouseUserActivitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`data_warehouse_user_activities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + data_warehouse_user_activity_name: Union[str, _models.DataWarehouseUserActivityName], + **kwargs: Any + ) -> _models.DataWarehouseUserActivities: + """Gets the user activities of a data warehouse which includes running and suspended queries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param data_warehouse_user_activity_name: The activity name of the data warehouse. "current" + Required. + :type data_warehouse_user_activity_name: str or + ~azure.mgmt.sql.models.DataWarehouseUserActivityName + :return: DataWarehouseUserActivities. The DataWarehouseUserActivities is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.DataWarehouseUserActivities] = kwargs.pop("cls", None) + + _request = build_data_warehouse_user_activities_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + data_warehouse_user_activity_name=data_warehouse_user_activity_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.DataWarehouseUserActivities, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.DataWarehouseUserActivities"]: + """List the user activities of a data warehouse which includes running and suspended queries. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of DataWarehouseUserActivities + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DataWarehouseUserActivities] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.DataWarehouseUserActivities]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_data_warehouse_user_activities_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.DataWarehouseUserActivities], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseSecurityEventsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_security_events` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_database( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + *, + filter: Optional[str] = None, + skip: Optional[int] = None, + top: Optional[int] = None, + skiptoken: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.SecurityEvent"]: + """Gets a list of security events. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :keyword skip: The number of elements in the collection to skip. Default value is None. + :paramtype skip: int + :keyword top: The number of elements to return from the collection. Default value is None. + :paramtype top: int + :keyword skiptoken: An opaque token that identifies a starting point in the collection. Default + value is None. + :paramtype skiptoken: str + :return: An iterator like instance of SecurityEvent + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SecurityEvent] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.SecurityEvent]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_security_events_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + filter=filter, + skip=skip, + top=top, + skiptoken=skiptoken, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.SecurityEvent], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseRecommendedSensitivityLabelsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_recommended_sensitivity_labels` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: _models.RecommendedSensitivityLabelUpdateList, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: 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: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + parameters: Union[_models.RecommendedSensitivityLabelUpdateList, JSON, IO[bytes]], + **kwargs: Any + ) -> None: + """Update recommended sensitivity labels states of a given database using an operations batch. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: RecommendedSensitivityLabelUpdateList, JSON, + IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or JSON or + IO[bytes] + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_recommended_sensitivity_labels_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedInstanceTdeCertificatesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_tde_certificates` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + def _create_initial( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_tde_certificates_create_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.TdeCertificate, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate + :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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. 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 ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.TdeCertificate, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstance]: + """Creates a TDE certificate for a given server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: The requested TDE certificate to be created or updated. Is one of the + following types: TdeCertificate, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.TdeCertificate or JSON or IO[bytes] + :return: An instance of LROPoller that returns ManagedInstance. The ManagedInstance is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstance] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstance] = 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_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstance, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstance].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 + ) + + +class ElasticPoolOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`elastic_pool_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_elastic_pool( + self, resource_group_name: str, server_name: str, elastic_pool_name: str, **kwargs: Any + ) -> ItemPaged["_models.ElasticPoolOperation"]: + """Gets a list of operations performed on the elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :return: An iterator like instance of ElasticPoolOperation + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ElasticPoolOperation] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ElasticPoolOperation]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_elastic_pool_operations_list_by_elastic_pool_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ElasticPoolOperation], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def cancel( # pylint: disable=inconsistent-return-statements + self, resource_group_name: str, server_name: str, elastic_pool_name: str, operation_id: str, **kwargs: Any + ) -> None: + """Cancels the asynchronous operation on the elastic pool. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param elastic_pool_name: The name of the elastic pool. Required. + :type elastic_pool_name: str + :param operation_id: The operation identifier. Required. + :type operation_id: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[None] = kwargs.pop("cls", None) + + _request = build_elastic_pool_operations_cancel_request( + resource_group_name=resource_group_name, + server_name=server_name, + elastic_pool_name=elastic_pool_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class UsagesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`usages` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_instance_pool( + self, + resource_group_name: str, + instance_pool_name: str, + *, + expand_children: Optional[bool] = None, + **kwargs: Any + ) -> ItemPaged["_models.Usage"]: + """Gets all instance pool usage metrics. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param instance_pool_name: The name of the instance pool to be retrieved. Required. + :type instance_pool_name: str + :keyword expand_children: Optional request parameter to include managed instance usages within + the instance pool. Default value is None. + :paramtype expand_children: bool + :return: An iterator like instance of Usage + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Usage] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.Usage]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_usages_list_by_instance_pool_request( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + subscription_id=self._config.subscription_id, + expand_children=expand_children, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.Usage], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class LedgerDigestUploadsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`ledger_digest_uploads` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> _models.LedgerDigestUploads: + """Gets the current ledger digest upload configuration for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :return: LedgerDigestUploads. The LedgerDigestUploads is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LedgerDigestUploads] = kwargs.pop("cls", None) + + _request = build_ledger_digest_uploads_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LedgerDigestUploads, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: Union[_models.LedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_ledger_digest_uploads_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: _models.LedgerDigestUploads, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + parameters: Union[_models.LedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: Is one of the following types: LedgerDigestUploads, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.LedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LedgerDigestUploads + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.LedgerDigestUploads]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_ledger_digest_uploads_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LedgerDigestUploads], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _disable_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_ledger_digest_uploads_disable_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_disable( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.LedgerDigestUploadsName], + **kwargs: Any + ) -> LROPoller[_models.LedgerDigestUploads]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :return: An instance of LROPoller that returns LedgerDigestUploads. The LedgerDigestUploads is + compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LedgerDigestUploads] = 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._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LedgerDigestUploads, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LedgerDigestUploads].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LedgerDigestUploads]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class MaintenanceWindowOptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`maintenance_window_options` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + maintenance_window_options_name: str, + **kwargs: Any + ) -> _models.MaintenanceWindowOptions: + """Gets a list of available maintenance windows. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword maintenance_window_options_name: Maintenance window options name. Required. + :paramtype maintenance_window_options_name: str + :return: MaintenanceWindowOptions. The MaintenanceWindowOptions is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceWindowOptions] = kwargs.pop("cls", None) + + _request = build_maintenance_window_options_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_options_name=maintenance_window_options_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceWindowOptions, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class MaintenanceWindowsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`maintenance_windows` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + *, + maintenance_window_name: str, + **kwargs: Any + ) -> _models.MaintenanceWindows: + """Gets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :return: MaintenanceWindows. The MaintenanceWindows is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.MaintenanceWindows + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.MaintenanceWindows] = kwargs.pop("cls", None) + + _request = build_maintenance_windows_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_name=maintenance_window_name, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.MaintenanceWindows, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: _models.MaintenanceWindows, + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: JSON, + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: JSON + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: IO[bytes], + *, + maintenance_window_name: str, + content_type: str = "application/json", + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Required. + :type parameters: IO[bytes] + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :keyword content_type: Body Parameter content-type. Content type parameter for binary body. + Default value is "application/json". + :paramtype content_type: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + server_name: str, + database_name: str, + parameters: Union[_models.MaintenanceWindows, JSON, IO[bytes]], + *, + maintenance_window_name: str, + **kwargs: Any + ) -> None: + """Sets maintenance windows settings for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param parameters: Is one of the following types: MaintenanceWindows, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.MaintenanceWindows or JSON or IO[bytes] + :keyword maintenance_window_name: Maintenance window name. Required. + :paramtype maintenance_window_name: str + :return: None + :rtype: None + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[None] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_maintenance_windows_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + maintenance_window_name=maintenance_window_name, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + +class ManagedDatabaseAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Gets a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_managed_database_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ManagedDatabaseAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. 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: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedDatabaseAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedDatabaseAdvancedThreatProtection: + """Creates or updates a managed database's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed database Advanced Threat Protection state. Is one of the + following types: ManagedDatabaseAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection or JSON or + IO[bytes] + :return: ManagedDatabaseAdvancedThreatProtection. The ManagedDatabaseAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedDatabaseAdvancedThreatProtection] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabaseAdvancedThreatProtection"]: + """Gets a list of managed database's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedDatabaseAdvancedThreatProtection + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_advanced_threat_protection_settings_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseMoveOperationsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_move_operations` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, location_name: str, operation_id: str, **kwargs: Any + ) -> _models.ManagedDatabaseMoveOperationResult: + """Gets a managed database move operation. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :param operation_id: The ID of the managed database move operation. Required. + :type operation_id: str + :return: ManagedDatabaseMoveOperationResult. The ManagedDatabaseMoveOperationResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseMoveOperationResult] = kwargs.pop("cls", None) + + _request = build_managed_database_move_operations_get_request( + resource_group_name=resource_group_name, + location_name=location_name, + operation_id=operation_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseMoveOperationResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_location( + self, + resource_group_name: str, + location_name: str, + *, + only_latest_per_database: Optional[bool] = None, + filter: Optional[str] = None, + **kwargs: Any + ) -> ItemPaged["_models.ManagedDatabaseMoveOperationResult"]: + """Lists managed database move operations. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param location_name: The name of the region where the resource is located. Required. + :type location_name: str + :keyword only_latest_per_database: Whether or not to only get the latest operation for each + database. Has higher priority than $filter. Default value is None. + :paramtype only_latest_per_database: bool + :keyword filter: An OData filter expression that filters elements in the collection. Default + value is None. + :paramtype filter: str + :return: An iterator like instance of ManagedDatabaseMoveOperationResult + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedDatabaseMoveOperationResult] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedDatabaseMoveOperationResult]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_move_operations_list_by_location_request( + resource_group_name=resource_group_name, + location_name=location_name, + subscription_id=self._config.subscription_id, + only_latest_per_database=only_latest_per_database, + filter=filter, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedDatabaseMoveOperationResult], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseQueriesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_queries` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, database_name: str, query_id: str, **kwargs: Any + ) -> _models.ManagedInstanceQuery: + """Get query by query id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param query_id: Required. + :type query_id: str + :return: ManagedInstanceQuery. The ManagedInstanceQuery is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceQuery] = kwargs.pop("cls", None) + + _request = build_managed_database_queries_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + query_id=query_id, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceQuery, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_query( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + query_id: str, + *, + start_time: Optional[str] = None, + end_time: Optional[str] = None, + interval: Optional[Union[str, _models.QueryTimeGrainType]] = None, + **kwargs: Any + ) -> ItemPaged["_models.QueryStatistics"]: + """Get query execution statistics by query id. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param query_id: Required. + :type query_id: str + :keyword start_time: Start time for observed period. Default value is None. + :paramtype start_time: str + :keyword end_time: End time for observed period. Default value is None. + :paramtype end_time: str + :keyword interval: The time step to be used to summarize the metric values. Known values are: + "PT1H" and "P1D". Default value is None. + :paramtype interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :return: An iterator like instance of QueryStatistics + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.QueryStatistics] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.QueryStatistics]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_queries_list_by_query_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + query_id=query_id, + subscription_id=self._config.subscription_id, + start_time=start_time, + end_time=end_time, + interval=interval, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.QueryStatistics], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedDatabaseRestoreDetailsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_restore_details` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + restore_details_name: Union[str, _models.RestoreDetailsName], + **kwargs: Any + ) -> _models.ManagedDatabaseRestoreDetailsResult: + """Gets managed database restore details. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param restore_details_name: The name of the restore details to retrieve. "Default" Required. + :type restore_details_name: str or ~azure.mgmt.sql.models.RestoreDetailsName + :return: ManagedDatabaseRestoreDetailsResult. The ManagedDatabaseRestoreDetailsResult is + compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedDatabaseRestoreDetailsResult + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedDatabaseRestoreDetailsResult] = kwargs.pop("cls", None) + + _request = build_managed_database_restore_details_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + restore_details_name=restore_details_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedDatabaseRestoreDetailsResult, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class ManagedDatabaseTransparentDataEncryptionOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_database_transparent_data_encryption` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Gets a managed database's transparent data encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_managed_database_transparent_data_encryption_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: _models.ManagedTransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. 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: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.ManagedTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ManagedTransparentDataEncryption: + """Updates a database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Is one of the following types: + ManagedTransparentDataEncryption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or JSON or IO[bytes] + :return: ManagedTransparentDataEncryption. The ManagedTransparentDataEncryption is compatible + with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedTransparentDataEncryption] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_database_transparent_data_encryption_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedTransparentDataEncryption"]: + """Gets a list of managed database's transparent data encryptions. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedTransparentDataEncryption + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedTransparentDataEncryption]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_database_transparent_data_encryption_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedTransparentDataEncryption], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstanceAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ManagedInstanceAdvancedThreatProtection: + """Get a managed instance's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ManagedInstanceAdvancedThreatProtection. The ManagedInstanceAdvancedThreatProtection + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_managed_instance_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstanceAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_instance_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ManagedInstanceAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection + :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 ManagedInstanceAdvancedThreatProtection. The + ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ManagedInstanceAdvancedThreatProtection. The + ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. 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 ManagedInstanceAdvancedThreatProtection. The + ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ManagedInstanceAdvancedThreatProtection]: + """Creates or updates Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The managed instance Advanced Threat Protection state. Is one of the + following types: ManagedInstanceAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection or JSON or + IO[bytes] + :return: An instance of LROPoller that returns ManagedInstanceAdvancedThreatProtection. The + ManagedInstanceAdvancedThreatProtection is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ManagedInstanceAdvancedThreatProtection] = 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, + managed_instance_name=managed_instance_name, + advanced_threat_protection_name=advanced_threat_protection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ManagedInstanceAdvancedThreatProtection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedInstanceAdvancedThreatProtection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedInstanceAdvancedThreatProtection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstanceAdvancedThreatProtection"]: + """Get the managed instance's Advanced Threat Protection settings. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstanceAdvancedThreatProtection + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstanceAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstanceAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_advanced_threat_protection_settings_list_by_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstanceAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedInstancePrivateLinkResourcesOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_instance_private_link_resources` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, resource_group_name: str, managed_instance_name: str, group_name: str, **kwargs: Any + ) -> _models.ManagedInstancePrivateLink: + """Gets a private link resource for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param group_name: The name of the private link resource. Required. + :type group_name: str + :return: ManagedInstancePrivateLink. The ManagedInstancePrivateLink is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedInstancePrivateLink] = kwargs.pop("cls", None) + + _request = build_managed_instance_private_link_resources_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + group_name=group_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedInstancePrivateLink, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def list_by_managed_instance( + self, resource_group_name: str, managed_instance_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedInstancePrivateLink"]: + """Gets the private link resources for SQL server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: An iterator like instance of ManagedInstancePrivateLink + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedInstancePrivateLink] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedInstancePrivateLink]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_instance_private_link_resources_list_by_managed_instance_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedInstancePrivateLink], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ManagedLedgerDigestUploadsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`managed_ledger_digest_uploads` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> _models.ManagedLedgerDigestUploads: + """Gets the current ledger digest upload configuration for a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :return: ManagedLedgerDigestUploads. The ManagedLedgerDigestUploads is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedLedgerDigestUploads] = kwargs.pop("cls", None) + + _request = build_managed_ledger_digest_uploads_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ManagedLedgerDigestUploads, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: Union[_models.ManagedLedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_managed_ledger_digest_uploads_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: _models.ManagedLedgerDigestUploads, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Required. + :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads + :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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. 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 None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + parameters: Union[_models.ManagedLedgerDigestUploads, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[None]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :param parameters: The Ledger Digest Storage Endpoint. Is one of the following types: + ManagedLedgerDigestUploads, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ManagedLedgerDigestUploads or JSON or IO[bytes] + :return: An instance of LROPoller that returns None + :rtype: ~azure.core.polling.LROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[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._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + if cls: + return cls(pipeline_response, None, {}) # type: ignore + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + + @distributed_trace + def list_by_database( + self, resource_group_name: str, managed_instance_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.ManagedLedgerDigestUploads"]: + """Gets all ledger digest upload settings on a database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of ManagedLedgerDigestUploads + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ManagedLedgerDigestUploads]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_managed_ledger_digest_uploads_list_by_database_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ManagedLedgerDigestUploads], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + def _disable_initial( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_managed_ledger_digest_uploads_disable_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_disable( + self, + resource_group_name: str, + managed_instance_name: str, + database_name: str, + ledger_digest_uploads: Union[str, _models.ManagedLedgerDigestUploadsName], + **kwargs: Any + ) -> LROPoller[_models.ManagedLedgerDigestUploads]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param ledger_digest_uploads: "current" Required. + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.ManagedLedgerDigestUploadsName + :return: An instance of LROPoller that returns ManagedLedgerDigestUploads. The + ManagedLedgerDigestUploads is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ManagedLedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ManagedLedgerDigestUploads] = 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._disable_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.ManagedLedgerDigestUploads, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ManagedLedgerDigestUploads].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ManagedLedgerDigestUploads]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class ServerAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_advanced_threat_protection_settings` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + **kwargs: Any + ) -> _models.ServerAdvancedThreatProtection: + """Get a server's Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :return: ServerAdvancedThreatProtection. The ServerAdvancedThreatProtection is compatible with + MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) + + _request = build_server_advanced_threat_protection_settings_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAdvancedThreatProtection, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ServerAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_advanced_threat_protection_settings_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + advanced_threat_protection_name=advanced_threat_protection_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: _models.ServerAdvancedThreatProtection, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection + :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 ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. 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 ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], + parameters: Union[_models.ServerAdvancedThreatProtection, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.ServerAdvancedThreatProtection]: + """Creates or updates an Advanced Threat Protection state. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param advanced_threat_protection_name: The name of the Advanced Threat Protection state. + "Default" Required. + :type advanced_threat_protection_name: str or + ~azure.mgmt.sql.models.AdvancedThreatProtectionName + :param parameters: The server Advanced Threat Protection state. Is one of the following types: + ServerAdvancedThreatProtection, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection or JSON or IO[bytes] + :return: An instance of LROPoller that returns ServerAdvancedThreatProtection. The + ServerAdvancedThreatProtection is compatible with MutableMapping + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAdvancedThreatProtection] = 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, + advanced_threat_protection_name=advanced_threat_protection_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.ServerAdvancedThreatProtection, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.ServerAdvancedThreatProtection].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.ServerAdvancedThreatProtection]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_server( + self, resource_group_name: str, server_name: str, **kwargs: Any + ) -> ItemPaged["_models.ServerAdvancedThreatProtection"]: + """Get a list of the server's Advanced Threat Protection states. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: An iterator like instance of ServerAdvancedThreatProtection + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[List[_models.ServerAdvancedThreatProtection]] = kwargs.pop("cls", None) + + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_server_advanced_threat_protection_settings_list_by_server_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + return _request + + def extract_data(pipeline_response): + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.ServerAdvancedThreatProtection], + deserialized.get("value", []), + ) + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return deserialized.get("nextLink") or None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + +class ServerAutomaticTuningOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`server_automatic_tuning` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerAutomaticTuning: + """Retrieves server automatic tuning options. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) + + _request = build_server_automatic_tuning_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + parameters: _models.ServerAutomaticTuning, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def update( + self, + resource_group_name: str, + server_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. 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: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def update( + self, + resource_group_name: str, + server_name: str, + parameters: Union[_models.ServerAutomaticTuning, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.ServerAutomaticTuning: + """Update automatic tuning options on server. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param parameters: The requested automatic tuning resource state. Is one of the following + types: ServerAutomaticTuning, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning or JSON or IO[bytes] + :return: ServerAutomaticTuning. The ServerAutomaticTuning is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_server_automatic_tuning_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.ServerAutomaticTuning, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class SqlAgentOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`sql_agent` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> _models.SqlAgentConfiguration: + """Gets current instance sql agent configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) + + _request = build_sql_agent_get_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlAgentConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: _models.SqlAgentConfiguration, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Required. + :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: 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: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def create_or_update( + self, + resource_group_name: str, + managed_instance_name: str, + parameters: Union[_models.SqlAgentConfiguration, JSON, IO[bytes]], + **kwargs: Any + ) -> _models.SqlAgentConfiguration: + """Puts new sql agent configuration to instance. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. Required. + :type managed_instance_name: str + :param parameters: Is one of the following types: SqlAgentConfiguration, JSON, IO[bytes] + Required. + :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration or JSON or IO[bytes] + :return: SqlAgentConfiguration. The SqlAgentConfiguration is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_sql_agent_create_or_update_request( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.SqlAgentConfiguration, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + +class TransparentDataEncryptionsOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`transparent_data_encryptions` attribute. """ - models = _models - def __init__(self, *args, **kwargs) -> None: input_args = list(args) self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: - """Lists all of the available SQL Rest API operations. + def get( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> _models.LogicalDatabaseTransparentDataEncryption: + """Gets a logical database's transparent data encryption. - :return: An iterator like instance of either Operation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Operation] + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: LogicalDatabaseTransparentDataEncryption. The LogicalDatabaseTransparentDataEncryption + is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_get_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_or_update_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + content_type = content_type or "application/json" + _content = None + if isinstance(parameters, (IOBase, bytes)): + _content = parameters + else: + _content = json.dumps(parameters, cls=SdkJSONEncoder, exclude_readonly=True) # type: ignore + + _request = build_transparent_data_encryptions_create_or_update_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + content_type=content_type, + api_version=self._config.api_version, + content=_content, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 201, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 201: + response_headers["Azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("Azure-AsyncOperation") + ) + + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: _models.LogicalDatabaseTransparentDataEncryption, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption + :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 LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: JSON, + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Required. + :type parameters: JSON + :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. + Default value is "application/json". + :paramtype content_type: str + :return: An instance of LROPoller that returns LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @overload + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: IO[bytes], + *, + content_type: str = "application/json", + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. 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 LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes]], + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Updates a logical database's transparent data encryption configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. Is one of the following types: + LogicalDatabaseTransparentDataEncryption, JSON, IO[bytes] Required. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or JSON or + IO[bytes] + :return: An instance of LROPoller that returns LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _params = kwargs.pop("params", {}) or {} + + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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, + tde_name=tde_name, + parameters=parameters, + content_type=content_type, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + @distributed_trace + def list_by_database( + self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any + ) -> ItemPaged["_models.LogicalDatabaseTransparentDataEncryption"]: + """Gets a list of the logical database's transparent data encryption. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :return: An iterator like instance of LogicalDatabaseTransparentDataEncryption + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + _params = kwargs.pop("params", {}) or {} - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OperationListResult] = kwargs.pop("cls", None) + cls: ClsType[List[_models.LogicalDatabaseTransparentDataEncryption]] = kwargs.pop("cls", None) error_map: MutableMapping = { 401: ClientAuthenticationError, @@ -100,12 +93371,21 @@ def list(self, **kwargs: Any) -> ItemPaged["_models.Operation"]: def prepare_request(next_link=None): if not next_link: - _request = build_list_request( - api_version=api_version, + _request = build_transparent_data_encryptions_list_by_database_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, headers=_headers, params=_params, ) - _request.url = self._client.format_url(_request.url) + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) else: # make call to next link with the client's api-version @@ -120,16 +93400,24 @@ def prepare_request(next_link=None): _request = HttpRequest( "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" + path_format_arguments = { + "endpoint": self._serialize.url( + "self._config.base_url", self._config.base_url, "str", skip_quote=True + ), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + return _request def extract_data(pipeline_response): - deserialized = self._deserialize("OperationListResult", pipeline_response) - list_of_elem = deserialized.value + deserialized = pipeline_response.http_response.json() + list_of_elem = _deserialize( + List[_models.LogicalDatabaseTransparentDataEncryption], + deserialized.get("value", []), + ) if cls: list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) + return deserialized.get("nextLink") or None, iter(list_of_elem) def get_next(next_link=None): _request = prepare_request(next_link) @@ -142,12 +93430,402 @@ 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( + error = _failsafe_deserialize( _models.ErrorResponse, - pipeline_response, + response, ) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) return pipeline_response return ItemPaged(get_next, extract_data) + + def _resume_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_resume_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_resume( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Resume ongoing logical database's Transparent Data Encryption scan configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of LROPoller that returns LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + def _suspend_initial( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> Iterator[bytes]: + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + + _request = build_transparent_data_encryptions_suspend_request( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + subscription_id=self._config.subscription_id, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace + def begin_suspend( + self, + resource_group_name: str, + server_name: str, + database_name: str, + tde_name: Union[str, _models.TransparentDataEncryptionName], + **kwargs: Any + ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: + """Suspend ongoing logical database's Transparent Data Encryption scan configuration. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param server_name: The name of the server. Required. + :type server_name: str + :param database_name: The name of the database. Required. + :type database_name: str + :param tde_name: The name of the transparent data encryption configuration. "current" Required. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :return: An instance of LROPoller that returns LogicalDatabaseTransparentDataEncryption. The + LogicalDatabaseTransparentDataEncryption is compatible with MutableMapping + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + tde_name=tde_name, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) + + def get_long_running_output(pipeline_response): + response_headers = {} + response = pipeline_response.http_response + response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) + response_headers["Retry-After"] = self._deserialize("int", response.headers.get("Retry-After")) + + deserialized = _deserialize(_models.LogicalDatabaseTransparentDataEncryption, response.json()) + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + return deserialized + + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + + if polling is True: + polling_method: PollingMethod = cast( + PollingMethod, ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + ) + elif polling is False: + polling_method = cast(PollingMethod, NoPolling()) + else: + polling_method = polling + if cont_token: + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, + ) + return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) + + +class CapabilitiesOperations: + """ + .. warning:: + **DO NOT** instantiate this class directly. + + Instead, you should access the following operations through + :class:`~azure.mgmt.sql.SqlClient`'s + :attr:`capabilities` attribute. + """ + + def __init__(self, *args, **kwargs) -> None: + input_args = list(args) + self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") + self._config: SqlClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") + + @distributed_trace + def list_by_location( + self, location_name: str, *, include: Optional[Union[str, _models.CapabilityGroup]] = None, **kwargs: Any + ) -> _models.LocationCapabilities: + """Gets the subscription capabilities available for the specified location. + + :param location_name: The location name whose capabilities are retrieved. Required. + :type location_name: str + :keyword include: If specified, restricts the response to only include the selected item. Known + values are: "supportedEditions", "supportedElasticPoolEditions", + "supportedManagedInstanceVersions", "supportedInstancePoolEditions", + "supportedManagedInstanceEditions", and "supportedJobAgentVersions". Default value is None. + :paramtype include: str or ~azure.mgmt.sql.models.CapabilityGroup + :return: LocationCapabilities. The LocationCapabilities is compatible with MutableMapping + :rtype: ~azure.mgmt.sql.models.LocationCapabilities + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = kwargs.pop("params", {}) or {} + + cls: ClsType[_models.LocationCapabilities] = kwargs.pop("cls", None) + + _request = build_capabilities_list_by_location_request( + location_name=location_name, + subscription_id=self._config.subscription_id, + include=include, + api_version=self._config.api_version, + headers=_headers, + params=_params, + ) + path_format_arguments = { + "endpoint": self._serialize.url("self._config.base_url", self._config.base_url, "str", skip_quote=True), + } + _request.url = self._client.format_url(_request.url, **path_format_arguments) + + _decompress = kwargs.pop("decompress", True) + _stream = kwargs.pop("stream", False) + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + if _stream: + try: + response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = _failsafe_deserialize( + _models.ErrorResponse, + response, + ) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if _stream: + deserialized = response.iter_bytes() if _decompress else response.iter_raw() + else: + deserialized = _deserialize(_models.LocationCapabilities, response.json()) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore 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 deleted file mode 100644 index cfc639928d42..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Optional, TypeVar, Union, cast -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, outbound_rule_fqdn: 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "outboundRuleFqdn": _SERIALIZER.url("outbound_rule_fqdn", outbound_rule_fqdn, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class OutboundFirewallRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`outbound_firewall_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.OutboundFirewallRule"]: - """Gets all outbound firewall rules on a server. - - :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 - :return: An iterator like instance of either OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> _models.OutboundFirewallRule: - """Gets an outbound firewall rule. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :return: OutboundFirewallRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("OutboundFirewallRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> LROPoller[_models.OutboundFirewallRule]: - """Create a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :return: An instance of LROPoller that returns either OutboundFirewallRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.OutboundFirewallRule] - :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", self._config.api_version)) - cls: ClsType[_models.OutboundFirewallRule] = 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, - outbound_rule_fqdn=outbound_rule_fqdn, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("OutboundFirewallRule", pipeline_response.http_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.OutboundFirewallRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.OutboundFirewallRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, outbound_rule_fqdn: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a outbound firewall rule with a given name. - - :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 outbound_rule_fqdn: Required. - :type outbound_rule_fqdn: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - outbound_rule_fqdn=outbound_rule_fqdn, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_patch.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_patch.py index f7dd32510333..87676c65a8f0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_patch.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_patch.py @@ -1,14 +1,15 @@ -# ------------------------------------ -# Copyright (c) Microsoft Corporation. -# Licensed under the MIT License. -# ------------------------------------ +# 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. +# -------------------------------------------------------------------------- """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ -from typing import List -__all__: List[str] = [] # Add all objects you want publicly available to users at this package level + +__all__: list[str] = [] # Add all objects you want publicly available to users at this package level def patch_sdk(): 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 deleted file mode 100644 index 48e5ceda7f15..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py +++ /dev/null @@ -1,691 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - private_endpoint_connection_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - private_endpoint_connection_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", "2025-01-01")) - 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}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - private_endpoint_connection_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateEndpointConnections/{privateEndpointConnectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "privateEndpointConnectionName": _SERIALIZER.url( - "private_endpoint_connection_name", private_endpoint_connection_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateEndpointConnectionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`private_endpoint_connections` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateEndpointConnection"]: - """Gets all private endpoint connections on a server. - - :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 - :return: An iterator like instance of either PrivateEndpointConnection or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.PrivateEndpointConnection] - :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", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> _models.PrivateEndpointConnection: - """Gets a private endpoint connection. - - :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 private_endpoint_connection_name: The name of the private endpoint connection. Required. - :type private_endpoint_connection_name: str - :return: PrivateEndpointConnection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.PrivateEndpointConnection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateEndpointConnection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("PrivateEndpointConnection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "PrivateEndpointConnection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: _models.PrivateEndpointConnection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection - :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 PrivateEndpointConnection or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: 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 PrivateEndpointConnection or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - private_endpoint_connection_name: str, - parameters: Union[_models.PrivateEndpointConnection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PrivateEndpointConnection]: - """Approve or reject a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :param parameters: Is either a PrivateEndpointConnection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.PrivateEndpointConnection or IO[bytes] - :return: An instance of LROPoller that returns either PrivateEndpointConnection or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.PrivateEndpointConnection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PrivateEndpointConnection] = 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, - private_endpoint_connection_name=private_endpoint_connection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PrivateEndpointConnection", pipeline_response.http_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.PrivateEndpointConnection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PrivateEndpointConnection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, private_endpoint_connection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a private endpoint connection with a given name. - - :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 private_endpoint_connection_name: Required. - :type private_endpoint_connection_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - private_endpoint_connection_name=private_endpoint_connection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index c03c5642d37e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py +++ /dev/null @@ -1,272 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/privateLinkResources/{groupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "groupName": _SERIALIZER.url("group_name", 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class PrivateLinkResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`private_link_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.PrivateLinkResource"]: - """Gets the private link resources for SQL server. - - :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 - :return: An iterator like instance of either PrivateLinkResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.PrivateLinkResource] - :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", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResourceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("PrivateLinkResourceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, group_name: str, **kwargs: Any - ) -> _models.PrivateLinkResource: - """Gets a private link resource for SQL server. - - :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 group_name: The name of the private link resource. Required. - :type group_name: str - :return: PrivateLinkResource or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.PrivateLinkResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.PrivateLinkResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - group_name=group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("PrivateLinkResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index b172d516d82a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py +++ /dev/null @@ -1,232 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_update_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/recommendedSensitivityLabels", - ) - 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"), - "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) - - -class RecommendedSensitivityLabelsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`recommended_sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.RecommendedSensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.RecommendedSensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update recommended sensitivity labels states of a given database using an operations batch. - - :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 parameters: Is either a RecommendedSensitivityLabelUpdateList type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "RecommendedSensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index c2ef45a2e241..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py +++ /dev/null @@ -1,296 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RecoverableDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`recoverable_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.RecoverableDatabase"]: - """Gets a list of recoverable databases. - - :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 - :return: An iterator like instance of either RecoverableDatabase or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RecoverableDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RecoverableDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RecoverableDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.RecoverableDatabase: - """Gets a recoverable database. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: RecoverableDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecoverableDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecoverableDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecoverableDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 3cf6e67c1854..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py +++ /dev/null @@ -1,277 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - recoverable_database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/recoverableDatabases/{recoverableDatabaseName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "recoverableDatabaseName": _SERIALIZER.url("recoverable_database_name", recoverable_database_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RecoverableManagedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`recoverable_managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.RecoverableManagedDatabase"]: - """Gets a list of recoverable managed databases. - - :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 iterator like instance of either RecoverableManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RecoverableManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RecoverableManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RecoverableManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, recoverable_database_name: str, **kwargs: Any - ) -> _models.RecoverableManagedDatabase: - """Gets a recoverable managed database. - - :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 recoverable_database_name: Required. - :type recoverable_database_name: str - :return: RecoverableManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RecoverableManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RecoverableManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - recoverable_database_name=recoverable_database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RecoverableManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index a7f4aaccc55d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ /dev/null @@ -1,1393 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_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", "2025-01-01")) - 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}", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - 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", "2025-01-01")) - 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}", - ) - 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: - _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", "2025-01-01")) - 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}", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **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", "2025-01-01")) - 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}", - ) - 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", "2025-01-01")) - 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}/failover", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_failover_allow_data_loss_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", "2025-01-01")) - 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}/forceFailoverAllowDataLoss", - ) - 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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ReplicationLinksOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`replication_links` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.ReplicationLink"]: - """Gets a list of replication links on database. - - :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 - :return: An iterator like instance of either ReplicationLink or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ReplicationLink] - :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", self._config.api_version)) - cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ReplicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> _models.ReplicationLink: - """Gets a replication link. - - :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: The name of the replication link. Required. - :type link_id: str - :return: ReplicationLink or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ReplicationLink - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ReplicationLink] = kwargs.pop("cls", None) - - _request = build_get_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, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ReplicationLink", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - 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 - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # 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", self._config.api_version)) - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the replication link. - - :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 - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - 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 - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - 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", self._config.api_version)) - 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 - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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 - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> LROPoller[_models.ReplicationLink]: - """Fails over from the current primary server to this server. - - :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: The name of the replication link. Required. - :type link_id: 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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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_allow_data_loss_initial( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_failover_allow_data_loss_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, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_failover_allow_data_loss( - self, resource_group_name: str, server_name: str, database_name: str, link_id: str, **kwargs: Any - ) -> LROPoller[_models.ReplicationLink]: - """Fails over from the current primary server to this server allowing data loss. - - :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: The name of the replication link. Required. - :type link_id: 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: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ReplicationLink", pipeline_response.http_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 - ) - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ReplicationLink"]: - """Gets a list of replication links. - - :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 - :return: An iterator like instance of either ReplicationLink or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ReplicationLink] - :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", self._config.api_version)) - cls: ClsType[_models.ReplicationLinkListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ReplicationLinkListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 8c02348ec9c9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py +++ /dev/null @@ -1,299 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - restorable_dropped_database_id: str, - subscription_id: str, - *, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_id, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RestorableDroppedDatabasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`restorable_dropped_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.RestorableDroppedDatabase"]: - """Gets a list of restorable dropped databases. - - :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 - :return: An iterator like instance of either RestorableDroppedDatabase or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorableDroppedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RestorableDroppedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - restorable_dropped_database_id: str, - expand: Optional[str] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> _models.RestorableDroppedDatabase: - """Gets a restorable dropped database. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: RestorableDroppedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - expand=expand, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorableDroppedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index dce86f5b5ad6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py +++ /dev/null @@ -1,279 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - restorable_dropped_database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "restorableDroppedDatabaseId": _SERIALIZER.url( - "restorable_dropped_database_id", restorable_dropped_database_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class RestorableDroppedManagedDatabasesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`restorable_dropped_managed_databases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.RestorableDroppedManagedDatabase"]: - """Gets a list of restorable dropped managed databases. - - :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 iterator like instance of either RestorableDroppedManagedDatabase or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorableDroppedManagedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedManagedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RestorableDroppedManagedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, restorable_dropped_database_id: str, **kwargs: Any - ) -> _models.RestorableDroppedManagedDatabase: - """Gets a restorable dropped managed database. - - :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 restorable_dropped_database_id: Required. - :type restorable_dropped_database_id: str - :return: RestorableDroppedManagedDatabase or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorableDroppedManagedDatabase - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorableDroppedManagedDatabase] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - restorable_dropped_database_id=restorable_dropped_database_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorableDroppedManagedDatabase", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index d02f1fc972fd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py +++ /dev/null @@ -1,638 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/restorePoints", - ) - 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"), - "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_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - restore_point_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}", - ) - 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"), - "restorePointName": _SERIALIZER.url("restore_point_name", restore_point_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - restore_point_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/restorePoints/{restorePointName}", - ) - 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"), - "restorePointName": _SERIALIZER.url("restore_point_name", restore_point_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class RestorePointsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`restore_points` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.RestorePoint"]: - """Gets a list of database restore points. - - :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 - :return: An iterator like instance of either RestorePoint or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.RestorePoint] - :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", self._config.api_version)) - cls: ClsType[_models.RestorePointListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("RestorePointListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _create_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "CreateDatabaseRestorePointDefinition") - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.CreateDatabaseRestorePointDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. Required. - :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition - :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 RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. 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 RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.CreateDatabaseRestorePointDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.RestorePoint]: - """Creates a restore point for a data warehouse. - - :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 parameters: The definition for creating the restore point of this database. Is either a - CreateDatabaseRestorePointDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CreateDatabaseRestorePointDefinition or IO[bytes] - :return: An instance of LROPoller that returns either RestorePoint or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RestorePoint] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.RestorePoint] = 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_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("RestorePoint", pipeline_response.http_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.RestorePoint].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RestorePoint]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any - ) -> _models.RestorePoint: - """Gets a restore point. - - :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 restore_point_name: The name of the restore point. Required. - :type restore_point_name: str - :return: RestorePoint or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.RestorePoint - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.RestorePoint] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - restore_point_name=restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("RestorePoint", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, restore_point_name: str, **kwargs: Any - ) -> None: - """Deletes a restore point. - - :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 restore_point_name: The name of the restore point. Required. - :type restore_point_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - restore_point_name=restore_point_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index e625d8854928..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py +++ /dev/null @@ -1,1400 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_current_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if count is not None: - _params["$count"] = _SERIALIZER.query("count", count, "bool") - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - 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}/currentSensitivityLabels", - ) - 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"), - "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_list_recommended_by_database_request( # pylint: disable=name-too-long - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if skip_token is not None: - _params["$skipToken"] = _SERIALIZER.query("skip_token", skip_token, "str") - if include_disabled_recommendations is not None: - _params["includeDisabledRecommendations"] = _SERIALIZER.query( - "include_disabled_recommendations", include_disabled_recommendations, "bool" - ) - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_disable_recommendation_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_enable_recommendation_request( - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable", - ) - 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"), - "schemaName": _SERIALIZER.url("schema_name", schema_name, "str"), - "tableName": _SERIALIZER.url("table_name", table_name, "str"), - "columnName": _SERIALIZER.url("column_name", column_name, "str"), - "sensitivityLabelSource": _SERIALIZER.url("sensitivity_label_source", sensitivity_label_source, "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_list_by_database_request( - resource_group_name: str, - server_name: str, - database_name: str, - subscription_id: str, - *, - filter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels", - ) - 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"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if filter is not None: - _params["$filter"] = _SERIALIZER.query("filter", filter, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SensitivityLabelsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sensitivity_labels` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_current_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - skip_token: Optional[str] = None, - count: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 skip_token: Default value is None. - :type skip_token: str - :param count: Default value is None. - :type count: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_current_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - count=count, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: _models.SensitivityLabelUpdateList, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 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: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - parameters: Union[_models.SensitivityLabelUpdateList, IO[bytes]], - **kwargs: Any - ) -> None: - """Update sensitivity labels of a given database using an operations batch. - - :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 parameters: Is either a SensitivityLabelUpdateList type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabelUpdateList or IO[bytes] - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[None] = 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, "SensitivityLabelUpdateList") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_recommended_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - skip_token: Optional[str] = None, - include_disabled_recommendations: Optional[bool] = None, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 skip_token: Default value is None. - :type skip_token: str - :param include_disabled_recommendations: Specifies whether to include disabled recommendations - or not. Default value is None. - :type include_disabled_recommendations: bool - :param filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_recommended_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - skip_token=skip_token, - include_disabled_recommendations=include_disabled_recommendations, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - sensitivity_label_source: Union[str, _models.SensitivityLabelSource], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Gets the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param sensitivity_label_source: The source of the sensitivity label. Known values are: - "current" and "recommended". Required. - :type sensitivity_label_source: str or ~azure.mgmt.sql.models.SensitivityLabelSource - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SensitivityLabel] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - sensitivity_label_source=sensitivity_label_source, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: _models.SensitivityLabel, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. 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: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - parameters: Union[_models.SensitivityLabel, IO[bytes]], - **kwargs: Any - ) -> _models.SensitivityLabel: - """Creates or updates the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :param parameters: The column sensitivity label resource. Is either a SensitivityLabel type or - a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SensitivityLabel or IO[bytes] - :return: SensitivityLabel or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SensitivityLabel - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SensitivityLabel] = 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, "SensitivityLabel") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SensitivityLabel", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Deletes the sensitivity label of a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["current"] = kwargs.pop("sensitivity_label_source", "current") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def disable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Disables sensitivity recommendations on a given column. - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_disable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def enable_recommendation( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - database_name: str, - schema_name: str, - table_name: str, - column_name: str, - **kwargs: Any - ) -> None: - """Enables sensitivity recommendations on a given column (recommendations are enabled by default - on all columns). - - :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 schema_name: The name of the schema. Required. - :type schema_name: str - :param table_name: The name of the table. Required. - :type table_name: str - :param column_name: The name of the column. Required. - :type column_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - sensitivity_label_source: Literal["recommended"] = kwargs.pop("sensitivity_label_source", "recommended") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_enable_recommendation_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - schema_name=schema_name, - table_name=table_name, - column_name=column_name, - subscription_id=self._config.subscription_id, - sensitivity_label_source=sensitivity_label_source, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_by_database( - self, - resource_group_name: str, - server_name: str, - database_name: str, - filter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SensitivityLabel"]: - """Gets the sensitivity labels of a given database. - - :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 filter: An OData filter expression that filters elements in the collection. Default - value is None. - :type filter: str - :return: An iterator like instance of either SensitivityLabel or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SensitivityLabel] - :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", self._config.api_version)) - cls: ClsType[_models.SensitivityLabelListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - filter=filter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SensitivityLabelListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 96c17a3a21fc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advanced_threat_protection_settings_operations.py +++ /dev/null @@ -1,549 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - 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", "2025-01-01")) - 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}/advancedThreatProtectionSettings/{advancedThreatProtectionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "advancedThreatProtectionName": _SERIALIZER.url( - "advanced_threat_protection_name", advanced_threat_protection_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerAdvancedThreatProtectionSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_advanced_threat_protection_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerAdvancedThreatProtection"]: - """Get a list of the server's Advanced Threat Protection states. - - :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 - :return: An iterator like instance of either ServerAdvancedThreatProtection or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalServerAdvancedThreatProtectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerAdvancedThreatProtectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - **kwargs: Any - ) -> _models.ServerAdvancedThreatProtection: - """Get a server's Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :return: ServerAdvancedThreatProtection or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAdvancedThreatProtection] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAdvancedThreatProtection") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - advanced_threat_protection_name=advanced_threat_protection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: _models.ServerAdvancedThreatProtection, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection - :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 ServerAdvancedThreatProtection or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. 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 ServerAdvancedThreatProtection or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - advanced_threat_protection_name: Union[str, _models.AdvancedThreatProtectionName], - parameters: Union[_models.ServerAdvancedThreatProtection, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerAdvancedThreatProtection]: - """Creates or updates an Advanced Threat Protection state. - - :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 advanced_threat_protection_name: The name of the Advanced Threat Protection state. - "Default" Required. - :type advanced_threat_protection_name: str or - ~azure.mgmt.sql.models.AdvancedThreatProtectionName - :param parameters: The server Advanced Threat Protection state. Is either a - ServerAdvancedThreatProtection type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAdvancedThreatProtection or IO[bytes] - :return: An instance of LROPoller that returns either ServerAdvancedThreatProtection or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAdvancedThreatProtection] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAdvancedThreatProtection] = 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, - advanced_threat_protection_name=advanced_threat_protection_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAdvancedThreatProtection", pipeline_response.http_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.ServerAdvancedThreatProtection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerAdvancedThreatProtection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 5819cc909258..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py +++ /dev/null @@ -1,427 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, advisor_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, advisor_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", "2025-01-01")) - 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}/advisors/{advisorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "advisorName": _SERIALIZER.url("advisor_name", advisor_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerAdvisorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_advisors` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> List[_models.Advisor]: - """Gets a list of server advisors. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: list of Advisor or the result of cls(response) - :rtype: list[~azure.mgmt.sql.models.Advisor] - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[List[_models.Advisor]] = kwargs.pop("cls", None) - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("[Advisor]", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, advisor_name: str, **kwargs: Any) -> _models.Advisor: - """Gets a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Advisor] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: _models.Advisor, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. 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: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - server_name: str, - advisor_name: str, - parameters: Union[_models.Advisor, IO[bytes]], - **kwargs: Any - ) -> _models.Advisor: - """Updates a server advisor. - - :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 advisor_name: The name of the Server Advisor. Required. - :type advisor_name: str - :param parameters: The requested advisor resource state. Is either a Advisor type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.Advisor or IO[bytes] - :return: Advisor or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Advisor - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Advisor] = 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, "Advisor") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - advisor_name=advisor_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Advisor", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index a0c62fc77dfe..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py +++ /dev/null @@ -1,313 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request(resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/automaticTuning/current", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/automaticTuning/current", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerAutomaticTuningOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_automatic_tuning` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerAutomaticTuning: - """Retrieves server automatic tuning options. - - :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 - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAutomaticTuning] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerAutomaticTuning, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. 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: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerAutomaticTuning, IO[bytes]], - **kwargs: Any - ) -> _models.ServerAutomaticTuning: - """Update automatic tuning options on server. - - :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 parameters: The requested automatic tuning resource state. Is either a - ServerAutomaticTuning type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAutomaticTuning or IO[bytes] - :return: ServerAutomaticTuning or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAutomaticTuning - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAutomaticTuning] = 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, "ServerAutomaticTuning") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAutomaticTuning", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 0da236952b6b..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py +++ /dev/null @@ -1,703 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - 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}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators/{administratorName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "administratorName": _SERIALIZER.url("administrator_name", administrator_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerAzureADAdministratorsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_azure_ad_administrators` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerAzureADAdministrator"]: - """Gets a list of Azure Active Directory administrators in a server. - - :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 - :return: An iterator like instance of either ServerAzureADAdministrator or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", self._config.api_version)) - cls: ClsType[_models.AdministratorListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AdministratorListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> _models.ServerAzureADAdministrator: - """Gets a Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :return: ServerAzureADAdministrator or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAzureADAdministrator - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAzureADAdministrator] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAzureADAdministrator") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: _models.ServerAzureADAdministrator, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator - :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 ServerAzureADAdministrator or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. 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 ServerAzureADAdministrator or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - parameters: Union[_models.ServerAzureADAdministrator, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADAdministrator]: - """Creates or updates an existing Azure Active Directory administrator. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :param parameters: The requested Azure Active Directory administrator Resource state. Is either - a ServerAzureADAdministrator type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator or IO[bytes] - :return: An instance of LROPoller that returns either ServerAzureADAdministrator or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAzureADAdministrator] = 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, - administrator_name=administrator_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAzureADAdministrator", pipeline_response.http_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.ServerAzureADAdministrator].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerAzureADAdministrator]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - server_name: str, - administrator_name: Union[str, _models.AdministratorName], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes the Azure Active Directory administrator with the given name. - - :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 administrator_name: The name of server active directory administrator. "ActiveDirectory" - Required. - :type administrator_name: str or ~azure.mgmt.sql.models.AdministratorName - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - administrator_name=administrator_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 2e5adacdce3e..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py +++ /dev/null @@ -1,709 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - 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}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "authenticationName": _SERIALIZER.url("authentication_name", authentication_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerAzureADOnlyAuthenticationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_azure_ad_only_authentications` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerAzureADOnlyAuthentication"]: - """Gets a list of server Azure Active Directory only authentications. - - :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 - :return: An iterator like instance of either ServerAzureADOnlyAuthentication or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", self._config.api_version)) - cls: ClsType[_models.AzureADOnlyAuthListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("AzureADOnlyAuthListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> _models.ServerAzureADOnlyAuthentication: - """Gets a specific Azure Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :return: ServerAzureADOnlyAuthentication or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerAzureADOnlyAuthentication] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerAzureADOnlyAuthentication") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: _models.ServerAzureADOnlyAuthentication, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication - :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 ServerAzureADOnlyAuthentication or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. 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 ServerAzureADOnlyAuthentication or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - parameters: Union[_models.ServerAzureADOnlyAuthentication, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerAzureADOnlyAuthentication]: - """Sets Server Active Directory only authentication property or updates an existing server Active - Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :param parameters: The required parameters for creating or updating an Active Directory only - authentication property. Is either a ServerAzureADOnlyAuthentication type or a IO[bytes] type. - Required. - :type parameters: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication or IO[bytes] - :return: An instance of LROPoller that returns either ServerAzureADOnlyAuthentication or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerAzureADOnlyAuthentication] = 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, - authentication_name=authentication_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerAzureADOnlyAuthentication", pipeline_response.http_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.ServerAzureADOnlyAuthentication].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerAzureADOnlyAuthentication]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - server_name: str, - authentication_name: Union[str, _models.AuthenticationName], - **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing server Active Directory only authentication property. - - :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 authentication_name: The name of server azure active directory only authentication. - "Default" Required. - :type authentication_name: str or ~azure.mgmt.sql.models.AuthenticationName - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - authentication_name=authentication_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 5d3b2db67d3f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py +++ /dev/null @@ -1,514 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Literal, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/auditingSettings/{blobAuditingPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/auditingSettings/{blobAuditingPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "blobAuditingPolicyName": _SERIALIZER.url("blob_auditing_policy_name", blob_auditing_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerBlobAuditingPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_blob_auditing_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerBlobAuditingPolicy"]: - """Lists auditing settings of a server. - - :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 - :return: An iterator like instance of either ServerBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ServerBlobAuditingPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerBlobAuditingPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, **kwargs: Any) -> _models.ServerBlobAuditingPolicy: - """Gets a server's blob auditing policy. - - :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 - :return: ServerBlobAuditingPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerBlobAuditingPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerBlobAuditingPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerBlobAuditingPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy - :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 ServerBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. 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 ServerBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerBlobAuditingPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerBlobAuditingPolicy]: - """Creates or updates a server's blob auditing policy. - - :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 parameters: Properties of blob auditing policy. Is either a ServerBlobAuditingPolicy - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerBlobAuditingPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ServerBlobAuditingPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerBlobAuditingPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - blob_auditing_policy_name: Literal["default"] = kwargs.pop("blob_auditing_policy_name", "default") - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerBlobAuditingPolicy] = 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, - parameters=parameters, - blob_auditing_policy_name=blob_auditing_policy_name, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerBlobAuditingPolicy", pipeline_response.http_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.ServerBlobAuditingPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerBlobAuditingPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 1237be1c1fb3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_configuration_options_operations.py +++ /dev/null @@ -1,545 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_managed_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "serverConfigurationOptionName": _SERIALIZER.url( - "server_configuration_option_name", server_configuration_option_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - 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", "2025-01-01")) - 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}/serverConfigurationOptions/{serverConfigurationOptionName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "serverConfigurationOptionName": _SERIALIZER.url( - "server_configuration_option_name", server_configuration_option_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerConfigurationOptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_configuration_options` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_managed_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerConfigurationOption"]: - """Gets a list of managed instance server configuration options. - - :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 iterator like instance of either ServerConfigurationOption or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConfigurationOption] - :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", self._config.api_version)) - cls: ClsType[_models.ServerConfigurationOptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_managed_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConfigurationOptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - **kwargs: Any - ) -> _models.ServerConfigurationOption: - """Gets managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :return: ServerConfigurationOption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConfigurationOption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerConfigurationOption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerConfigurationOption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: Union[_models.ServerConfigurationOption, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerConfigurationOption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: _models.ServerConfigurationOption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption - :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 ServerConfigurationOption or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option 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 ServerConfigurationOption or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - server_configuration_option_name: Union[str, _models.ServerConfigurationOptionName], - parameters: Union[_models.ServerConfigurationOption, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerConfigurationOption]: - """Updates managed instance server configuration option. - - :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 server_configuration_option_name: The name of the server configuration option. - "allowPolybaseExport" Required. - :type server_configuration_option_name: str or - ~azure.mgmt.sql.models.ServerConfigurationOptionName - :param parameters: Server configuration option parameters. Is either a - ServerConfigurationOption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConfigurationOption or IO[bytes] - :return: An instance of LROPoller that returns either ServerConfigurationOption or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConfigurationOption] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerConfigurationOption] = 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, - managed_instance_name=managed_instance_name, - server_configuration_option_name=server_configuration_option_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerConfigurationOption", pipeline_response.http_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.ServerConfigurationOption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerConfigurationOption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 10641984b9be..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py +++ /dev/null @@ -1,537 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - 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", "2025-01-01")) - 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}/connectionPolicies/{connectionPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "connectionPolicyName": _SERIALIZER.url("connection_policy_name", connection_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerConnectionPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_connection_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerConnectionPolicy"]: - """Lists connection policy. - - :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 - :return: An iterator like instance of either ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.ServerConnectionPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - **kwargs: Any - ) -> _models.ServerConnectionPolicy: - """Gets a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :return: ServerConnectionPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerConnectionPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - connection_policy_name=connection_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerConnectionPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerConnectionPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - connection_policy_name=connection_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: _models.ServerConnectionPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy - :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 ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. 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 ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - connection_policy_name: Union[str, _models.ConnectionPolicyName], - parameters: Union[_models.ServerConnectionPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerConnectionPolicy]: - """Updates a server connection policy. - - :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 connection_policy_name: The name of the connection policy. "default" Required. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a server connection policy. Is either a - ServerConnectionPolicy type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ServerConnectionPolicy or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerConnectionPolicy] = 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, - connection_policy_name=connection_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerConnectionPolicy", pipeline_response.http_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.ServerConnectionPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerConnectionPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 35ccc2ba94f7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py +++ /dev/null @@ -1,543 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "devOpsAuditingSettingsName": _SERIALIZER.url( - "dev_ops_auditing_settings_name", dev_ops_auditing_settings_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - 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", "2025-01-01")) - 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}/devOpsAuditingSettings/{devOpsAuditingSettingsName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "devOpsAuditingSettingsName": _SERIALIZER.url( - "dev_ops_auditing_settings_name", dev_ops_auditing_settings_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerDevOpsAuditSettingsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_dev_ops_audit_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerDevOpsAuditingSettings"]: - """Lists DevOps audit settings of a server. - - :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 - :return: An iterator like instance of either ServerDevOpsAuditingSettings or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDevOpsAuditSettingsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDevOpsAuditSettingsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - **kwargs: Any - ) -> _models.ServerDevOpsAuditingSettings: - """Gets a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :return: ServerDevOpsAuditingSettings or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerDevOpsAuditingSettings] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerDevOpsAuditingSettings") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: _models.ServerDevOpsAuditingSettings, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings - :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 ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. 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 ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - dev_ops_auditing_settings_name: Union[str, _models.DevOpsAuditingSettingsName], - parameters: Union[_models.ServerDevOpsAuditingSettings, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerDevOpsAuditingSettings]: - """Creates or updates a server's DevOps audit settings. - - :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 dev_ops_auditing_settings_name: "Default" Required. - :type dev_ops_auditing_settings_name: str or ~azure.mgmt.sql.models.DevOpsAuditingSettingsName - :param parameters: Properties of DevOps audit settings. Is either a - ServerDevOpsAuditingSettings type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDevOpsAuditingSettings or IO[bytes] - :return: An instance of LROPoller that returns either ServerDevOpsAuditingSettings or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDevOpsAuditingSettings] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerDevOpsAuditingSettings] = 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, - dev_ops_auditing_settings_name=dev_ops_auditing_settings_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDevOpsAuditingSettings", pipeline_response.http_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": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ServerDevOpsAuditingSettings].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerDevOpsAuditingSettings]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index a7462d16e7dd..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py +++ /dev/null @@ -1,826 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, dns_alias_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, dns_alias_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, dns_alias_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/dnsAliases/{dnsAliasName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_acquire_request( - resource_group_name: str, server_name: str, dns_alias_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", "2025-01-01")) - 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}/dnsAliases/{dnsAliasName}/acquire", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "dnsAliasName": _SERIALIZER.url("dns_alias_name", dns_alias_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 ServerDnsAliasesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_dns_aliases` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerDnsAlias"]: - """Gets a list of server DNS aliases for a server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :return: An iterator like instance of either ServerDnsAlias or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDnsAliasListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerDnsAliasListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> _models.ServerDnsAlias: - """Gets a server DNS alias. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :return: ServerDnsAlias or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerDnsAlias - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerDnsAlias] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerDnsAlias", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> LROPoller[_models.ServerDnsAlias]: - """Creates a server DNS alias. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :return: An instance of LROPoller that returns either ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - cls: ClsType[_models.ServerDnsAlias] = 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, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_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.ServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, dns_alias_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the server DNS alias with the given name. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _acquire_initial( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerDnsAliasAcquisition") - - _request = build_acquire_request( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: _models.ServerDnsAliasAcquisition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :param parameters: Required. - :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition - :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 ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: 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 ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_acquire( - self, - resource_group_name: str, - server_name: str, - dns_alias_name: str, - parameters: Union[_models.ServerDnsAliasAcquisition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerDnsAlias]: - """Acquires server DNS alias from another server. - - :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 that the alias is pointing to. Required. - :type server_name: str - :param dns_alias_name: The name of the server dns alias. Required. - :type dns_alias_name: str - :param parameters: Is either a ServerDnsAliasAcquisition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerDnsAliasAcquisition or IO[bytes] - :return: An instance of LROPoller that returns either ServerDnsAlias or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerDnsAlias] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerDnsAlias] = 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._acquire_initial( - resource_group_name=resource_group_name, - server_name=server_name, - dns_alias_name=dns_alias_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerDnsAlias", pipeline_response.http_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.ServerDnsAlias].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerDnsAlias]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 1529f82558c9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, key_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, key_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", "2025-01-01")) - 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}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, key_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/keys/{keyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "keyName": _SERIALIZER.url("key_name", key_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerKeysOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_keys` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerKey"]: - """Gets a list of server keys. - - :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 - :return: An iterator like instance of either ServerKey or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerKey] - :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", self._config.api_version)) - cls: ClsType[_models.ServerKeyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerKeyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> _models.ServerKey: - """Gets a server key. - - :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 key_name: The name of the server key to be retrieved. Required. - :type key_name: str - :return: ServerKey or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerKey - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerKey] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerKey", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: Union[_models.ServerKey, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerKey") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: _models.ServerKey, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerKey - :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 ServerKey or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. 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 ServerKey or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - key_name: str, - parameters: Union[_models.ServerKey, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerKey]: - """Creates or updates a server key. - - :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 key_name: The name of the server key to be operated on (updated or created). The key - name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name - should be formatted as: YourVaultName_YourKeyName_YourKeyVersion. Required. - :type key_name: str - :param parameters: The requested server key resource state. Is either a ServerKey type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerKey or IO[bytes] - :return: An instance of LROPoller that returns either ServerKey or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerKey] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerKey] = 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, - key_name=key_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerKey", pipeline_response.http_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.ServerKey].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerKey]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, server_name: str, key_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes the server key with the given name. - - :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 key_name: The name of the server key to be deleted. Required. - :type key_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - key_name=key_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 6d75fe9e0ba9..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerOperationsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_operations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerOperation"]: - """Gets a list of operations performed on the server. - - :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 - :return: An iterator like instance of either ServerOperation or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerOperation] - :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", self._config.api_version)) - cls: ClsType[_models.ServerOperationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerOperationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 687ad2c42d62..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py +++ /dev/null @@ -1,541 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - 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", "2025-01-01")) - 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}/securityAlertPolicies/{securityAlertPolicyName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "securityAlertPolicyName": _SERIALIZER.url("security_alert_policy_name", security_alert_policy_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerSecurityAlertPoliciesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_security_alert_policies` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerSecurityAlertPolicy"]: - """Get the server's threat detection policies. - - :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 - :return: An iterator like instance of either ServerSecurityAlertPolicy or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalServerSecurityAlertPolicyListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalServerSecurityAlertPolicyListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - **kwargs: Any - ) -> _models.ServerSecurityAlertPolicy: - """Get a server's security alert policy. - - :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 security_alert_policy_name: The name of the security alert policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :return: ServerSecurityAlertPolicy or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerSecurityAlertPolicy] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerSecurityAlertPolicy") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - security_alert_policy_name=security_alert_policy_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: _models.ServerSecurityAlertPolicy, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. Required. - :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy - :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 ServerSecurityAlertPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. 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 ServerSecurityAlertPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - security_alert_policy_name: Union[str, _models.SecurityAlertPolicyNameAutoGenerated], - parameters: Union[_models.ServerSecurityAlertPolicy, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerSecurityAlertPolicy]: - """Creates or updates a threat detection policy. - - :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 security_alert_policy_name: The name of the threat detection policy. "Default" Required. - :type security_alert_policy_name: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated - :param parameters: The server security alert policy. Is either a ServerSecurityAlertPolicy type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy or IO[bytes] - :return: An instance of LROPoller that returns either ServerSecurityAlertPolicy or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerSecurityAlertPolicy] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerSecurityAlertPolicy] = 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, - security_alert_policy_name=security_alert_policy_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerSecurityAlertPolicy", pipeline_response.http_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.ServerSecurityAlertPolicy].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerSecurityAlertPolicy]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 951728518b2a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_certificates_operations.py +++ /dev/null @@ -1,675 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, managed_instance_name: str, certificate_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "certificateName": _SERIALIZER.url("certificate_name", certificate_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, managed_instance_name: str, certificate_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", "2025-01-01")) - 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}/serverTrustCertificates/{certificateName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "certificateName": _SERIALIZER.url("certificate_name", certificate_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, managed_instance_name: str, certificate_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustCertificates/{certificateName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "certificateName": _SERIALIZER.url("certificate_name", certificate_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerTrustCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_trust_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerTrustCertificate"]: - """Gets a list of the server trust certificates used to secure communication between SQL Server - and the specified SQL Managed Instance. - - :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 iterator like instance of either ServerTrustCertificate or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustCertificate] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustCertificatesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustCertificatesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> _models.ServerTrustCertificate: - """Gets a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to get. Required. - :type certificate_name: str - :return: ServerTrustCertificate or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerTrustCertificate - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerTrustCertificate] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerTrustCertificate", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: Union[_models.ServerTrustCertificate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerTrustCertificate") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: _models.ServerTrustCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate - :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 ServerTrustCertificate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. 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 ServerTrustCertificate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - certificate_name: str, - parameters: Union[_models.ServerTrustCertificate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerTrustCertificate]: - """Uploads a server trust certificate from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to upload. Required. - :type certificate_name: str - :param parameters: The server trust certificate info. Is either a ServerTrustCertificate type - or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustCertificate or IO[bytes] - :return: An instance of LROPoller that returns either ServerTrustCertificate or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustCertificate] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerTrustCertificate] = 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, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerTrustCertificate", pipeline_response.http_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.ServerTrustCertificate].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerTrustCertificate]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, managed_instance_name: str, certificate_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a server trust certificate that was uploaded from SQL Server to SQL Managed Instance. - - :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 certificate_name: Name of of the certificate to delete. Required. - :type certificate_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - certificate_name=certificate_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index ee2938769d5f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py +++ /dev/null @@ -1,791 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request( - resource_group_name: str, location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, location_name: str, server_trust_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, location_name: str, server_trust_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", "2025-01-01")) - 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/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, location_name: str, server_trust_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/serverTrustGroups/{serverTrustGroupName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "serverTrustGroupName": _SERIALIZER.url("server_trust_group_name", server_trust_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverTrustGroups", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerTrustGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_trust_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location( - self, resource_group_name: str, location_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerTrustGroup"]: - """Lists a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - resource_group_name=resource_group_name, - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> _models.ServerTrustGroup: - """Gets a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :return: ServerTrustGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerTrustGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerTrustGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: Union[_models.ServerTrustGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerTrustGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: _models.ServerTrustGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup - :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 ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group 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 ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - location_name: str, - server_trust_group_name: str, - parameters: Union[_models.ServerTrustGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ServerTrustGroup]: - """Creates or updates a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :param parameters: The server trust group parameters. Is either a ServerTrustGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerTrustGroup or IO[bytes] - :return: An instance of LROPoller that returns either ServerTrustGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerTrustGroup] = 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, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ServerTrustGroup", pipeline_response.http_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.ServerTrustGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ServerTrustGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, location_name: str, server_trust_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a server trust 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 location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param server_trust_group_name: The name of the server trust group. Required. - :type server_trust_group_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - location_name=location_name, - server_trust_group_name=server_trust_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerTrustGroup"]: - """Gets a server trust groups by instance name. - - :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 iterator like instance of either ServerTrustGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerTrustGroup] - :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", self._config.api_version)) - cls: ClsType[_models.ServerTrustGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerTrustGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 0212f0715fe5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py +++ /dev/null @@ -1,176 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerUsage"]: - """Gets server usages. - - :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 - :return: An iterator like instance of either ServerUsage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerUsage] - :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", self._config.api_version)) - cls: ClsType[_models.ServerUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 13b137ccc8f8..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py +++ /dev/null @@ -1,587 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - 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}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ServerVulnerabilityAssessmentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`server_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.ServerVulnerabilityAssessment"]: - """Lists the vulnerability assessment policies associated with a server. - - :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 - :return: An iterator like instance of either ServerVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.ServerVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Gets the server's vulnerability assessment. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ServerVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.ServerVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.ServerVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.ServerVulnerabilityAssessment: - """Creates or updates the server's vulnerability assessment. Learn more about setting SQL - vulnerability assessment with managed identity - - https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a ServerVulnerabilityAssessment type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment or IO[bytes] - :return: ServerVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ServerVulnerabilityAssessment] = 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, "ServerVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("ServerVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes the server's vulnerability assessment. - - :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 for which the vulnerability assessment is defined. - Required. - :type server_name: str - :param vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 245bb39fdb6f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ /dev/null @@ -1,1494 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_check_name_availability_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", "2025-01-01")) - 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}/providers/Microsoft.Sql/checkNameAvailability") - path_format_arguments = { - "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_list_request(subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request( - resource_group_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, subscription_id: str, *, expand: Optional[str] = None, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand is not None: - _params["$expand"] = _SERIALIZER.query("expand", expand, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_import_database_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/import", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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) - - -def build_refresh_status_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/refreshExternalGovernanceStatus", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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) - - -class ServersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`servers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def check_name_availability( - self, parameters: _models.CheckNameAvailabilityRequest, *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def check_name_availability( - self, parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability 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: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def check_name_availability( - self, parameters: Union[_models.CheckNameAvailabilityRequest, IO[bytes]], **kwargs: Any - ) -> _models.CheckNameAvailabilityResponse: - """Determines whether a resource can be created with the specified name. - - :param parameters: The name availability request parameters. Is either a - CheckNameAvailabilityRequest type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.CheckNameAvailabilityRequest or IO[bytes] - :return: CheckNameAvailabilityResponse or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.CheckNameAvailabilityResponse - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CheckNameAvailabilityResponse] = 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, "CheckNameAvailabilityRequest") - - _request = build_check_name_availability_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("CheckNameAvailabilityResponse", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list(self, expand: Optional[str] = None, **kwargs: Any) -> ItemPaged["_models.Server"]: - """Gets a list of all servers in the subscription. - - :param expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either Server or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> ItemPaged["_models.Server"]: - """Gets a list of servers in a resource groups. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: An iterator like instance of either Server or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - cls: ClsType[_models.ServerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ServerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, expand: Optional[str] = None, **kwargs: Any - ) -> _models.Server: - """Gets a server. - - :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 expand: The child resources to include in the response. Default value is None. - :type expand: str - :return: Server or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.Server - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.Server] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - expand=expand, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("Server", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "Server") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.Server, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. Required. - :type parameters: ~azure.mgmt.sql.models.Server - :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 Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. 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 Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, resource_group_name: str, server_name: str, parameters: Union[_models.Server, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.Server]: - """Creates or updates a server. - - :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 parameters: The requested server resource state. Is either a Server type or a IO[bytes] - type. Required. - :type parameters: ~azure.mgmt.sql.models.Server or IO[bytes] - :return: An instance of LROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Server] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Server", pipeline_response.http_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.Server].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Server]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, server_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a server. - - :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 - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ServerUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ServerUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. Required. - :type parameters: ~azure.mgmt.sql.models.ServerUpdate - :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 Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. 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 Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ServerUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.Server]: - """Updates a server. - - :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 parameters: The requested server resource state. Is either a ServerUpdate type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ServerUpdate or IO[bytes] - :return: An instance of LROPoller that returns either Server or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.Server] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.Server] = 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, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("Server", pipeline_response.http_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.Server].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.Server]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _import_database_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "ImportNewDatabaseDefinition") - - _request = build_import_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: _models.ImportNewDatabaseDefinition, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Required. - :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition - :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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import 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 ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_import_database( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.ImportNewDatabaseDefinition, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ImportExportOperationResult]: - """Imports a bacpac into a new database. - - :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 parameters: The database import request parameters. Is either a - ImportNewDatabaseDefinition type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition or IO[bytes] - :return: An instance of LROPoller that returns either ImportExportOperationResult or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ImportExportOperationResult] = 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._import_database_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ImportExportOperationResult", pipeline_response.http_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.ImportExportOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ImportExportOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _refresh_status_initial(self, resource_group_name: str, server_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_status_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh_status( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> LROPoller[_models.RefreshExternalGovernanceStatusOperationResult]: - """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 server_name: The name of the server. Required. - :type server_name: str - :return: An instance of LROPoller that returns either - RefreshExternalGovernanceStatusOperationResult or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.RefreshExternalGovernanceStatusOperationResult] - :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", self._config.api_version)) - cls: ClsType[_models.RefreshExternalGovernanceStatusOperationResult] = 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, - server_name=server_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "RefreshExternalGovernanceStatusOperationResult", pipeline_response.http_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.RefreshExternalGovernanceStatusOperationResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.RefreshExternalGovernanceStatusOperationResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 1f2fe85b2d65..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py +++ /dev/null @@ -1,314 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_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", "2025-01-01")) - 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}/sqlAgent/current", - ) - 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 - 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) - - -class SqlAgentOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_agent` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, managed_instance_name: str, **kwargs: Any) -> _models.SqlAgentConfiguration: - """Gets current instance sql agent configuration. - - :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: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlAgentConfiguration] = kwargs.pop("cls", None) - - _request = build_get_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.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]: - 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 = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: _models.SqlAgentConfiguration, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 parameters: Required. - :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 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: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - parameters: Union[_models.SqlAgentConfiguration, IO[bytes]], - **kwargs: Any - ) -> _models.SqlAgentConfiguration: - """Puts new sql agent configuration to instance. - - :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 parameters: Is either a SqlAgentConfiguration type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SqlAgentConfiguration or IO[bytes] - :return: SqlAgentConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlAgentConfiguration] = 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, "SqlAgentConfiguration") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlAgentConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index e55eb4c30d19..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baseline_operations.py +++ /dev/null @@ -1,326 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_sql_vulnerability_assessment_request( # pylint: disable=name-too-long - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlVulnerabilityAssessmentBaselineOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_baseline` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessment( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentBaselineSet"]: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentBaselineSet or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSetListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessment_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Gets a list of database's sql vulnerability assessment rule baselines. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 41461267a12f..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_baselines_operations.py +++ /dev/null @@ -1,269 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _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) - - -class SqlVulnerabilityAssessmentBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentBaselineSet: - """Add a database's vulnerability assessment rule baseline list. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput type or a IO[bytes] type. Required. - :type parameters: - ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput or IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentBaselineSet or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentBaselineSet - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentBaselineSet] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentBaselineSet", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 681e237d2bd5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_execute_scan_operations.py +++ /dev/null @@ -1,236 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Iterator, Literal, Optional, TypeVar, Union, cast - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_execute_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _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) - - -class SqlVulnerabilityAssessmentExecuteScanOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_execute_scan` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _execute_initial( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_execute_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_execute( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> LROPoller[None]: - """Executes a Vulnerability Assessment database scan. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :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 {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - 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._execute_initial( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - system_database_name=system_database_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 923e5474775d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baseline_operations.py +++ /dev/null @@ -1,562 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Literal, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_baseline_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _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) - - -class SqlVulnerabilityAssessmentRuleBaselineOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_rule_baseline` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_baseline( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - **kwargs: Any - ) -> ItemPaged["_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline"]: - """Gets a system database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :return: An iterator like instance of either DatabaseSqlVulnerabilityAssessmentRuleBaseline or - the result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_baseline_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult", pipeline_response - ) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Gets a system database's sql vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: _models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. 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: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - parameters: Union[_models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput, IO[bytes]], - **kwargs: Any - ) -> _models.DatabaseSqlVulnerabilityAssessmentRuleBaseline: - """Creates or updates a database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :param parameters: The requested rule baseline resource. Is either a - DatabaseSqlVulnerabilityAssessmentRuleBaselineInput type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaselineInput or - IO[bytes] - :return: DatabaseSqlVulnerabilityAssessmentRuleBaseline or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.DatabaseSqlVulnerabilityAssessmentRuleBaseline - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DatabaseSqlVulnerabilityAssessmentRuleBaseline] = 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, "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize( - "DatabaseSqlVulnerabilityAssessmentRuleBaseline", pipeline_response.http_response - ) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 54cfea41c2e3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_rule_baselines_operations.py +++ /dev/null @@ -1,179 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_delete_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "baselineName": _SERIALIZER.url("baseline_name", baseline_name, "str"), - "ruleId": _SERIALIZER.url("rule_id", rule_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _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) - - -class SqlVulnerabilityAssessmentRuleBaselinesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_rule_baselines` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - baseline_name: Union[str, _models.BaselineName], - rule_id: str, - **kwargs: Any - ) -> None: - """Removes the database's vulnerability assessment rule baseline. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param baseline_name: "default" Required. - :type baseline_name: str or ~azure.mgmt.sql.models.BaselineName - :param rule_id: The vulnerability assessment rule ID. Required. - :type rule_id: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - baseline_name=baseline_name, - rule_id=rule_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 24ea560da96a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scan_result_operations.py +++ /dev/null @@ -1,338 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_scan_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), - "scanResultId": _SERIALIZER.url("scan_result_id", scan_result_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlVulnerabilityAssessmentScanResultOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_scan_result` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_scan( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanResults"]: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanResults or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SQLVulnerabilityAssessmentScanListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_scan_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SQLVulnerabilityAssessmentScanListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - scan_id: str, - scan_result_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanResults: - """Gets a vulnerability assessment scan record of a database. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :param scan_id: The scan id of the SQL Vulnerability Assessment scan to retrieve result from. - Required. - :type scan_id: str - :param scan_result_id: The scan result id of the specific result to retrieve. Required. - :type scan_result_id: str - :return: SqlVulnerabilityAssessmentScanResults or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - scan_result_id=scan_result_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 34f8f3eb1904..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessment_scans_operations.py +++ /dev/null @@ -1,322 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Literal, Optional, TypeVar, Union -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_sql_vulnerability_assessments_request( # pylint: disable=name-too-long - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_name, "str" - ), - "scanId": _SERIALIZER.url("scan_id", scan_id, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["systemDatabaseName"] = _SERIALIZER.query("system_database_name", system_database_name, "str") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlVulnerabilityAssessmentScansOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessment_scans` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sql_vulnerability_assessments( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessmentScanRecord"]: - """Lists the vulnerability assessment scans of a database. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: An iterator like instance of either SqlVulnerabilityAssessmentScanRecord or the result - of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecordListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sql_vulnerability_assessments_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentScanRecordListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - scan_id: str, - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessmentScanRecord: - """Get a system database vulnerability assessment scan record. - - :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 vulnerability_assessment_name: The name of the vulnerability assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param scan_id: Required. - :type scan_id: str - :return: SqlVulnerabilityAssessmentScanRecord or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentScanRecord - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - system_database_name: Literal["master"] = kwargs.pop( - "system_database_name", _params.pop("systemDatabaseName", "master") - ) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentScanRecord] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - scan_id=scan_id, - subscription_id=self._config.subscription_id, - system_database_name=system_database_name, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessmentScanRecord", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 4e173fe614c5..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_operations.py +++ /dev/null @@ -1,159 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar, Union - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_delete_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlVulnerabilityAssessmentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessments` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - **kwargs: Any - ) -> None: - """Removes SQL Vulnerability Assessment. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index 678cb10c9f99..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_vulnerability_assessments_settings_operations.py +++ /dev/null @@ -1,474 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - 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", "2025-01-01")) - 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}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "vulnerabilityAssessmentName": _SERIALIZER.url( - "vulnerability_assessment_name", vulnerability_assessment_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -class SqlVulnerabilityAssessmentsSettingsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sql_vulnerability_assessments_settings` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.SqlVulnerabilityAssessment"]: - """Lists SQL Vulnerability Assessment policies associated with a server. - - :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 - :return: An iterator like instance of either SqlVulnerabilityAssessment or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SqlVulnerabilityAssessment] - :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", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessmentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlVulnerabilityAssessmentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.SqlVulnerabilityAssessmentName], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Gets SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or - ~azure.mgmt.sql.models.SqlVulnerabilityAssessmentName - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: _models.SqlVulnerabilityAssessment, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Required. - :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. 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: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - server_name: str, - vulnerability_assessment_name: Union[str, _models.VulnerabilityAssessmentName], - parameters: Union[_models.SqlVulnerabilityAssessment, IO[bytes]], - **kwargs: Any - ) -> _models.SqlVulnerabilityAssessment: - """Creates or updates SQL Vulnerability Assessment policy. - - :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 vulnerability_assessment_name: The name of the SQL Vulnerability Assessment. "default" - Required. - :type vulnerability_assessment_name: str or ~azure.mgmt.sql.models.VulnerabilityAssessmentName - :param parameters: The requested resource. Is either a SqlVulnerabilityAssessment type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment or IO[bytes] - :return: SqlVulnerabilityAssessment or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SqlVulnerabilityAssessment - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlVulnerabilityAssessment] = 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, "SqlVulnerabilityAssessment") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - vulnerability_assessment_name=vulnerability_assessment_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("SqlVulnerabilityAssessment", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index fdcc67f53ee2..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_start_stop_managed_instance_schedules_operations.py +++ /dev/null @@ -1,570 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Optional, TypeVar, Union, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules", - ) - 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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - 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", "2025-01-01")) - 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}/startStopSchedules/{startStopScheduleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "managedInstanceName": _SERIALIZER.url("managed_instance_name", managed_instance_name, "str"), - "startStopScheduleName": _SERIALIZER.url("start_stop_schedule_name", start_stop_schedule_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class StartStopManagedInstanceSchedulesOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`start_stop_managed_instance_schedules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance( - self, resource_group_name: str, managed_instance_name: str, **kwargs: Any - ) -> ItemPaged["_models.StartStopManagedInstanceSchedule"]: - """Lists the managed instance's Start/Stop schedules. - - :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 iterator like instance of either StartStopManagedInstanceSchedule or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.StartStopManagedInstanceSchedule] - :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", self._config.api_version)) - cls: ClsType[_models.StartStopManagedInstanceScheduleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_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.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("StartStopManagedInstanceScheduleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Gets the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.StartStopManagedInstanceSchedule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: _models.StartStopManagedInstanceSchedule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. Required. - :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. 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: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create_or_update( - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - parameters: Union[_models.StartStopManagedInstanceSchedule, IO[bytes]], - **kwargs: Any - ) -> _models.StartStopManagedInstanceSchedule: - """Creates or updates the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :param parameters: The requested managed instance Start/Stop schedule. Is either a - StartStopManagedInstanceSchedule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule or IO[bytes] - :return: StartStopManagedInstanceSchedule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.StartStopManagedInstanceSchedule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.StartStopManagedInstanceSchedule] = 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, "StartStopManagedInstanceSchedule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _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, 201]: - 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 = self._deserialize("StartStopManagedInstanceSchedule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def delete( # pylint: disable=inconsistent-return-statements - self, - resource_group_name: str, - managed_instance_name: str, - start_stop_schedule_name: Union[str, _models.StartStopScheduleName], - **kwargs: Any - ) -> None: - """Deletes the managed instance's Start/Stop schedule. - - :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 start_stop_schedule_name: Name of the managed instance Start/Stop schedule. "default" - Required. - :type start_stop_schedule_name: str or ~azure.mgmt.sql.models.StartStopScheduleName - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - start_stop_schedule_name=start_stop_schedule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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, 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index afcfdc757f64..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py +++ /dev/null @@ -1,252 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages" - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location_name: str, usage_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/usages/{usageName}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "usageName": _SERIALIZER.url("usage_name", usage_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SubscriptionUsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`subscription_usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.SubscriptionUsage"]: - """Gets all subscription usage metrics in a given location. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either SubscriptionUsage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SubscriptionUsage] - :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", self._config.api_version)) - cls: ClsType[_models.SubscriptionUsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SubscriptionUsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, location_name: str, usage_name: str, **kwargs: Any) -> _models.SubscriptionUsage: - """Gets a subscription usage metric. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :param usage_name: Name of usage metric to return. Required. - :type usage_name: str - :return: SubscriptionUsage or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SubscriptionUsage - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SubscriptionUsage] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - usage_name=usage_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SubscriptionUsage", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 58b8fef2ffc7..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_synapse_link_workspaces_operations.py +++ /dev/null @@ -1,181 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SynapseLinkWorkspacesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`synapse_link_workspaces` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.SynapseLinkWorkspace"]: - """Gets all synapselink workspaces for a database. - - :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 - :return: An iterator like instance of either SynapseLinkWorkspace or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SynapseLinkWorkspace] - :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", self._config.api_version)) - cls: ClsType[_models.SynapseLinkWorkspaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SynapseLinkWorkspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index f82fa3ccc70d..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py +++ /dev/null @@ -1,887 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, sync_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, sync_agent_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", "2025-01-01")) - 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}/syncAgents/{syncAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, sync_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_generate_key_request( - resource_group_name: str, server_name: str, sync_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/generateKey", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_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_list_linked_databases_request( - resource_group_name: str, server_name: str, sync_agent_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/syncAgents/{syncAgentName}/linkedDatabases", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "syncAgentName": _SERIALIZER.url("sync_agent_name", sync_agent_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SyncAgentsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sync_agents` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncAgent"]: - """Lists sync agents in a server. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :return: An iterator like instance of either SyncAgent or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgent] - :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", self._config.api_version)) - cls: ClsType[_models.SyncAgentListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any) -> _models.SyncAgent: - """Gets a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: SyncAgent or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncAgent - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncAgent] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncAgent", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: Union[_models.SyncAgent, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncAgent") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: _models.SyncAgent, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncAgent - :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 SyncAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. 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 SyncAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - sync_agent_name: str, - parameters: Union[_models.SyncAgent, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncAgent]: - """Creates or updates a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :param parameters: The requested sync agent resource state. Is either a SyncAgent type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncAgent or IO[bytes] - :return: An instance of LROPoller that returns either SyncAgent or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncAgent] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncAgent] = 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, - sync_agent_name=sync_agent_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncAgent", pipeline_response.http_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.SyncAgent].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SyncAgent]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def generate_key( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> _models.SyncAgentKeyProperties: - """Generates a sync agent key. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: SyncAgentKeyProperties or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncAgentKeyProperties - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncAgentKeyProperties] = kwargs.pop("cls", None) - - _request = build_generate_key_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncAgentKeyProperties", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_linked_databases( - self, resource_group_name: str, server_name: str, sync_agent_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncAgentLinkedDatabase"]: - """Lists databases linked to a sync agent. - - :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 on which the sync agent is hosted. Required. - :type server_name: str - :param sync_agent_name: The name of the sync agent. Required. - :type sync_agent_name: str - :return: An iterator like instance of either SyncAgentLinkedDatabase or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncAgentLinkedDatabase] - :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", self._config.api_version)) - cls: ClsType[_models.SyncAgentLinkedDatabaseListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_linked_databases_request( - resource_group_name=resource_group_name, - server_name=server_name, - sync_agent_name=sync_agent_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncAgentLinkedDatabaseListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index cbe7d900f6c3..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py +++ /dev/null @@ -1,1745 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_sync_database_ids_request(location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/syncDatabaseIds", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - 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, - sync_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", "2025-01-01")) - 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}/syncGroups/{syncGroupName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - 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}/syncGroups/{syncGroupName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_sync_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/cancelSync", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_hub_schemas_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/hubSchemas", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_logs_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - subscription_id: str, - *, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/logs", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["startTime"] = _SERIALIZER.query("start_time", start_time, "str") - _params["endTime"] = _SERIALIZER.query("end_time", end_time, "str") - _params["type"] = _SERIALIZER.query("type", type, "str") - if continuation_token_parameter is not None: - _params["continuationToken"] = _SERIALIZER.query( - "continuation_token_parameter", continuation_token_parameter, "str" - ) - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_refresh_hub_schema_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/refreshHubSchema", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_trigger_sync_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/triggerSync", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class SyncGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sync_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_sync_database_ids( - self, location_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncDatabaseIdProperties"]: - """Gets a collection of sync database ids. - - :param location_name: The name of the region where the resource is located. Required. - :type location_name: str - :return: An iterator like instance of either SyncDatabaseIdProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncDatabaseIdProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncDatabaseIdListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sync_database_ids_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncDatabaseIdListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncGroup"]: - """Lists sync groups under a hub database. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :return: An iterator like instance of either SyncGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - cls: ClsType[_models.SyncGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> _models.SyncGroup: - """Gets a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: SyncGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: _models.SyncGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup - :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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. 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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Creates or updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Is either a SyncGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] - :return: An instance of LROPoller that returns either SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncGroup] = 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, - sync_group_name=sync_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncGroup", pipeline_response.http_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.SyncGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SyncGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncGroup") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: _models.SyncGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup - :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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. 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 SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - parameters: Union[_models.SyncGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncGroup]: - """Updates a sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param parameters: The requested sync group resource state. Is either a SyncGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncGroup or IO[bytes] - :return: An instance of LROPoller that returns either SyncGroup or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncGroup] = 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, - sync_group_name=sync_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncGroup", pipeline_response.http_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.SyncGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SyncGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def cancel_sync( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Cancels a sync group synchronization. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_cancel_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - @distributed_trace - def list_hub_schemas( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a collection of hub database schemas. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_hub_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_logs( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - start_time: str, - end_time: str, - type: Union[str, _models.SyncGroupsType], - continuation_token_parameter: Optional[str] = None, - **kwargs: Any - ) -> ItemPaged["_models.SyncGroupLogProperties"]: - """Gets a collection of sync group logs. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :param start_time: Get logs generated after this time. Required. - :type start_time: str - :param end_time: Get logs generated before this time. Required. - :type end_time: str - :param type: The types of logs to retrieve. Known values are: "All", "Error", "Warning", and - "Success". Required. - :type type: str or ~azure.mgmt.sql.models.SyncGroupsType - :param continuation_token_parameter: The continuation token for this operation. Default value - is None. - :type continuation_token_parameter: str - :return: An iterator like instance of either SyncGroupLogProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncGroupLogProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncGroupLogListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_logs_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - start_time=start_time, - end_time=end_time, - type=type, - continuation_token_parameter=continuation_token_parameter, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncGroupLogListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _refresh_hub_schema_initial( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_hub_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh_hub_schema( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Refreshes a hub database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :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", self._config.api_version)) - 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._refresh_hub_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def trigger_sync( # pylint: disable=inconsistent-return-statements - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> None: - """Triggers a sync group synchronization. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: None or the result of cls(response) - :rtype: None - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - - _request = build_trigger_sync_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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) - - if cls: - return cls(pipeline_response, None, {}) # type: ignore 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 deleted file mode 100644 index e74d84e33084..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py +++ /dev/null @@ -1,1369 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_sync_group_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - 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}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - 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}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_refresh_member_schema_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/refreshSchema", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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_list_member_schemas_request( - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/syncGroups/{syncGroupName}/syncMembers/{syncMemberName}/schemas", - ) - 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"), - "syncGroupName": _SERIALIZER.url("sync_group_name", sync_group_name, "str"), - "syncMemberName": _SERIALIZER.url("sync_member_name", sync_member_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class SyncMembersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`sync_members` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_sync_group( - self, resource_group_name: str, server_name: str, database_name: str, sync_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.SyncMember"]: - """Lists sync members in the given sync 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 server_name: The name of the server. Required. - :type server_name: str - :param database_name: The name of the database on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group. Required. - :type sync_group_name: str - :return: An iterator like instance of either SyncMember or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - cls: ClsType[_models.SyncMemberListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_sync_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncMemberListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> _models.SyncMember: - """Gets a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: SyncMember or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.SyncMember - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SyncMember] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("SyncMember", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncMember") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: _models.SyncMember, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember - :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 SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. 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 SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Creates or updates a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Is either a SyncMember type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember or IO[bytes] - :return: An instance of LROPoller that returns either SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncMember] = 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, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncMember", pipeline_response.http_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.SyncMember].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SyncMember]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "SyncMember") - - _request = build_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: _models.SyncMember, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember - :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 SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. 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 SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - parameters: Union[_models.SyncMember, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SyncMember]: - """Updates an existing sync member. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :param parameters: The requested sync member resource state. Is either a SyncMember type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.SyncMember or IO[bytes] - :return: An instance of LROPoller that returns either SyncMember or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.SyncMember] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SyncMember] = 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, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SyncMember", pipeline_response.http_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.SyncMember].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SyncMember]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _refresh_member_schema_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_refresh_member_schema_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_refresh_member_schema( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Refreshes a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :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", self._config.api_version)) - 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._refresh_member_schema_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def list_member_schemas( - self, - resource_group_name: str, - server_name: str, - database_name: str, - sync_group_name: str, - sync_member_name: str, - **kwargs: Any - ) -> ItemPaged["_models.SyncFullSchemaProperties"]: - """Gets a sync member database schema. - - :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 on which the sync group is hosted. Required. - :type database_name: str - :param sync_group_name: The name of the sync group on which the sync member is hosted. - Required. - :type sync_group_name: str - :param sync_member_name: The name of the sync member. Required. - :type sync_member_name: str - :return: An iterator like instance of either SyncFullSchemaProperties or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.SyncFullSchemaProperties] - :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", self._config.api_version)) - cls: ClsType[_models.SyncFullSchemaPropertiesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_member_schemas_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - sync_group_name=sync_group_name, - sync_member_name=sync_member_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SyncFullSchemaPropertiesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 6e1364e6083a..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py +++ /dev/null @@ -1,288 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - 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}/tdeCertificates", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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 TdeCertificatesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`tde_certificates` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - def _create_initial( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "TdeCertificate") - - _request = build_create_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: _models.TdeCertificate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate - :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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. 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 None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - server_name: str, - parameters: Union[_models.TdeCertificate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[None]: - """Creates a TDE certificate for a given server. - - :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 parameters: The requested TDE certificate to be created or updated. Is either a - TdeCertificate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.TdeCertificate or IO[bytes] - :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 = 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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - 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._create_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index 6cbef11d2caf..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py +++ /dev/null @@ -1,252 +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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_location_request(location_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones" - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request(location_name: str, time_zone_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}", - ) - path_format_arguments = { - "locationName": _SERIALIZER.url("location_name", location_name, "str"), - "timeZoneId": _SERIALIZER.url("time_zone_id", time_zone_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class TimeZonesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`time_zones` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_location(self, location_name: str, **kwargs: Any) -> ItemPaged["_models.TimeZone"]: - """Gets a list of managed instance time zones by location. - - :param location_name: Required. - :type location_name: str - :return: An iterator like instance of either TimeZone or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TimeZone] - :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", self._config.api_version)) - cls: ClsType[_models.TimeZoneListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_location_request( - location_name=location_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("TimeZoneListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, location_name: str, time_zone_id: str, **kwargs: Any) -> _models.TimeZone: - """Gets a managed instance time zone. - - :param location_name: Required. - :type location_name: str - :param time_zone_id: Required. - :type time_zone_id: str - :return: TimeZone or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TimeZone - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.TimeZone] = kwargs.pop("cls", None) - - _request = build_get_request( - location_name=location_name, - time_zone_id=time_zone_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("TimeZone", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore 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 deleted file mode 100644 index 61d69c4bc7cc..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py +++ /dev/null @@ -1,930 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}", - ) - 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"), - "tdeName": _SERIALIZER.url("tde_name", tde_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - 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}/transparentDataEncryption/{tdeName}", - ) - 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"), - "tdeName": _SERIALIZER.url("tde_name", tde_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_resume_request( - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/resume", - ) - 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"), - "tdeName": _SERIALIZER.url("tde_name", tde_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_suspend_request( - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - 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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}/suspend", - ) - 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"), - "tdeName": _SERIALIZER.url("tde_name", tde_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) - - -class TransparentDataEncryptionsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`transparent_data_encryptions` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.LogicalDatabaseTransparentDataEncryption"]: - """Gets a list of the logical database's transparent data encryption. - - :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 logical database for which the transparent data - encryption is defined. Required. - :type database_name: str - :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryption or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryptionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("LogicalDatabaseTransparentDataEncryptionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> _models.LogicalDatabaseTransparentDataEncryption: - """Gets a logical database's transparent data encryption. - - :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 logical database for which the transparent data - encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: LogicalDatabaseTransparentDataEncryption or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("LogicalDatabaseTransparentDataEncryption", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "LogicalDatabaseTransparentDataEncryption") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: _models.LogicalDatabaseTransparentDataEncryption, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Required. - :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption - :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 LogicalDatabaseTransparentDataEncryption - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. 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 LogicalDatabaseTransparentDataEncryption - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - parameters: Union[_models.LogicalDatabaseTransparentDataEncryption, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Updates a logical database's transparent data encryption configuration. - - :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 logical database for which the security alert policy is - defined. Required. - :type database_name: str - :param tde_name: The name of the transparent data encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The database transparent data encryption. Is either a - LogicalDatabaseTransparentDataEncryption type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or IO[bytes] - :return: An instance of LROPoller that returns either LogicalDatabaseTransparentDataEncryption - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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, - tde_name=tde_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _resume_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_resume( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Resume ongoing logical database's Transparent Data Encryption scan configuration. - - :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 logical database for which the Transparent Data - Encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: An instance of LROPoller that returns either LogicalDatabaseTransparentDataEncryption - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._resume_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _suspend_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_suspend_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_suspend( - self, - resource_group_name: str, - server_name: str, - database_name: str, - tde_name: Union[str, _models.TransparentDataEncryptionName], - **kwargs: Any - ) -> LROPoller[_models.LogicalDatabaseTransparentDataEncryption]: - """Suspend ongoing logical database's Transparent Data Encryption scan configuration. - - :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 logical database for which the Transparent Data - Encryption is defined. Required. - :type database_name: str - :param tde_name: The name of the Transparent Data Encryption configuration. "current" Required. - :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :return: An instance of LROPoller that returns either LogicalDatabaseTransparentDataEncryption - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] - :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", self._config.api_version)) - cls: ClsType[_models.LogicalDatabaseTransparentDataEncryption] = 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._suspend_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - tde_name=tde_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize( - "LogicalDatabaseTransparentDataEncryption", pipeline_response.http_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.LogicalDatabaseTransparentDataEncryption].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.LogicalDatabaseTransparentDataEncryption]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 5a92c389aeac..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py +++ /dev/null @@ -1,187 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from typing import Any, Callable, Optional, TypeVar -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_instance_pool_request( - resource_group_name: str, - instance_pool_name: str, - subscription_id: str, - *, - expand_children: Optional[bool] = None, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/usages", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "instancePoolName": _SERIALIZER.url("instance_pool_name", instance_pool_name, "str"), - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - if expand_children is not None: - _params["expandChildren"] = _SERIALIZER.query("expand_children", expand_children, "bool") - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class UsagesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`usages` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_instance_pool( - self, resource_group_name: str, instance_pool_name: str, expand_children: Optional[bool] = None, **kwargs: Any - ) -> ItemPaged["_models.Usage"]: - """Gets all instance pool usage metrics. - - :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 instance_pool_name: The name of the instance pool to be retrieved. Required. - :type instance_pool_name: str - :param expand_children: Optional request parameter to include managed instance usages within - the instance pool. Default value is None. - :type expand_children: bool - :return: An iterator like instance of either Usage or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.Usage] - :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", self._config.api_version)) - cls: ClsType[_models.UsageListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_instance_pool_request( - resource_group_name=resource_group_name, - instance_pool_name=instance_pool_name, - subscription_id=self._config.subscription_id, - expand_children=expand_children, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("UsageListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) 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 deleted file mode 100644 index 640490fd4370..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py +++ /dev/null @@ -1,1124 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression,too-many-lines -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.Sql/virtualClusters") - path_format_arguments = { - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, virtual_cluster_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, virtual_cluster_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", "2025-01-01")) - 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/virtualClusters/{virtualClusterName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, virtual_cluster_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, virtual_cluster_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", "2025-01-01")) - 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/virtualClusters/{virtualClusterName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_dns_servers_request( - resource_group_name: str, virtual_cluster_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "virtualClusterName": _SERIALIZER.url("virtual_cluster_name", virtual_cluster_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) - - -class VirtualClustersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`virtual_clusters` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> ItemPaged["_models.VirtualCluster"]: - """Gets a list of all virtualClusters in the subscription. - - :return: An iterator like instance of either VirtualCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group(self, resource_group_name: str, **kwargs: Any) -> ItemPaged["_models.VirtualCluster"]: - """Gets a list of virtual clusters in a resource 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 - :return: An iterator like instance of either VirtualCluster or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualClusterListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualClusterListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> _models.VirtualCluster: - """Gets a virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :return: VirtualCluster or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VirtualCluster - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualCluster] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VirtualCluster", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualCluster, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualCluster") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: _models.VirtualCluster, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualCluster - :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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualCluster, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Creates virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Is either a VirtualCluster - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualCluster or IO[bytes] - :return: An instance of LROPoller that returns either VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualCluster] = 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, - virtual_cluster_name=virtual_cluster_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VirtualCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes a virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _update_initial( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualClusterUpdate") - - _request = build_update_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: _models.VirtualClusterUpdate, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate - :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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. 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 VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - virtual_cluster_name: str, - parameters: Union[_models.VirtualClusterUpdate, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VirtualCluster]: - """Updates an existing virtual cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :param parameters: The requested virtual cluster resource state. Is either a - VirtualClusterUpdate type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate or IO[bytes] - :return: An instance of LROPoller that returns either VirtualCluster or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualCluster] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualCluster] = 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, - virtual_cluster_name=virtual_cluster_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualCluster", pipeline_response.http_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.VirtualCluster].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VirtualCluster]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_dns_servers_initial( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_update_dns_servers_request( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_update_dns_servers( - self, resource_group_name: str, virtual_cluster_name: str, **kwargs: Any - ) -> LROPoller[_models.UpdateVirtualClusterDnsServersOperation]: - """Synchronizes the DNS server settings used by the managed instances inside the given virtual - cluster. - - :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 virtual_cluster_name: The name of the virtual cluster. Required. - :type virtual_cluster_name: str - :return: An instance of LROPoller that returns either UpdateVirtualClusterDnsServersOperation - or the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.UpdateVirtualClusterDnsServersOperation] - :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", self._config.api_version)) - cls: ClsType[_models.UpdateVirtualClusterDnsServersOperation] = 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_dns_servers_initial( - resource_group_name=resource_group_name, - virtual_cluster_name=virtual_cluster_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("UpdateVirtualClusterDnsServersOperation", pipeline_response.http_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.UpdateVirtualClusterDnsServersOperation].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.UpdateVirtualClusterDnsServersOperation]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) 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 deleted file mode 100644 index 9f10ee7fc266..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py +++ /dev/null @@ -1,673 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_server_request( - resource_group_name: str, server_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, server_name: str, virtual_network_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, server_name: str, virtual_network_rule_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", "2025-01-01")) - 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}/virtualNetworkRules/{virtualNetworkRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, server_name: str, virtual_network_rule_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/virtualNetworkRules/{virtualNetworkRuleName}", - ) - path_format_arguments = { - "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, "str"), - "serverName": _SERIALIZER.url("server_name", server_name, "str"), - "virtualNetworkRuleName": _SERIALIZER.url("virtual_network_rule_name", virtual_network_rule_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class VirtualNetworkRulesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`virtual_network_rules` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_server( - self, resource_group_name: str, server_name: str, **kwargs: Any - ) -> ItemPaged["_models.VirtualNetworkRule"]: - """Gets a list of virtual network rules in a server. - - :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 - :return: An iterator like instance of either VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkRuleListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_server_request( - resource_group_name=resource_group_name, - server_name=server_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRuleListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> _models.VirtualNetworkRule: - """Gets a virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :return: VirtualNetworkRule or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.VirtualNetworkRule - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.VirtualNetworkRule] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("VirtualNetworkRule", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: Union[_models.VirtualNetworkRule, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "VirtualNetworkRule") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: _models.VirtualNetworkRule, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule - :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 VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. 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 VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - virtual_network_rule_name: str, - parameters: Union[_models.VirtualNetworkRule, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.VirtualNetworkRule]: - """Creates or updates an existing virtual network rule. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :param parameters: The requested virtual Network Rule Resource state. Is either a - VirtualNetworkRule type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.VirtualNetworkRule or IO[bytes] - :return: An instance of LROPoller that returns either VirtualNetworkRule or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.VirtualNetworkRule] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.VirtualNetworkRule] = 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, - virtual_network_rule_name=virtual_network_rule_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("VirtualNetworkRule", pipeline_response.http_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.VirtualNetworkRule].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.VirtualNetworkRule]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, virtual_network_rule_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes the virtual network rule with the given name. - - :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 virtual_network_rule_name: The name of the virtual network rule. Required. - :type virtual_network_rule_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - virtual_network_rule_name=virtual_network_rule_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index e9de225b9d78..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py +++ /dev/null @@ -1,775 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_workload_group_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), - "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_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", "2025-01-01")) - 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}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), - "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_group_name, "str"), - "workloadClassifierName": _SERIALIZER.url("workload_classifier_name", workload_classifier_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="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class WorkloadClassifiersOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`workload_classifiers` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_workload_group( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> ItemPaged["_models.WorkloadClassifier"]: - """Gets the list of workload classifiers for a workload 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 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 workload_group_name: The name of the workload group from which to receive the - classifiers from. Required. - :type workload_group_name: str - :return: An iterator like instance of either WorkloadClassifier or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadClassifier] - :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", self._config.api_version)) - cls: ClsType[_models.WorkloadClassifierListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_workload_group_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadClassifierListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> _models.WorkloadClassifier: - """Gets a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier. Required. - :type workload_classifier_name: str - :return: WorkloadClassifier or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.WorkloadClassifier - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadClassifier] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("WorkloadClassifier", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: Union[_models.WorkloadClassifier, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "WorkloadClassifier") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: _models.WorkloadClassifier, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier - :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 WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. 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 WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - parameters: Union[_models.WorkloadClassifier, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.WorkloadClassifier]: - """Creates or updates a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to create/update. - Required. - :type workload_classifier_name: str - :param parameters: The properties of the workload classifier. Is either a WorkloadClassifier - type or a IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadClassifier or IO[bytes] - :return: An instance of LROPoller that returns either WorkloadClassifier or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadClassifier] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadClassifier] = 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, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadClassifier", pipeline_response.http_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.WorkloadClassifier].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.WorkloadClassifier]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - workload_classifier_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Deletes a workload classifier. - - :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 workload_group_name: The name of the workload group from which to receive the classifier - from. Required. - :type workload_group_name: str - :param workload_classifier_name: The name of the workload classifier to delete. Required. - :type workload_classifier_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - workload_classifier_name=workload_classifier_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore 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 deleted file mode 100644 index eeda021908a0..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py +++ /dev/null @@ -1,714 +0,0 @@ -# pylint: disable=line-too-long,useless-suppression -# 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 collections.abc import MutableMapping -from io import IOBase -from typing import Any, Callable, IO, Iterator, Optional, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core import PipelineClient -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._configuration import SqlManagementClientConfiguration -from .._utils.serialization import Deserializer, Serializer - -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, dict[str, Any]], Any]] -List = list - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_by_database_request( - resource_group_name: str, server_name: str, database_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups", - ) - 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"), - "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="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - 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, - workload_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", "2025-01-01")) - 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}/workloadGroups/{workloadGroupName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_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="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - server_name: str, - database_name: str, - workload_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", "2025-01-01")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/workloadGroups/{workloadGroupName}", - ) - 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"), - "workloadGroupName": _SERIALIZER.url("workload_group_name", workload_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 - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class WorkloadGroupsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.sql.SqlManagementClient`'s - :attr:`workload_groups` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client: PipelineClient = input_args.pop(0) if input_args else kwargs.pop("client") - self._config: SqlManagementClientConfiguration = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize: Serializer = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize: Deserializer = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_by_database( - self, resource_group_name: str, server_name: str, database_name: str, **kwargs: Any - ) -> ItemPaged["_models.WorkloadGroup"]: - """Gets the list of workload groups. - - :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 - :return: An iterator like instance of either WorkloadGroup or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.WorkloadGroup] - :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", self._config.api_version)) - cls: ClsType[_models.WorkloadGroupListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("WorkloadGroupListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> _models.WorkloadGroup: - """Gets a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :return: WorkloadGroup or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.WorkloadGroup - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.WorkloadGroup] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _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]: - 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 = self._deserialize("WorkloadGroup", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: Union[_models.WorkloadGroup, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(parameters, (IOBase, bytes)): - _content = parameters - else: - _json = self._serialize.body(parameters, "WorkloadGroup") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_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.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: _models.WorkloadGroup, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadGroup - :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 WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. 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 WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - server_name: str, - database_name: str, - workload_group_name: str, - parameters: Union[_models.WorkloadGroup, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.WorkloadGroup]: - """Creates or updates a workload 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 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 workload_group_name: The name of the workload group. Required. - :type workload_group_name: str - :param parameters: The requested workload group state. Is either a WorkloadGroup type or a - IO[bytes] type. Required. - :type parameters: ~azure.mgmt.sql.models.WorkloadGroup or IO[bytes] - :return: An instance of LROPoller that returns either WorkloadGroup or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.WorkloadGroup] - :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", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.WorkloadGroup] = 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, - workload_group_name=workload_group_name, - parameters=parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("WorkloadGroup", pipeline_response.http_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.WorkloadGroup].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.WorkloadGroup]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize( - _models.ErrorResponse, - pipeline_response, - ) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, server_name: str, database_name: str, workload_group_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes a workload 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 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 workload_group_name: The name of the workload group to delete. Required. - :type workload_group_name: str - :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", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - workload_group_name=workload_group_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - 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[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/code_report_typespec.json b/sdk/sql/azure-mgmt-sql/code_report_typespec.json new file mode 100644 index 000000000000..0acea43f60c2 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/code_report_typespec.json @@ -0,0 +1,125814 @@ +{ + "azure.mgmt.sql": { + "class_nodes": { + "SqlManagementClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "backup_short_term_retention_policies": { + "attr_type": "BackupShortTermRetentionPoliciesOperations" + }, + "server_blob_auditing_policies": { + "attr_type": "ServerBlobAuditingPoliciesOperations" + }, + "database_blob_auditing_policies": { + "attr_type": "DatabaseBlobAuditingPoliciesOperations" + }, + "extended_database_blob_auditing_policies": { + "attr_type": "ExtendedDatabaseBlobAuditingPoliciesOperations" + }, + "extended_server_blob_auditing_policies": { + "attr_type": "ExtendedServerBlobAuditingPoliciesOperations" + }, + "database_advanced_threat_protection_settings": { + "attr_type": "DatabaseAdvancedThreatProtectionSettingsOperations" + }, + "database_advisors": { + "attr_type": "DatabaseAdvisorsOperations" + }, + "database_automatic_tuning": { + "attr_type": "DatabaseAutomaticTuningOperations" + }, + "database_columns": { + "attr_type": "DatabaseColumnsOperations" + }, + "database_encryption_protectors": { + "attr_type": "DatabaseEncryptionProtectorsOperations" + }, + "database_extensions": { + "attr_type": "DatabaseExtensionsOperations" + }, + "database_operations": { + "attr_type": "DatabaseOperationsOperations" + }, + "database_recommended_actions": { + "attr_type": "DatabaseRecommendedActionsOperations" + }, + "databases": { + "attr_type": "DatabasesOperations" + }, + "database_schemas": { + "attr_type": "DatabaseSchemasOperations" + }, + "database_security_alert_policies": { + "attr_type": "DatabaseSecurityAlertPoliciesOperations" + }, + "database_sql_vulnerability_assessment_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentBaselinesOperations" + }, + "database_sql_vulnerability_assessment_execute_scan": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations" + }, + "database_sql_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_sql_vulnerability_assessment_scan_result": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScanResultOperations" + }, + "database_sql_vulnerability_assessment_scans": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScansOperations" + }, + "database_sql_vulnerability_assessments_settings": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentsSettingsOperations" + }, + "database_tables": { + "attr_type": "DatabaseTablesOperations" + }, + "database_usages": { + "attr_type": "DatabaseUsagesOperations" + }, + "database_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_vulnerability_assessments": { + "attr_type": "DatabaseVulnerabilityAssessmentsOperations" + }, + "database_vulnerability_assessment_scans": { + "attr_type": "DatabaseVulnerabilityAssessmentScansOperations" + }, + "data_masking_policies": { + "attr_type": "DataMaskingPoliciesOperations" + }, + "data_masking_rules": { + "attr_type": "DataMaskingRulesOperations" + }, + "data_warehouse_user_activities": { + "attr_type": "DataWarehouseUserActivitiesOperations" + }, + "deleted_servers": { + "attr_type": "DeletedServersOperations" + }, + "distributed_availability_groups": { + "attr_type": "DistributedAvailabilityGroupsOperations" + }, + "elastic_pool_operations": { + "attr_type": "ElasticPoolOperationsOperations" + }, + "elastic_pools": { + "attr_type": "ElasticPoolsOperations" + }, + "encryption_protectors": { + "attr_type": "EncryptionProtectorsOperations" + }, + "endpoint_certificates": { + "attr_type": "EndpointCertificatesOperations" + }, + "failover_groups": { + "attr_type": "FailoverGroupsOperations" + }, + "firewall_rules": { + "attr_type": "FirewallRulesOperations" + }, + "geo_backup_policies": { + "attr_type": "GeoBackupPoliciesOperations" + }, + "instance_failover_groups": { + "attr_type": "InstanceFailoverGroupsOperations" + }, + "instance_pool_operations": { + "attr_type": "InstancePoolOperationsOperations" + }, + "instance_pools": { + "attr_type": "InstancePoolsOperations" + }, + "ipv6_firewall_rules": { + "attr_type": "IPv6FirewallRulesOperations" + }, + "job_agents": { + "attr_type": "JobAgentsOperations" + }, + "job_credentials": { + "attr_type": "JobCredentialsOperations" + }, + "job_executions": { + "attr_type": "JobExecutionsOperations" + }, + "job_private_endpoints": { + "attr_type": "JobPrivateEndpointsOperations" + }, + "jobs": { + "attr_type": "JobsOperations" + }, + "job_step_executions": { + "attr_type": "JobStepExecutionsOperations" + }, + "job_steps": { + "attr_type": "JobStepsOperations" + }, + "job_target_executions": { + "attr_type": "JobTargetExecutionsOperations" + }, + "job_target_groups": { + "attr_type": "JobTargetGroupsOperations" + }, + "job_versions": { + "attr_type": "JobVersionsOperations" + }, + "ledger_digest_uploads": { + "attr_type": "LedgerDigestUploadsOperations" + }, + "capabilities": { + "attr_type": "CapabilitiesOperations" + }, + "long_term_retention_backups": { + "attr_type": "LongTermRetentionBackupsOperations" + }, + "long_term_retention_managed_instance_backups": { + "attr_type": "LongTermRetentionManagedInstanceBackupsOperations" + }, + "long_term_retention_policies": { + "attr_type": "LongTermRetentionPoliciesOperations" + }, + "maintenance_window_options": { + "attr_type": "MaintenanceWindowOptionsOperations" + }, + "maintenance_windows": { + "attr_type": "MaintenanceWindowsOperations" + }, + "managed_backup_short_term_retention_policies": { + "attr_type": "ManagedBackupShortTermRetentionPoliciesOperations" + }, + "managed_database_advanced_threat_protection_settings": { + "attr_type": "ManagedDatabaseAdvancedThreatProtectionSettingsOperations" + }, + "managed_database_columns": { + "attr_type": "ManagedDatabaseColumnsOperations" + }, + "managed_database_move_operations": { + "attr_type": "ManagedDatabaseMoveOperationsOperations" + }, + "managed_database_queries": { + "attr_type": "ManagedDatabaseQueriesOperations" + }, + "managed_database_restore_details": { + "attr_type": "ManagedDatabaseRestoreDetailsOperations" + }, + "managed_databases": { + "attr_type": "ManagedDatabasesOperations" + }, + "managed_database_schemas": { + "attr_type": "ManagedDatabaseSchemasOperations" + }, + "managed_database_security_alert_policies": { + "attr_type": "ManagedDatabaseSecurityAlertPoliciesOperations" + }, + "managed_database_security_events": { + "attr_type": "ManagedDatabaseSecurityEventsOperations" + }, + "managed_database_sensitivity_labels": { + "attr_type": "ManagedDatabaseSensitivityLabelsOperations" + }, + "managed_database_recommended_sensitivity_labels": { + "attr_type": "ManagedDatabaseRecommendedSensitivityLabelsOperations" + }, + "managed_database_tables": { + "attr_type": "ManagedDatabaseTablesOperations" + }, + "managed_database_transparent_data_encryption": { + "attr_type": "ManagedDatabaseTransparentDataEncryptionOperations" + }, + "managed_database_vulnerability_assessment_rule_baselines": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "managed_database_vulnerability_assessments": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentsOperations" + }, + "managed_database_vulnerability_assessment_scans": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentScansOperations" + }, + "managed_instance_administrators": { + "attr_type": "ManagedInstanceAdministratorsOperations" + }, + "managed_instance_advanced_threat_protection_settings": { + "attr_type": "ManagedInstanceAdvancedThreatProtectionSettingsOperations" + }, + "managed_instance_azure_ad_only_authentications": { + "attr_type": "ManagedInstanceAzureADOnlyAuthenticationsOperations" + }, + "managed_instance_dtcs": { + "attr_type": "ManagedInstanceDtcsOperations" + }, + "managed_instance_encryption_protectors": { + "attr_type": "ManagedInstanceEncryptionProtectorsOperations" + }, + "managed_instance_keys": { + "attr_type": "ManagedInstanceKeysOperations" + }, + "managed_instance_long_term_retention_policies": { + "attr_type": "ManagedInstanceLongTermRetentionPoliciesOperations" + }, + "managed_instance_operations": { + "attr_type": "ManagedInstanceOperationsOperations" + }, + "managed_instance_private_endpoint_connections": { + "attr_type": "ManagedInstancePrivateEndpointConnectionsOperations" + }, + "managed_instance_private_link_resources": { + "attr_type": "ManagedInstancePrivateLinkResourcesOperations" + }, + "managed_instances": { + "attr_type": "ManagedInstancesOperations" + }, + "managed_instance_tde_certificates": { + "attr_type": "ManagedInstanceTdeCertificatesOperations" + }, + "managed_instance_vulnerability_assessments": { + "attr_type": "ManagedInstanceVulnerabilityAssessmentsOperations" + }, + "managed_ledger_digest_uploads": { + "attr_type": "ManagedLedgerDigestUploadsOperations" + }, + "managed_restorable_dropped_database_backup_short_term_retention_policies": { + "attr_type": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations" + }, + "managed_server_dns_aliases": { + "attr_type": "ManagedServerDnsAliasesOperations" + }, + "managed_server_security_alert_policies": { + "attr_type": "ManagedServerSecurityAlertPoliciesOperations" + }, + "network_security_perimeter_configurations": { + "attr_type": "NetworkSecurityPerimeterConfigurationsOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "outbound_firewall_rules": { + "attr_type": "OutboundFirewallRulesOperations" + }, + "private_endpoint_connections": { + "attr_type": "PrivateEndpointConnectionsOperations" + }, + "private_link_resources": { + "attr_type": "PrivateLinkResourcesOperations" + }, + "recoverable_databases": { + "attr_type": "RecoverableDatabasesOperations" + }, + "recoverable_managed_databases": { + "attr_type": "RecoverableManagedDatabasesOperations" + }, + "replication_links": { + "attr_type": "ReplicationLinksOperations" + }, + "restorable_dropped_databases": { + "attr_type": "RestorableDroppedDatabasesOperations" + }, + "restorable_dropped_managed_databases": { + "attr_type": "RestorableDroppedManagedDatabasesOperations" + }, + "restore_points": { + "attr_type": "RestorePointsOperations" + }, + "sensitivity_labels": { + "attr_type": "SensitivityLabelsOperations" + }, + "recommended_sensitivity_labels": { + "attr_type": "RecommendedSensitivityLabelsOperations" + }, + "server_advanced_threat_protection_settings": { + "attr_type": "ServerAdvancedThreatProtectionSettingsOperations" + }, + "server_advisors": { + "attr_type": "ServerAdvisorsOperations" + }, + "server_automatic_tuning": { + "attr_type": "ServerAutomaticTuningOperations" + }, + "server_azure_ad_administrators": { + "attr_type": "ServerAzureADAdministratorsOperations" + }, + "server_azure_ad_only_authentications": { + "attr_type": "ServerAzureADOnlyAuthenticationsOperations" + }, + "server_configuration_options": { + "attr_type": "ServerConfigurationOptionsOperations" + }, + "server_connection_policies": { + "attr_type": "ServerConnectionPoliciesOperations" + }, + "server_dev_ops_audit_settings": { + "attr_type": "ServerDevOpsAuditSettingsOperations" + }, + "server_dns_aliases": { + "attr_type": "ServerDnsAliasesOperations" + }, + "server_keys": { + "attr_type": "ServerKeysOperations" + }, + "server_operations": { + "attr_type": "ServerOperationsOperations" + }, + "servers": { + "attr_type": "ServersOperations" + }, + "server_security_alert_policies": { + "attr_type": "ServerSecurityAlertPoliciesOperations" + }, + "server_trust_certificates": { + "attr_type": "ServerTrustCertificatesOperations" + }, + "server_trust_groups": { + "attr_type": "ServerTrustGroupsOperations" + }, + "server_usages": { + "attr_type": "ServerUsagesOperations" + }, + "server_vulnerability_assessments": { + "attr_type": "ServerVulnerabilityAssessmentsOperations" + }, + "sql_agent": { + "attr_type": "SqlAgentOperations" + }, + "sql_vulnerability_assessment_baseline": { + "attr_type": "SqlVulnerabilityAssessmentBaselineOperations" + }, + "sql_vulnerability_assessment_baselines": { + "attr_type": "SqlVulnerabilityAssessmentBaselinesOperations" + }, + "sql_vulnerability_assessment_execute_scan": { + "attr_type": "SqlVulnerabilityAssessmentExecuteScanOperations" + }, + "sql_vulnerability_assessment_rule_baseline": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselineOperations" + }, + "sql_vulnerability_assessment_rule_baselines": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "sql_vulnerability_assessment_scan_result": { + "attr_type": "SqlVulnerabilityAssessmentScanResultOperations" + }, + "sql_vulnerability_assessment_scans": { + "attr_type": "SqlVulnerabilityAssessmentScansOperations" + }, + "sql_vulnerability_assessments_settings": { + "attr_type": "SqlVulnerabilityAssessmentsSettingsOperations" + }, + "sql_vulnerability_assessments": { + "attr_type": "SqlVulnerabilityAssessmentsOperations" + }, + "start_stop_managed_instance_schedules": { + "attr_type": "StartStopManagedInstanceSchedulesOperations" + }, + "subscription_usages": { + "attr_type": "SubscriptionUsagesOperations" + }, + "synapse_link_workspaces": { + "attr_type": "SynapseLinkWorkspacesOperations" + }, + "sync_agents": { + "attr_type": "SyncAgentsOperations" + }, + "sync_groups": { + "attr_type": "SyncGroupsOperations" + }, + "sync_members": { + "attr_type": "SyncMembersOperations" + }, + "tde_certificates": { + "attr_type": "TdeCertificatesOperations" + }, + "time_zones": { + "attr_type": "TimeZonesOperations" + }, + "transparent_data_encryptions": { + "attr_type": "TransparentDataEncryptionsOperations" + }, + "usages": { + "attr_type": "UsagesOperations" + }, + "virtual_clusters": { + "attr_type": "VirtualClustersOperations" + }, + "virtual_network_rules": { + "attr_type": "VirtualNetworkRulesOperations" + }, + "workload_classifiers": { + "attr_type": "WorkloadClassifiersOperations" + }, + "workload_groups": { + "attr_type": "WorkloadGroupsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.operations": { + "class_nodes": { + "BackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "CapabilitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "include": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataWarehouseUserActivitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_warehouse_user_activity_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revert": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseExtensionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseExtensions", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseRecommendedActionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database_advisor": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedActionAutoGenerated", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Database", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExportDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_import_method": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportExistingDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_pause": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_upgrade_data_warehouse": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "rename": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ResourceMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DeletedServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_recover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DistributedAvailabilityGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupsFailoverRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_set_role": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupSetRole", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "EncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EndpointCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "endpoint_type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedDatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedDatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_try_planned_before_forced_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroupUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "replace": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRuleList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "GeoBackupPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "GeoBackupPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "IPv6FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IPv6FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstanceFailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstanceFailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgentUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobCredentialsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobCredential", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobPrivateEndpointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobPrivateEndpoint", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobStep", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_step": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobTargetGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobVersionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Job", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_change_access_tier": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_change_access_tier_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_copy_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_lock_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_lock_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_remove_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_set_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_set_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionManagedInstanceBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_options_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "MaintenanceWindows", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseMoveOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseQueriesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_query": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseRecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseRestoreDetailsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_details_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseTransparentDataEncryptionOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_cancel_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_complete_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_complete_restore": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CompleteDatabaseRestoreDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabase", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_start_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseStartMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceDtcsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceDtc", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceEncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceLongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceLongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstancePrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceTdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedInstanceVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstance", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_start": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_stop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_validate_azure_key_vault_encryption_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "number_of_queries": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "databases": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "aggregation_function": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "observation_metric": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_outbound_network_dependencies_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedLedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedLedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_restorable_dropped_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasCreation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "NetworkSecurityPerimeterConfigurationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reconcile": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "OutboundFirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "PrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "RecoverableDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecoverableManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recoverable_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ReplicationLinksOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLink", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLinkUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorePointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CreateDatabaseRestorePointDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAzureADAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConfigurationOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConfigurationOption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConnectionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConnectionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDevOpsAuditSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDevOpsAuditingSettings", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Server", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_import_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportNewDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "check_name_availability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckNameAvailabilityRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlAgentOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlAgentConfiguration", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "StartStopManagedInstanceSchedulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "StartStopManagedInstanceSchedule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SubscriptionUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "usage_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SynapseLinkWorkspacesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "generate_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_linked_databases": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_hub_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "cancel_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_hub_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_logs": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "continuation_token_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_sync_database_ids": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "trigger_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncMembersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_refresh_member_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_sync_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_member_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "TimeZonesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_zone_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TransparentDataEncryptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LogicalDatabaseTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_suspend": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "UsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand_children": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualClustersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualCluster", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualClusterUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_update_dns_servers": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualNetworkRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualNetworkRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadClassifiersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadClassifier", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_workload_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": false, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.models": { + "class_nodes": { + "AdministratorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AdministratorName": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdministratorType": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdvancedThreatProtectionName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AdvancedThreatProtectionState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "NEW": "NEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Advisor": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "auto_execute_status": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "advisor_status": { + "attr_type": null + }, + "auto_execute_status": { + "attr_type": "auto_execute_status" + }, + "auto_execute_status_inherited_from": { + "attr_type": null + }, + "recommendations_status": { + "attr_type": null + }, + "last_checked": { + "attr_type": null + }, + "recommended_actions": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AdvisorStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "GA": "GA", + "LIMITED_PUBLIC_PREVIEW": "LIMITED_PUBLIC_PREVIEW", + "PRIVATE_PREVIEW": "PRIVATE_PREVIEW", + "PUBLIC_PREVIEW": "PUBLIC_PREVIEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AggregationFunctionType": { + "type": "Enum", + "methods": {}, + "properties": { + "AVG": "AVG", + "MAX": "MAX", + "MIN": "MIN", + "STDEV": "STDEV", + "SUM": "SUM", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AlwaysEncryptedEnclaveType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "VBS": "VBS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AuthMetadataLookupModes": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_AD": "AZURE_AD", + "PAIRED": "PAIRED", + "WINDOWS": "WINDOWS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AuthenticationName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoExecuteStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoExecuteStatusInheritedFrom": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE": "DATABASE", + "DEFAULT": "DEFAULT", + "ELASTIC_POOL": "ELASTIC_POOL", + "SERVER": "SERVER", + "SUBSCRIPTION": "SUBSCRIPTION", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutoPauseDelayTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "step_size": { + "attr_type": null + }, + "default": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "do_not_pause_value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningDisabledReason": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CONFIGURED": "AUTO_CONFIGURED", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "INHERITED_FROM_SERVER": "INHERITED_FROM_SERVER", + "NOT_SUPPORTED": "NOT_SUPPORTED", + "QUERY_STORE_OFF": "QUERY_STORE_OFF", + "QUERY_STORE_READ_ONLY": "QUERY_STORE_READ_ONLY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningMode": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO": "AUTO", + "CUSTOM": "CUSTOM", + "INHERIT": "INHERIT", + "UNSPECIFIED": "UNSPECIFIED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptionModeActual": { + "type": "Enum", + "methods": {}, + "properties": { + "OFF": "OFF", + "ON": "ON", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptionModeDesired": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "OFF": "OFF", + "ON": "ON", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "reason_code": { + "attr_type": null + }, + "reason_desc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningServerMode": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO": "AUTO", + "CUSTOM": "CUSTOM", + "UNSPECIFIED": "UNSPECIFIED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AutomaticTuningServerOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "reason_code": { + "attr_type": null + }, + "reason_desc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "AutomaticTuningServerReason": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CONFIGURED": "AUTO_CONFIGURED", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AvailabilityZoneType": { + "type": "Enum", + "methods": {}, + "properties": { + "NO_PREFERENCE": "NO_PREFERENCE", + "ONE": "ONE", + "THREE": "THREE", + "TWO": "TWO", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "AzureADOnlyAuthListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupShortTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "diff_backup_interval_in_hours": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "retention_days": { + "attr_type": "retention_days" + }, + "diff_backup_interval_in_hours": { + "attr_type": "diff_backup_interval_in_hours" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupShortTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BackupStorageAccessTier": { + "type": "Enum", + "methods": {}, + "properties": { + "ARCHIVE": "ARCHIVE", + "HOT": "HOT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "BackupStorageRedundancy": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "GEO_ZONE": "GEO_ZONE", + "LOCAL": "LOCAL", + "ZONE": "ZONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Baseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "expected_results": { + "attr_type": null + }, + "updated_time": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BaselineAdjustedResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "baseline": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "results_not_in_baseline": { + "attr_type": null + }, + "results_only_in_baseline": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BaselineName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "BenchmarkReference": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "benchmark": { + "attr_type": null + }, + "reference": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "BlobAuditingPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CapabilityGroup": { + "type": "Enum", + "methods": {}, + "properties": { + "SUPPORTED_EDITIONS": "SUPPORTED_EDITIONS", + "SUPPORTED_ELASTIC_POOL_EDITIONS": "SUPPORTED_ELASTIC_POOL_EDITIONS", + "SUPPORTED_INSTANCE_POOL_EDITIONS": "SUPPORTED_INSTANCE_POOL_EDITIONS", + "SUPPORTED_JOB_AGENT_VERSIONS": "SUPPORTED_JOB_AGENT_VERSIONS", + "SUPPORTED_MANAGED_INSTANCE_EDITIONS": "SUPPORTED_MANAGED_INSTANCE_EDITIONS", + "SUPPORTED_MANAGED_INSTANCE_VERSIONS": "SUPPORTED_MANAGED_INSTANCE_VERSIONS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CapabilityStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "AVAILABLE": "AVAILABLE", + "DEFAULT": "DEFAULT", + "DISABLED": "DISABLED", + "VISIBLE": "VISIBLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CatalogCollationType": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE_DEFAULT": "DATABASE_DEFAULT", + "SQL_LATIN1_GENERAL_CP1_CI_AS": "SQL_LATIN1_GENERAL_CP1_CI_AS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CertificateInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "certificate_name": { + "attr_type": null + }, + "expiry_date": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ChangeLongTermRetentionBackupAccessTierParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_storage_access_tier": { + "default": null, + "param_type": "keyword_only" + }, + "operation_mode": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "backup_storage_access_tier": { + "attr_type": "backup_storage_access_tier" + }, + "operation_mode": { + "attr_type": "operation_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckNameAvailabilityReason": { + "type": "Enum", + "methods": {}, + "properties": { + "ALREADY_EXISTS": "ALREADY_EXISTS", + "INVALID": "INVALID", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CheckNameAvailabilityRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CheckNameAvailabilityResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "available": { + "attr_type": null + }, + "reason": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ClientClassificationSource": { + "type": "Enum", + "methods": {}, + "properties": { + "MIP": "MIP", + "NATIVE": "NATIVE", + "NONE": "NONE", + "RECOMMENDED": "RECOMMENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ColumnDataType": { + "type": "Enum", + "methods": {}, + "properties": { + "BIGINT": "BIGINT", + "BINARY": "BINARY", + "BIT": "BIT", + "CHAR": "CHAR", + "DATE": "DATE", + "DATETIME": "DATETIME", + "DATETIME2": "DATETIME2", + "DATETIMEOFFSET": "DATETIMEOFFSET", + "DECIMAL": "DECIMAL", + "FLOAT": "FLOAT", + "GEOGRAPHY": "GEOGRAPHY", + "GEOMETRY": "GEOMETRY", + "HIERARCHYID": "HIERARCHYID", + "IMAGE": "IMAGE", + "INT": "INT", + "MONEY": "MONEY", + "NCHAR": "NCHAR", + "NTEXT": "NTEXT", + "NUMERIC": "NUMERIC", + "NVARCHAR": "NVARCHAR", + "REAL": "REAL", + "SMALLDATETIME": "SMALLDATETIME", + "SMALLINT": "SMALLINT", + "SMALLMONEY": "SMALLMONEY", + "SQL_VARIANT": "SQL_VARIANT", + "SYSNAME": "SYSNAME", + "TEXT": "TEXT", + "TIME": "TIME", + "TIMESTAMP": "TIMESTAMP", + "TINYINT": "TINYINT", + "UNIQUEIDENTIFIER": "UNIQUEIDENTIFIER", + "VARBINARY": "VARBINARY", + "VARCHAR": "VARCHAR", + "XML": "XML", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CompleteDatabaseRestoreDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "last_backup_name": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ConnectionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CopyLongTermRetentionBackupParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_resource_group": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server_fully_qualified_domain_name": { + "default": "none", + "param_type": "keyword_only" + }, + "target_database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "target_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "target_subscription_id": { + "attr_type": "target_subscription_id" + }, + "target_resource_group": { + "attr_type": "target_resource_group" + }, + "target_server_resource_id": { + "attr_type": "target_server_resource_id" + }, + "target_server_fully_qualified_domain_name": { + "attr_type": "target_server_fully_qualified_domain_name" + }, + "target_database_name": { + "attr_type": "target_database_name" + }, + "target_backup_storage_redundancy": { + "attr_type": "target_backup_storage_redundancy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CreateDatabaseRestorePointDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_label": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "restore_point_label": { + "attr_type": "restore_point_label" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "CreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "DEFAULT": "DEFAULT", + "ONLINE_SECONDARY": "ONLINE_SECONDARY", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "RECOVERY": "RECOVERY", + "RESTORE": "RESTORE", + "RESTORE_EXTERNAL_BACKUP": "RESTORE_EXTERNAL_BACKUP", + "RESTORE_EXTERNAL_BACKUP_SECONDARY": "RESTORE_EXTERNAL_BACKUP_SECONDARY", + "RESTORE_LONG_TERM_RETENTION_BACKUP": "RESTORE_LONG_TERM_RETENTION_BACKUP", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "CreatedByType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "KEY": "KEY", + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DNSRefreshOperationStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingFunction": { + "type": "Enum", + "methods": {}, + "properties": { + "CCN": "CCN", + "DEFAULT": "DEFAULT", + "EMAIL": "EMAIL", + "NUMBER": "NUMBER", + "SSN": "SSN", + "TEXT": "TEXT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_state": { + "default": "none", + "param_type": "keyword_only" + }, + "exempt_principals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "data_masking_state": { + "attr_type": "data_masking_state" + }, + "exempt_principals": { + "attr_type": "exempt_principals" + }, + "application_principals": { + "attr_type": null + }, + "masking_level": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_state": { + "default": "none", + "param_type": "keyword_only" + }, + "schema_name": { + "default": "none", + "param_type": "keyword_only" + }, + "table_name": { + "default": "none", + "param_type": "keyword_only" + }, + "column_name": { + "default": "none", + "param_type": "keyword_only" + }, + "alias_name": { + "default": "none", + "param_type": "keyword_only" + }, + "masking_function": { + "default": "none", + "param_type": "keyword_only" + }, + "number_from": { + "default": "none", + "param_type": "keyword_only" + }, + "number_to": { + "default": "none", + "param_type": "keyword_only" + }, + "prefix_size": { + "default": "none", + "param_type": "keyword_only" + }, + "suffix_size": { + "default": "none", + "param_type": "keyword_only" + }, + "replacement_string": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "id_properties_id": { + "attr_type": null + }, + "rule_state": { + "attr_type": "rule_state" + }, + "schema_name": { + "attr_type": "schema_name" + }, + "table_name": { + "attr_type": "table_name" + }, + "column_name": { + "attr_type": "column_name" + }, + "alias_name": { + "attr_type": "alias_name" + }, + "masking_function": { + "attr_type": "masking_function" + }, + "number_from": { + "attr_type": "number_from" + }, + "number_to": { + "attr_type": "number_to" + }, + "prefix_size": { + "attr_type": "prefix_size" + }, + "suffix_size": { + "attr_type": "suffix_size" + }, + "replacement_string": { + "attr_type": "replacement_string" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataMaskingRuleState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataMaskingState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DataWarehouseUserActivities": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "active_queries_count": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataWarehouseUserActivitiesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DataWarehouseUserActivityName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Database": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "sample_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_deletion_date": { + "default": "none", + "param_type": "keyword_only" + }, + "recovery_services_recovery_point_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_scale": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "use_free_limit": { + "default": "none", + "param_type": "keyword_only" + }, + "free_limit_exhaustion_behavior": { + "default": "none", + "param_type": "keyword_only" + }, + "source_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "manual_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "perform_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector_auto_rotation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "kind": { + "attr_type": null + }, + "managed_by": { + "attr_type": null + }, + "identity": { + "attr_type": "identity" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "collation": { + "attr_type": "collation" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "sample_name": { + "attr_type": "sample_name" + }, + "elastic_pool_id": { + "attr_type": "elastic_pool_id" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "status": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "current_service_objective_name": { + "attr_type": null + }, + "requested_service_objective_name": { + "attr_type": null + }, + "default_secondary_location": { + "attr_type": null + }, + "failover_group_id": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "source_database_deletion_date": { + "attr_type": "source_database_deletion_date" + }, + "recovery_services_recovery_point_id": { + "attr_type": "recovery_services_recovery_point_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "max_log_size_bytes": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "read_scale": { + "attr_type": "read_scale" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "current_sku": { + "attr_type": null + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "paused_date": { + "attr_type": null + }, + "resumed_date": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "is_infra_encryption_enabled": { + "attr_type": null + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "keys": { + "attr_type": "keys" + }, + "encryption_protector": { + "attr_type": "encryption_protector" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "use_free_limit": { + "attr_type": "use_free_limit" + }, + "free_limit_exhaustion_behavior": { + "attr_type": "free_limit_exhaustion_behavior" + }, + "source_resource_id": { + "attr_type": "source_resource_id" + }, + "manual_cutover": { + "attr_type": "manual_cutover" + }, + "perform_cutover": { + "attr_type": "perform_cutover" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "encryption_protector_auto_rotation": { + "attr_type": "encryption_protector_auto_rotation" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseAutomaticTuning": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "options": { + "attr_type": "options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_type": { + "default": "none", + "param_type": "keyword_only" + }, + "temporal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_optimized": { + "default": "none", + "param_type": "keyword_only" + }, + "is_computed": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "column_type": { + "attr_type": "column_type" + }, + "temporal_type": { + "attr_type": "temporal_type" + }, + "memory_optimized": { + "attr_type": "memory_optimized" + }, + "is_computed": { + "attr_type": "is_computed" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseColumnListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseExtensions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "database_edition": { + "default": "none", + "param_type": "keyword_only" + }, + "service_objective_name": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation_mode": { + "attr_type": "operation_mode" + }, + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "database_edition": { + "attr_type": "database_edition" + }, + "service_objective_name": { + "attr_type": "service_objective_name" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "tenant_id": { + "attr_type": null + }, + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseIdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "key_version": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_KEY_VAULT": "AZURE_KEY_VAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "operation_phase_details": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseReadScale": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseSchema": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSchemaListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSecurityAlertListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentBaselineSet": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentBaselineSetListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "latest_scan": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "latest_scan": { + "attr_type": "latest_scan" + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "latest_scan": { + "default": "none", + "param_type": "keyword_only" + }, + "results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "latest_scan": { + "attr_type": "latest_scan" + }, + "results": { + "attr_type": "results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselineListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseState": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "DELETED": "DELETED", + "LIVE": "LIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_CLOSED": "AUTO_CLOSED", + "COPYING": "COPYING", + "CREATING": "CREATING", + "DISABLED": "DISABLED", + "EMERGENCY_MODE": "EMERGENCY_MODE", + "INACCESSIBLE": "INACCESSIBLE", + "OFFLINE": "OFFLINE", + "OFFLINE_CHANGING_DW_PERFORMANCE_TIERS": "OFFLINE_CHANGING_DW_PERFORMANCE_TIERS", + "OFFLINE_SECONDARY": "OFFLINE_SECONDARY", + "ONLINE": "ONLINE", + "ONLINE_CHANGING_DW_PERFORMANCE_TIERS": "ONLINE_CHANGING_DW_PERFORMANCE_TIERS", + "PAUSED": "PAUSED", + "PAUSING": "PAUSING", + "RECOVERING": "RECOVERING", + "RECOVERY_PENDING": "RECOVERY_PENDING", + "RESTORING": "RESTORING", + "RESUMING": "RESUMING", + "SCALING": "SCALING", + "SHUTDOWN": "SHUTDOWN", + "STANDBY": "STANDBY", + "STARTING": "STARTING", + "STOPPED": "STOPPED", + "STOPPING": "STOPPING", + "SUSPECT": "SUSPECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DatabaseTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "temporal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_optimized": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "temporal_type": { + "attr_type": "temporal_type" + }, + "memory_optimized": { + "attr_type": "memory_optimized" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseTableListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "sample_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_deletion_date": { + "default": "none", + "param_type": "keyword_only" + }, + "recovery_services_recovery_point_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_scale": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "use_free_limit": { + "default": "none", + "param_type": "keyword_only" + }, + "free_limit_exhaustion_behavior": { + "default": "none", + "param_type": "keyword_only" + }, + "manual_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "perform_cutover": { + "default": "none", + "param_type": "keyword_only" + }, + "encryption_protector_auto_rotation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "collation": { + "attr_type": "collation" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "sample_name": { + "attr_type": "sample_name" + }, + "elastic_pool_id": { + "attr_type": "elastic_pool_id" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "status": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "current_service_objective_name": { + "attr_type": null + }, + "requested_service_objective_name": { + "attr_type": null + }, + "default_secondary_location": { + "attr_type": null + }, + "failover_group_id": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "source_database_deletion_date": { + "attr_type": "source_database_deletion_date" + }, + "recovery_services_recovery_point_id": { + "attr_type": "recovery_services_recovery_point_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "max_log_size_bytes": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "read_scale": { + "attr_type": "read_scale" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "current_sku": { + "attr_type": null + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "paused_date": { + "attr_type": null + }, + "resumed_date": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "is_infra_encryption_enabled": { + "attr_type": null + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "keys": { + "attr_type": "keys" + }, + "encryption_protector": { + "attr_type": "encryption_protector" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "use_free_limit": { + "attr_type": "use_free_limit" + }, + "free_limit_exhaustion_behavior": { + "attr_type": "free_limit_exhaustion_behavior" + }, + "manual_cutover": { + "attr_type": "manual_cutover" + }, + "perform_cutover": { + "attr_type": "perform_cutover" + }, + "encryption_protector_auto_rotation": { + "attr_type": "encryption_protector_auto_rotation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseUserIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentRuleBaseline": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_results": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "baseline_results": { + "attr_type": "baseline_results" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentRuleBaselineItem": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "result": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "result": { + "attr_type": "result" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DatabaseVulnerabilityAssessmentScansExport": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "exported_report_location": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DayOfWeek": { + "type": "Enum", + "methods": {}, + "properties": { + "FRIDAY": "FRIDAY", + "MONDAY": "MONDAY", + "SATURDAY": "SATURDAY", + "SUNDAY": "SUNDAY", + "THURSDAY": "THURSDAY", + "TUESDAY": "TUESDAY", + "WEDNESDAY": "WEDNESDAY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DeletedServer": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "version": { + "attr_type": null + }, + "deletion_time": { + "attr_type": null + }, + "original_id": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DeletedServerListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DevOpsAuditingSettingsName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "DiffBackupIntervalInHours": { + "type": "Enum", + "methods": {}, + "properties": { + "TWELVE": "TWELVE", + "TWENTY_FOUR": "TWENTY_FOUR", + "as_integer_ratio": "as_integer_ratio", + "bit_count": "bit_count", + "bit_length": "bit_length", + "conjugate": "conjugate", + "denominator": "denominator", + "from_bytes": "from_bytes", + "imag": "imag", + "is_integer": "is_integer", + "numerator": "numerator", + "real": "real", + "to_bytes": "to_bytes" + } + }, + "DistributedAvailabilityGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replication_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_availability_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_link_role": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_availability_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "failover_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "seeding_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "distributed_availability_group_name": { + "attr_type": null + }, + "distributed_availability_group_id": { + "attr_type": null + }, + "replication_mode": { + "attr_type": "replication_mode" + }, + "partner_link_role": { + "attr_type": null + }, + "partner_availability_group_name": { + "attr_type": "partner_availability_group_name" + }, + "partner_endpoint": { + "attr_type": "partner_endpoint" + }, + "instance_link_role": { + "attr_type": "instance_link_role" + }, + "instance_availability_group_name": { + "attr_type": "instance_availability_group_name" + }, + "failover_mode": { + "attr_type": "failover_mode" + }, + "seeding_mode": { + "attr_type": "seeding_mode" + }, + "databases": { + "attr_type": "databases" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": "database_name" + }, + "instance_replica_id": { + "attr_type": null + }, + "partner_replica_id": { + "attr_type": null + }, + "replica_state": { + "attr_type": null + }, + "seeding_progress": { + "attr_type": null + }, + "synchronization_health": { + "attr_type": null + }, + "connected_state": { + "attr_type": null + }, + "last_received_lsn": { + "attr_type": null + }, + "last_received_time": { + "attr_type": null + }, + "last_sent_lsn": { + "attr_type": null + }, + "last_sent_time": { + "attr_type": null + }, + "last_commit_lsn": { + "attr_type": null + }, + "last_commit_time": { + "attr_type": null + }, + "last_hardened_lsn": { + "attr_type": null + }, + "last_hardened_time": { + "attr_type": null + }, + "last_backup_lsn": { + "attr_type": null + }, + "last_backup_time": { + "attr_type": null + }, + "most_recent_link_error": { + "attr_type": null + }, + "partner_auth_cert_validity": { + "attr_type": null + }, + "instance_send_replication_lag_seconds": { + "attr_type": null + }, + "instance_redo_replication_lag_seconds": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupSetRole": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_role": { + "default": null, + "param_type": "keyword_only" + }, + "role_change_type": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "instance_role": { + "attr_type": "instance_role" + }, + "role_change_type": { + "attr_type": "role_change_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupsFailoverRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_type": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_type": { + "attr_type": "failover_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DistributedAvailabilityGroupsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "DtcName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "EditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_service_level_objectives": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "read_scale": { + "attr_type": null + }, + "supported_storage_capabilities": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPool": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "per_database_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "kind": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "per_database_settings": { + "attr_type": "per_database_settings" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_elastic_pool_performance_levels": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ElasticPoolListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "elastic_pool_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseMaxPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "supported_per_database_min_performance_levels": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseMinPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerDatabaseSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "max_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_capacity": { + "attr_type": "min_capacity" + }, + "max_capacity": { + "attr_type": "max_capacity" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolPerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "performance_level": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "max_database_count": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "supported_max_sizes": { + "attr_type": null + }, + "supported_per_database_max_sizes": { + "attr_type": null + }, + "supported_per_database_max_performance_levels": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "supported_min_capacities": { + "attr_type": null + }, + "supported_auto_pause_delay": { + "attr_type": null + }, + "supported_per_database_auto_pause_delay": { + "attr_type": null + }, + "supported_zones": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ElasticPoolState": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DISABLED": "DISABLED", + "READY": "READY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ElasticPoolUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "per_database_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "high_availability_replica_count": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_pause_delay": { + "default": "none", + "param_type": "keyword_only" + }, + "preferred_enclave_type": { + "default": "none", + "param_type": "keyword_only" + }, + "availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "min_capacity": { + "attr_type": "min_capacity" + }, + "per_database_settings": { + "attr_type": "per_database_settings" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "license_type": { + "attr_type": "license_type" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "high_availability_replica_count": { + "attr_type": "high_availability_replica_count" + }, + "auto_pause_delay": { + "attr_type": "auto_pause_delay" + }, + "preferred_enclave_type": { + "attr_type": "preferred_enclave_type" + }, + "availability_zone": { + "attr_type": "availability_zone" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtector": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_name": { + "default": "none", + "param_type": "keyword_only" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_rotation_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "server_key_name": { + "attr_type": "server_key_name" + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": "auto_rotation_enabled" + }, + "key_version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtectorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EncryptionProtectorName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "EndpointCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "public_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "public_blob": { + "attr_type": "public_blob" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointCertificateListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointDependency": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "domain_name": { + "attr_type": null + }, + "endpoint_details": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "EndpointDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "port": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorAdditionalInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorDetail": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorResponse": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "error": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error": { + "attr_type": "error" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ErrorType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ExportDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedDatabaseBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "predicate_expression": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "predicate_expression": { + "attr_type": "predicate_expression" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedDatabaseBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedServerBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_devops_audit_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "predicate_expression": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_devops_audit_enabled": { + "attr_type": "is_devops_audit_enabled" + }, + "predicate_expression": { + "attr_type": "predicate_expression" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExtendedServerBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ExternalGovernanceStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_servers": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "tags": { + "attr_type": "tags" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "replication_role": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "partner_servers": { + "attr_type": "partner_servers" + }, + "databases": { + "attr_type": "databases" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupDatabasesSecondaryType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReadOnlyEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "target_server": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "target_server": { + "attr_type": "target_server" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReadWriteEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": null, + "param_type": "keyword_only" + }, + "failover_with_data_loss_grace_period_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "failover_with_data_loss_grace_period_minutes": { + "attr_type": "failover_with_data_loss_grace_period_minutes" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverGroupReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverGroupUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "databases": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_servers": { + "default": "none", + "param_type": "keyword_only" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "databases": { + "attr_type": "databases" + }, + "partner_servers": { + "attr_type": "partner_servers" + }, + "secondary_type": { + "attr_type": "secondary_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FailoverModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "MANUAL": "MANUAL", + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FailoverType": { + "type": "Enum", + "methods": {}, + "properties": { + "FORCED_ALLOW_DATA_LOSS": "FORCED_ALLOW_DATA_LOSS", + "PLANNED": "PLANNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "start_ip_address": { + "default": "none", + "param_type": "keyword_only" + }, + "end_ip_address": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_ip_address": { + "attr_type": "start_ip_address" + }, + "end_ip_address": { + "attr_type": "end_ip_address" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FirewallRuleList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "values": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "values": { + "attr_type": "values" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "FreeLimitExhaustionBehavior": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTO_PAUSE": "AUTO_PAUSE", + "BILL_OVER_USAGE": "BILL_OVER_USAGE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "FreeLimitExhaustionBehaviorCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "exhaustion_behavior_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "storage_type": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "GeoBackupPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "GeoBackupPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "HybridSecondaryUsage": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "PASSIVE": "PASSIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "HybridSecondaryUsageDetected": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "PASSIVE": "PASSIVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "IPv6FirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "start_i_pv6_address": { + "default": "none", + "param_type": "keyword_only" + }, + "end_i_pv6_address": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_i_pv6_address": { + "attr_type": "start_i_pv6_address" + }, + "end_i_pv6_address": { + "attr_type": "end_i_pv6_address" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "IPv6FirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "IdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "SYSTEM_ASSIGNED_USER_ASSIGNED": "SYSTEM_ASSIGNED_USER_ASSIGNED", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ImplementationMethod": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_POWER_SHELL": "AZURE_POWER_SHELL", + "T_SQL": "T_SQL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ImportExistingDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportExtensionsOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportExtensionsOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "last_modified_time": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "blob_uri": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportExportOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "last_modified_time": { + "attr_type": null + }, + "blob_uri": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ImportNewDatabaseDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_key_type": { + "default": null, + "param_type": "keyword_only" + }, + "storage_key": { + "default": null, + "param_type": "keyword_only" + }, + "storage_uri": { + "default": null, + "param_type": "keyword_only" + }, + "administrator_login": { + "default": null, + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "edition": { + "default": "none", + "param_type": "keyword_only" + }, + "service_objective_name": { + "default": "none", + "param_type": "keyword_only" + }, + "max_size_bytes": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_type": { + "default": "none", + "param_type": "keyword_only" + }, + "network_isolation": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": "database_name" + }, + "edition": { + "attr_type": "edition" + }, + "service_objective_name": { + "attr_type": "service_objective_name" + }, + "max_size_bytes": { + "attr_type": "max_size_bytes" + }, + "storage_key_type": { + "attr_type": "storage_key_type" + }, + "storage_key": { + "attr_type": "storage_key" + }, + "storage_uri": { + "attr_type": "storage_uri" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "authentication_type": { + "attr_type": "authentication_type" + }, + "network_isolation": { + "attr_type": "network_isolation" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InaccessibilityReason": { + "type": "Enum", + "methods": {}, + "properties": { + "DATABASE_REPLICATION": "DATABASE_REPLICATION", + "TRANSPARENT_DATA_ENCRYPTION": "TRANSPARENT_DATA_ENCRYPTION", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstanceFailoverGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "secondary_type": { + "default": "none", + "param_type": "keyword_only" + }, + "read_write_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "read_only_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_regions": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_pairs": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "secondary_type": { + "attr_type": "secondary_type" + }, + "read_write_endpoint": { + "attr_type": "read_write_endpoint" + }, + "read_only_endpoint": { + "attr_type": "read_only_endpoint" + }, + "replication_role": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "partner_regions": { + "attr_type": "partner_regions" + }, + "managed_instance_pairs": { + "attr_type": "managed_instance_pairs" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReadOnlyEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReadWriteEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_policy": { + "default": null, + "param_type": "keyword_only" + }, + "failover_with_data_loss_grace_period_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "failover_policy": { + "attr_type": "failover_policy" + }, + "failover_with_data_loss_grace_period_minutes": { + "attr_type": "failover_with_data_loss_grace_period_minutes" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceFailoverGroupReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstancePool": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "license_type": { + "attr_type": "license_type" + }, + "dns_zone": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_families": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolFamilyCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "supported_vcores_values": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "InstancePoolListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "instance_pool_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "error_type": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "license_type": { + "attr_type": "license_type" + }, + "dns_zone": { + "attr_type": null + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstancePoolVcoresCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "storage_limit": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "InstanceRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "IsRetryable": { + "type": "Enum", + "methods": {}, + "properties": { + "NO": "NO", + "YES": "YES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Job": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "default": "str", + "param_type": "keyword_only" + }, + "schedule": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": "description" + }, + "version": { + "attr_type": null + }, + "schedule": { + "attr_type": "schedule" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "database_id": { + "attr_type": "database_id" + }, + "state": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_service_level_objectives": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tenant_id": { + "attr_type": "tenant_id" + }, + "type": { + "attr_type": "type" + }, + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentIdentityType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "SYSTEM_ASSIGNED_USER_ASSIGNED": "SYSTEM_ASSIGNED_USER_ASSIGNED", + "USER_ASSIGNED": "USER_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobAgentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentServiceLevelObjectiveCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentState": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DELETING": "DELETING", + "DISABLED": "DISABLED", + "READY": "READY", + "UPDATING": "UPDATING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobAgentUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "sku": { + "attr_type": "sku" + }, + "tags": { + "attr_type": "tags" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentUserAssignedIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobAgentVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobCredential": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "username": { + "default": "none", + "param_type": "keyword_only" + }, + "password": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "username": { + "attr_type": "username" + }, + "password": { + "attr_type": "password" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobCredentialListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecution": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "current_attempts": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "job_version": { + "attr_type": null + }, + "step_name": { + "attr_type": null + }, + "step_id": { + "attr_type": null + }, + "job_execution_id": { + "attr_type": null + }, + "lifecycle": { + "attr_type": null + }, + "provisioning_state": { + "attr_type": null + }, + "create_time": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "current_attempts": { + "attr_type": "current_attempts" + }, + "current_attempt_start_time": { + "attr_type": null + }, + "last_message": { + "attr_type": null + }, + "target": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecutionLifecycle": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "CREATED": "CREATED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SKIPPED": "SKIPPED", + "SUCCEEDED": "SUCCEEDED", + "SUCCEEDED_WITH_SKIPPED": "SUCCEEDED_WITH_SKIPPED", + "TIMED_OUT": "TIMED_OUT", + "WAITING_FOR_CHILD_JOB_EXECUTIONS": "WAITING_FOR_CHILD_JOB_EXECUTIONS", + "WAITING_FOR_RETRY": "WAITING_FOR_RETRY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobExecutionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobExecutionTarget": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobPrivateEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_server_azure_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "target_server_azure_resource_id": { + "attr_type": "target_server_azure_resource_id" + }, + "private_endpoint_id": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobPrivateEndpointListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobSchedule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "str", + "param_type": "keyword_only" + }, + "end_time": { + "default": "str", + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "interval": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_time": { + "attr_type": "start_time" + }, + "end_time": { + "attr_type": "end_time" + }, + "type": { + "attr_type": "type" + }, + "enabled": { + "attr_type": "enabled" + }, + "interval": { + "attr_type": "interval" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobScheduleType": { + "type": "Enum", + "methods": {}, + "properties": { + "ONCE": "ONCE", + "RECURRING": "RECURRING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStep": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_id": { + "default": "none", + "param_type": "keyword_only" + }, + "target_group": { + "default": "none", + "param_type": "keyword_only" + }, + "credential": { + "default": "none", + "param_type": "keyword_only" + }, + "action": { + "default": "none", + "param_type": "keyword_only" + }, + "output": { + "default": "none", + "param_type": "keyword_only" + }, + "execution_options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "step_id": { + "attr_type": "step_id" + }, + "target_group": { + "attr_type": "target_group" + }, + "credential": { + "attr_type": "credential" + }, + "action": { + "attr_type": "action" + }, + "output": { + "attr_type": "output" + }, + "execution_options": { + "attr_type": "execution_options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepAction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "value": { + "default": null, + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "source": { + "default": "str", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "source": { + "attr_type": "source" + }, + "value": { + "attr_type": "value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepActionSource": { + "type": "Enum", + "methods": {}, + "properties": { + "INLINE": "INLINE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStepActionType": { + "type": "Enum", + "methods": {}, + "properties": { + "T_SQL": "T_SQL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobStepExecutionOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "timeout_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "retry_attempts": { + "default": "int", + "param_type": "keyword_only" + }, + "initial_retry_interval_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "maximum_retry_interval_seconds": { + "default": "int", + "param_type": "keyword_only" + }, + "retry_interval_backoff_multiplier": { + "default": "int", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "timeout_seconds": { + "attr_type": "timeout_seconds" + }, + "retry_attempts": { + "attr_type": "retry_attempts" + }, + "initial_retry_interval_seconds": { + "attr_type": "initial_retry_interval_seconds" + }, + "maximum_retry_interval_seconds": { + "attr_type": "maximum_retry_interval_seconds" + }, + "retry_interval_backoff_multiplier": { + "attr_type": "retry_interval_backoff_multiplier" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepOutput": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "keyword_only" + }, + "database_name": { + "default": null, + "param_type": "keyword_only" + }, + "table_name": { + "default": null, + "param_type": "keyword_only" + }, + "type": { + "default": "str", + "param_type": "keyword_only" + }, + "subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_group_name": { + "default": "none", + "param_type": "keyword_only" + }, + "schema_name": { + "default": "str", + "param_type": "keyword_only" + }, + "credential": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type": { + "attr_type": "type" + }, + "subscription_id": { + "attr_type": "subscription_id" + }, + "resource_group_name": { + "attr_type": "resource_group_name" + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "schema_name": { + "attr_type": "schema_name" + }, + "table_name": { + "attr_type": "table_name" + }, + "credential": { + "attr_type": "credential" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobStepOutputType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_DATABASE": "SQL_DATABASE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobTarget": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "keyword_only" + }, + "membership_type": { + "default": "str", + "param_type": "keyword_only" + }, + "server_name": { + "default": "none", + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "elastic_pool_name": { + "default": "none", + "param_type": "keyword_only" + }, + "shard_map_name": { + "default": "none", + "param_type": "keyword_only" + }, + "refresh_credential": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "membership_type": { + "attr_type": "membership_type" + }, + "type": { + "attr_type": "type" + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "elastic_pool_name": { + "attr_type": "elastic_pool_name" + }, + "shard_map_name": { + "attr_type": "shard_map_name" + }, + "refresh_credential": { + "attr_type": "refresh_credential" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "members": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "members": { + "attr_type": "members" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobTargetGroupMembershipType": { + "type": "Enum", + "methods": {}, + "properties": { + "EXCLUDE": "EXCLUDE", + "INCLUDE": "INCLUDE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobTargetType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_DATABASE": "SQL_DATABASE", + "SQL_ELASTIC_POOL": "SQL_ELASTIC_POOL", + "SQL_SERVER": "SQL_SERVER", + "SQL_SHARD_MAP": "SQL_SHARD_MAP", + "TARGET_GROUP": "TARGET_GROUP", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "JobVersion": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "JobVersionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploads": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "digest_storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "digest_storage_endpoint": { + "attr_type": "digest_storage_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploadsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LedgerDigestUploadsName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LedgerDigestUploadsState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LicenseTypeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LinkRole": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LocationCapabilities": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_server_versions": { + "attr_type": null + }, + "supported_managed_instance_versions": { + "attr_type": null + }, + "supported_job_agent_versions": { + "attr_type": null + }, + "is_zone_resilient_provisioning_allowed": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogSizeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogSizeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "GIGABYTES": "GIGABYTES", + "MEGABYTES": "MEGABYTES", + "PERCENT": "PERCENT", + "PETABYTES": "PETABYTES", + "TERABYTES": "TERABYTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "LogicalDatabaseTransparentDataEncryption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "scan_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "scan_state": { + "attr_type": "scan_state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalDatabaseTransparentDataEncryptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalServerAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LogicalServerSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "is_backup_immutable": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "legal_hold_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_name": { + "attr_type": null + }, + "server_create_time": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "database_deletion_time": { + "attr_type": null + }, + "backup_time": { + "attr_type": null + }, + "backup_expiration_time": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "is_backup_immutable": { + "attr_type": "is_backup_immutable" + }, + "time_based_immutability": { + "attr_type": "time_based_immutability" + }, + "time_based_immutability_mode": { + "attr_type": "time_based_immutability_mode" + }, + "legal_hold_immutability": { + "attr_type": "legal_hold_immutability" + }, + "backup_storage_access_tier": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionBackupOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "operation_type": { + "attr_type": null + }, + "from_backup_resource_id": { + "attr_type": null + }, + "to_backup_resource_id": { + "attr_type": null + }, + "target_backup_storage_redundancy": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_based_immutability": { + "default": "none", + "param_type": "keyword_only" + }, + "time_based_immutability_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "weekly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "monthly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "yearly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "week_of_year": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_based_immutability": { + "attr_type": "time_based_immutability" + }, + "time_based_immutability_mode": { + "attr_type": "time_based_immutability_mode" + }, + "weekly_retention": { + "attr_type": "weekly_retention" + }, + "monthly_retention": { + "attr_type": "monthly_retention" + }, + "yearly_retention": { + "attr_type": "yearly_retention" + }, + "week_of_year": { + "attr_type": "week_of_year" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "LongTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MaintenanceConfigurationCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindowOptions": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_window_cycles": { + "default": "none", + "param_type": "keyword_only" + }, + "min_duration_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "default_duration_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "min_cycles": { + "default": "none", + "param_type": "keyword_only" + }, + "time_granularity_in_minutes": { + "default": "none", + "param_type": "keyword_only" + }, + "allow_multiple_maintenance_windows_per_cycle": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_enabled": { + "attr_type": "is_enabled" + }, + "maintenance_window_cycles": { + "attr_type": "maintenance_window_cycles" + }, + "min_duration_in_minutes": { + "attr_type": "min_duration_in_minutes" + }, + "default_duration_in_minutes": { + "attr_type": "default_duration_in_minutes" + }, + "min_cycles": { + "attr_type": "min_cycles" + }, + "time_granularity_in_minutes": { + "attr_type": "time_granularity_in_minutes" + }, + "allow_multiple_maintenance_windows_per_cycle": { + "attr_type": "allow_multiple_maintenance_windows_per_cycle" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindowTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "day_of_week": { + "default": "none", + "param_type": "keyword_only" + }, + "start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "duration": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "day_of_week": { + "attr_type": "day_of_week" + }, + "start_time": { + "attr_type": "start_time" + }, + "duration": { + "attr_type": "duration" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaintenanceWindows": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_ranges": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_ranges": { + "attr_type": "time_ranges" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedBackupShortTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "retention_days": { + "attr_type": "retention_days" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedBackupShortTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_identity": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_token": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_complete_restore": { + "default": "none", + "param_type": "keyword_only" + }, + "last_backup_name": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_target_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "collation": { + "attr_type": "collation" + }, + "status": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "earliest_restore_point": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "default_secondary_location": { + "attr_type": null + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "storage_container_uri": { + "attr_type": "storage_container_uri" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "cross_subscription_source_database_id": { + "attr_type": "cross_subscription_source_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "cross_subscription_restorable_dropped_database_id": { + "attr_type": "cross_subscription_restorable_dropped_database_id" + }, + "storage_container_identity": { + "attr_type": "storage_container_identity" + }, + "storage_container_sas_token": { + "attr_type": "storage_container_sas_token" + }, + "failover_group_id": { + "attr_type": null + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "auto_complete_restore": { + "attr_type": "auto_complete_restore" + }, + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "cross_subscription_target_managed_instance_id": { + "attr_type": "cross_subscription_target_managed_instance_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "extended_accessibility_info": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "RECOVERY": "RECOVERY", + "RESTORE_EXTERNAL_BACKUP": "RESTORE_EXTERNAL_BACKUP", + "RESTORE_LONG_TERM_RETENTION_BACKUP": "RESTORE_LONG_TERM_RETENTION_BACKUP", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedDatabaseExtendedAccessibilityInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "inaccessibility_reason_error_code": { + "attr_type": null + }, + "inaccessibility_reason_description": { + "attr_type": null + }, + "inaccessibility_reason_kind": { + "attr_type": null + }, + "inaccessibility_reason_tde_key_uri": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "destination_managed_database_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "destination_managed_database_id": { + "attr_type": "destination_managed_database_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseMoveOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "operation_mode": { + "attr_type": null + }, + "source_managed_instance_name": { + "attr_type": null + }, + "target_managed_instance_name": { + "attr_type": null + }, + "source_managed_instance_id": { + "attr_type": null + }, + "target_managed_instance_id": { + "attr_type": null + }, + "source_database_name": { + "attr_type": null + }, + "target_database_name": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsBackupSetProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": null + }, + "first_stripe_name": { + "attr_type": null + }, + "number_of_stripes": { + "attr_type": null + }, + "backup_size_mb": { + "attr_type": null + }, + "restore_started_timestamp_utc": { + "attr_type": null + }, + "restore_finished_timestamp_utc": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "type_properties_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "block_reason": { + "attr_type": null + }, + "last_uploaded_file_name": { + "attr_type": null + }, + "last_uploaded_file_time": { + "attr_type": null + }, + "last_restored_file_name": { + "attr_type": null + }, + "last_restored_file_time": { + "attr_type": null + }, + "percent_completed": { + "attr_type": null + }, + "current_restored_size_mb": { + "attr_type": null + }, + "current_restore_plan_size_mb": { + "attr_type": null + }, + "current_backup_type": { + "attr_type": null + }, + "current_restoring_file_name": { + "attr_type": null + }, + "number_of_files_detected": { + "attr_type": null + }, + "number_of_files_queued": { + "attr_type": null + }, + "number_of_files_skipped": { + "attr_type": null + }, + "number_of_files_restoring": { + "attr_type": null + }, + "number_of_files_restored": { + "attr_type": null + }, + "number_of_files_unrestorable": { + "attr_type": null + }, + "full_backup_sets": { + "attr_type": null + }, + "diff_backup_sets": { + "attr_type": null + }, + "log_backup_sets": { + "attr_type": null + }, + "unrestorable_files": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseRestoreDetailsUnrestorableFileProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseStartMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "destination_managed_database_id": { + "default": null, + "param_type": "keyword_only" + }, + "operation_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "destination_managed_database_id": { + "attr_type": "destination_managed_database_id" + }, + "operation_mode": { + "attr_type": "operation_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedDatabaseStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "CREATING": "CREATING", + "DB_COPYING": "DB_COPYING", + "DB_MOVING": "DB_MOVING", + "INACCESSIBLE": "INACCESSIBLE", + "OFFLINE": "OFFLINE", + "ONLINE": "ONLINE", + "RESTORING": "RESTORING", + "SHUTDOWN": "SHUTDOWN", + "STARTING": "STARTING", + "STOPPED": "STOPPED", + "STOPPING": "STOPPING", + "UPDATING": "UPDATING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedDatabaseUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "catalog_collation": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_uri": { + "default": "none", + "param_type": "keyword_only" + }, + "source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_source_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_restorable_dropped_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_identity": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_token": { + "default": "none", + "param_type": "keyword_only" + }, + "recoverable_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "long_term_retention_backup_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_complete_restore": { + "default": "none", + "param_type": "keyword_only" + }, + "last_backup_name": { + "default": "none", + "param_type": "keyword_only" + }, + "cross_subscription_target_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "is_ledger_on": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "collation": { + "attr_type": "collation" + }, + "status": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "earliest_restore_point": { + "attr_type": null + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "default_secondary_location": { + "attr_type": null + }, + "catalog_collation": { + "attr_type": "catalog_collation" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "storage_container_uri": { + "attr_type": "storage_container_uri" + }, + "source_database_id": { + "attr_type": "source_database_id" + }, + "cross_subscription_source_database_id": { + "attr_type": "cross_subscription_source_database_id" + }, + "restorable_dropped_database_id": { + "attr_type": "restorable_dropped_database_id" + }, + "cross_subscription_restorable_dropped_database_id": { + "attr_type": "cross_subscription_restorable_dropped_database_id" + }, + "storage_container_identity": { + "attr_type": "storage_container_identity" + }, + "storage_container_sas_token": { + "attr_type": "storage_container_sas_token" + }, + "failover_group_id": { + "attr_type": null + }, + "recoverable_database_id": { + "attr_type": "recoverable_database_id" + }, + "long_term_retention_backup_resource_id": { + "attr_type": "long_term_retention_backup_resource_id" + }, + "auto_complete_restore": { + "attr_type": "auto_complete_restore" + }, + "last_backup_name": { + "attr_type": "last_backup_name" + }, + "cross_subscription_target_managed_instance_id": { + "attr_type": "cross_subscription_target_managed_instance_id" + }, + "is_ledger_on": { + "attr_type": "is_ledger_on" + }, + "extended_accessibility_info": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstance": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "is_general_purpose_v2": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "hybrid_secondary_usage": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_iops": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_throughput_mbps": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "dns_zone_partner": { + "default": "none", + "param_type": "keyword_only" + }, + "public_data_endpoint_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "source_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "proxy_override": { + "default": "none", + "param_type": "keyword_only" + }, + "timezone_id": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "service_principal": { + "default": "none", + "param_type": "keyword_only" + }, + "pricing_model": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_metadata": { + "default": "none", + "param_type": "keyword_only" + }, + "database_format": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_logical_availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "sku": { + "attr_type": "sku" + }, + "provisioning_state": { + "attr_type": null + }, + "managed_instance_create_mode": { + "attr_type": "managed_instance_create_mode" + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": "is_general_purpose_v2" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "state": { + "attr_type": null + }, + "license_type": { + "attr_type": "license_type" + }, + "hybrid_secondary_usage": { + "attr_type": "hybrid_secondary_usage" + }, + "hybrid_secondary_usage_detected": { + "attr_type": null + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "storage_iops": { + "attr_type": "storage_iops" + }, + "storage_throughput_mbps": { + "attr_type": "storage_throughput_mbps" + }, + "memory_size_in_gb": { + "attr_type": "memory_size_in_gb" + }, + "collation": { + "attr_type": "collation" + }, + "dns_zone": { + "attr_type": null + }, + "dns_zone_partner": { + "attr_type": "dns_zone_partner" + }, + "public_data_endpoint_enabled": { + "attr_type": "public_data_endpoint_enabled" + }, + "source_managed_instance_id": { + "attr_type": "source_managed_instance_id" + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "proxy_override": { + "attr_type": "proxy_override" + }, + "timezone_id": { + "attr_type": "timezone_id" + }, + "instance_pool_id": { + "attr_type": "instance_pool_id" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "service_principal": { + "attr_type": "service_principal" + }, + "virtual_cluster_id": { + "attr_type": null + }, + "external_governance_status": { + "attr_type": null + }, + "pricing_model": { + "attr_type": "pricing_model" + }, + "create_time": { + "attr_type": null + }, + "authentication_metadata": { + "attr_type": "authentication_metadata" + }, + "database_format": { + "attr_type": "database_format" + }, + "requested_logical_availability_zone": { + "attr_type": "requested_logical_availability_zone" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministratorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdministratorType": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE_DIRECTORY": "ACTIVE_DIRECTORY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAdvancedThreatProtectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAzureADOnlyAuthListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceAzureADOnlyAuthentication": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDatabaseFormat": { + "type": "Enum", + "methods": {}, + "properties": { + "ALWAYS_UP_TO_DATE": "ALWAYS_UP_TO_DATE", + "SQL_SERVER2022": "SQL_SERVER2022", + "SQL_SERVER2025": "SQL_SERVER2025", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceDtc": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "security_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "external_dns_suffix_search_list": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "dtc_enabled": { + "attr_type": "dtc_enabled" + }, + "security_settings": { + "attr_type": "security_settings" + }, + "external_dns_suffix_search_list": { + "attr_type": "external_dns_suffix_search_list" + }, + "dtc_host_name_dns_suffix": { + "attr_type": null + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcSecuritySettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "transaction_manager_communication_settings": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "sna_lu6_point2_transactions_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_default_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "xa_transactions_maximum_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "transaction_manager_communication_settings": { + "attr_type": "transaction_manager_communication_settings" + }, + "xa_transactions_enabled": { + "attr_type": "xa_transactions_enabled" + }, + "sna_lu6_point2_transactions_enabled": { + "attr_type": "sna_lu6_point2_transactions_enabled" + }, + "xa_transactions_default_timeout": { + "attr_type": "xa_transactions_default_timeout" + }, + "xa_transactions_maximum_timeout": { + "attr_type": "xa_transactions_maximum_timeout" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceDtcTransactionManagerCommunicationSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "allow_inbound_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "allow_outbound_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "allow_inbound_enabled": { + "attr_type": "allow_inbound_enabled" + }, + "allow_outbound_enabled": { + "attr_type": "allow_outbound_enabled" + }, + "authentication": { + "attr_type": "authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEditionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": null + }, + "supported_families": { + "attr_type": null + }, + "supported_storage_capabilities": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEncryptionProtector": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_name": { + "default": "none", + "param_type": "keyword_only" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "auto_rotation_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "server_key_name": { + "attr_type": "server_key_name" + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": null + }, + "thumbprint": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": "auto_rotation_enabled" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceEncryptionProtectorListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceExternalAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "principal_type": { + "attr_type": "principal_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceFamilyCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "supported_vcores_values": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "uri": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": "uri" + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceKeyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLicenseType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASE_PRICE": "BASE_PRICE", + "LICENSE_INCLUDED": "LICENSE_INCLUDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionBackup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_instance_name": { + "attr_type": null + }, + "managed_instance_create_time": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "database_deletion_time": { + "attr_type": null + }, + "backup_time": { + "attr_type": null + }, + "backup_expiration_time": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "backup_storage_access_tier": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionBackupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_storage_access_tier": { + "default": "none", + "param_type": "keyword_only" + }, + "weekly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "monthly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "yearly_retention": { + "default": "none", + "param_type": "keyword_only" + }, + "week_of_year": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "backup_storage_access_tier": { + "attr_type": "backup_storage_access_tier" + }, + "weekly_retention": { + "attr_type": "weekly_retention" + }, + "monthly_retention": { + "attr_type": "monthly_retention" + }, + "yearly_retention": { + "attr_type": "yearly_retention" + }, + "week_of_year": { + "attr_type": "week_of_year" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceLongTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceMaintenanceConfigurationCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_instance_name": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "operation_parameters": { + "attr_type": null + }, + "operation_steps": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationParametersPair": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "current_parameters": { + "attr_type": null + }, + "requested_parameters": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceOperationSteps": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "total_steps": { + "attr_type": null + }, + "current_step": { + "attr_type": null + }, + "steps_list": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePairInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "primary_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "partner_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "primary_managed_instance_id": { + "attr_type": "primary_managed_instance_id" + }, + "partner_managed_instance_id": { + "attr_type": "partner_managed_instance_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePecProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointConnectionProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateEndpointProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLink": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_id": { + "attr_type": null + }, + "required_members": { + "attr_type": null + }, + "required_zone_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstancePrivateLinkServiceConnectionStateProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "status": { + "default": null, + "param_type": "keyword_only" + }, + "description": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": "status" + }, + "description": { + "attr_type": "description" + }, + "actions_required": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceProxyOverride": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "PROXY": "PROXY", + "REDIRECT": "REDIRECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedInstanceQuery": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_text": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query_text": { + "attr_type": "query_text" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceQueryStatistics": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "managed_instance_create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "is_general_purpose_v2": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "license_type": { + "default": "none", + "param_type": "keyword_only" + }, + "hybrid_secondary_usage": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_iops": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_throughput_mbps": { + "default": "none", + "param_type": "keyword_only" + }, + "memory_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "collation": { + "default": "none", + "param_type": "keyword_only" + }, + "dns_zone_partner": { + "default": "none", + "param_type": "keyword_only" + }, + "public_data_endpoint_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "source_managed_instance_id": { + "default": "none", + "param_type": "keyword_only" + }, + "restore_point_in_time": { + "default": "none", + "param_type": "keyword_only" + }, + "proxy_override": { + "default": "none", + "param_type": "keyword_only" + }, + "timezone_id": { + "default": "none", + "param_type": "keyword_only" + }, + "instance_pool_id": { + "default": "none", + "param_type": "keyword_only" + }, + "maintenance_configuration_id": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "zone_redundant": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "service_principal": { + "default": "none", + "param_type": "keyword_only" + }, + "pricing_model": { + "default": "none", + "param_type": "keyword_only" + }, + "authentication_metadata": { + "default": "none", + "param_type": "keyword_only" + }, + "database_format": { + "default": "none", + "param_type": "keyword_only" + }, + "requested_logical_availability_zone": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "provisioning_state": { + "attr_type": null + }, + "managed_instance_create_mode": { + "attr_type": "managed_instance_create_mode" + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "is_general_purpose_v2": { + "attr_type": "is_general_purpose_v2" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "subnet_id": { + "attr_type": "subnet_id" + }, + "state": { + "attr_type": null + }, + "license_type": { + "attr_type": "license_type" + }, + "hybrid_secondary_usage": { + "attr_type": "hybrid_secondary_usage" + }, + "hybrid_secondary_usage_detected": { + "attr_type": null + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "storage_iops": { + "attr_type": "storage_iops" + }, + "storage_throughput_mbps": { + "attr_type": "storage_throughput_mbps" + }, + "memory_size_in_gb": { + "attr_type": "memory_size_in_gb" + }, + "collation": { + "attr_type": "collation" + }, + "dns_zone": { + "attr_type": null + }, + "dns_zone_partner": { + "attr_type": "dns_zone_partner" + }, + "public_data_endpoint_enabled": { + "attr_type": "public_data_endpoint_enabled" + }, + "source_managed_instance_id": { + "attr_type": "source_managed_instance_id" + }, + "restore_point_in_time": { + "attr_type": "restore_point_in_time" + }, + "proxy_override": { + "attr_type": "proxy_override" + }, + "timezone_id": { + "attr_type": "timezone_id" + }, + "instance_pool_id": { + "attr_type": "instance_pool_id" + }, + "maintenance_configuration_id": { + "attr_type": "maintenance_configuration_id" + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "current_backup_storage_redundancy": { + "attr_type": null + }, + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "zone_redundant": { + "attr_type": "zone_redundant" + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "service_principal": { + "attr_type": "service_principal" + }, + "virtual_cluster_id": { + "attr_type": null + }, + "external_governance_status": { + "attr_type": null + }, + "pricing_model": { + "attr_type": "pricing_model" + }, + "create_time": { + "attr_type": null + }, + "authentication_metadata": { + "attr_type": "authentication_metadata" + }, + "database_format": { + "attr_type": "database_format" + }, + "requested_logical_availability_zone": { + "attr_type": "requested_logical_availability_zone" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_key_uri": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tde_key_uri": { + "attr_type": "tde_key_uri" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVcoresCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "supported_memory_limits_mb": { + "attr_type": null + }, + "supported_memory_sizes_in_gb": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "supported_storage_sizes": { + "attr_type": null + }, + "included_storage_i_ops": { + "attr_type": null + }, + "supported_storage_i_ops": { + "attr_type": null + }, + "iops_min_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "iops_included_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "included_storage_throughput_m_bps": { + "attr_type": null + }, + "supported_storage_throughput_m_bps": { + "attr_type": null + }, + "throughput_m_bps_min_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "throughput_m_bps_included_value_override_factor_per_selected_storage_gb": { + "attr_type": null + }, + "instance_pool_supported": { + "attr_type": null + }, + "standalone_supported": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "supported_instance_pool_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedInstanceVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploads": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "digest_storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "digest_storage_endpoint": { + "attr_type": "digest_storage_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploadsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedLedgerDigestUploadsName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedLedgerDigestUploadsState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedServerCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "POINT_IN_TIME_RESTORE": "POINT_IN_TIME_RESTORE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedServerDnsAlias": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_dns_record": { + "attr_type": null + }, + "public_azure_dns_record": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasAcquisition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "old_managed_server_dns_alias_resource_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "old_managed_server_dns_alias_resource_id": { + "attr_type": "old_managed_server_dns_alias_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasCreation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_dns_record": { + "default": "bool", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "create_dns_record": { + "attr_type": "create_dns_record" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerDnsAliasListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedServerSecurityAlertPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedShortTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ManagedTransparentDataEncryption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagedTransparentDataEncryptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ManagementOperationState": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELLED": "CANCELLED", + "CANCEL_IN_PROGRESS": "CANCEL_IN_PROGRESS", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "PENDING": "PENDING", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MaxLimitRangeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "scale_size": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeRangeCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "scale_size": { + "attr_type": null + }, + "log_size": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MaxSizeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "GIGABYTES": "GIGABYTES", + "MEGABYTES": "MEGABYTES", + "PETABYTES": "PETABYTES", + "TERABYTES": "TERABYTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MetricType": { + "type": "Enum", + "methods": {}, + "properties": { + "CPU": "CPU", + "DTU": "DTU", + "DURATION": "DURATION", + "IO": "IO", + "LOG_IO": "LOG_IO", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MinCapacityCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "MinimalTlsVersion": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "ONE0": "ONE0", + "ONE1": "ONE1", + "ONE2": "ONE2", + "ONE3": "ONE3", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "MoveOperationMode": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "MOVE": "MOVE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "NSPConfigAccessRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "properties": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "properties": { + "attr_type": "properties" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigAccessRuleProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "direction": { + "default": "none", + "param_type": "keyword_only" + }, + "address_prefixes": { + "default": "none", + "param_type": "keyword_only" + }, + "fully_qualified_domain_names": { + "default": "none", + "param_type": "keyword_only" + }, + "subscriptions": { + "default": "none", + "param_type": "keyword_only" + }, + "network_security_perimeters": { + "default": "none", + "param_type": "keyword_only" + }, + "service_tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "direction": { + "attr_type": "direction" + }, + "address_prefixes": { + "attr_type": "address_prefixes" + }, + "fully_qualified_domain_names": { + "attr_type": "fully_qualified_domain_names" + }, + "subscriptions": { + "attr_type": "subscriptions" + }, + "network_security_perimeters": { + "attr_type": "network_security_perimeters" + }, + "service_tags": { + "attr_type": "service_tags" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigAssociation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "access_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "access_mode": { + "attr_type": "access_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigNetworkSecurityPerimeterRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "perimeter_guid": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "perimeter_guid": { + "attr_type": "perimeter_guid" + }, + "location": { + "attr_type": "location" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigPerimeter": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "perimeter_guid": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "perimeter_guid": { + "attr_type": "perimeter_guid" + }, + "location": { + "attr_type": "location" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPConfigProfile": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "access_rules_version": { + "default": "none", + "param_type": "keyword_only" + }, + "access_rules": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "access_rules_version": { + "attr_type": "access_rules_version" + }, + "access_rules": { + "attr_type": "access_rules" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPProvisioningIssue": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "properties": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "properties": { + "attr_type": "properties" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NSPProvisioningIssueProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "issue_type": { + "default": "none", + "param_type": "keyword_only" + }, + "severity": { + "default": "none", + "param_type": "keyword_only" + }, + "description": { + "default": "none", + "param_type": "keyword_only" + }, + "suggested_resource_ids": { + "default": "none", + "param_type": "keyword_only" + }, + "suggested_access_rules": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "issue_type": { + "attr_type": "issue_type" + }, + "severity": { + "attr_type": "severity" + }, + "description": { + "attr_type": "description" + }, + "suggested_resource_ids": { + "attr_type": "suggested_resource_ids" + }, + "suggested_access_rules": { + "attr_type": "suggested_access_rules" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Name": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "value": { + "default": "none", + "param_type": "keyword_only" + }, + "localized_value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": "value" + }, + "localized_value": { + "attr_type": "localized_value" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkIsolationSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_account_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_resource_id": { + "attr_type": "storage_account_resource_id" + }, + "sql_server_resource_id": { + "attr_type": "sql_server_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkIsolationSettingsAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_account_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_resource_id": { + "attr_type": "storage_account_resource_id" + }, + "sql_server_resource_id": { + "attr_type": "sql_server_resource_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkSecurityPerimeterConfiguration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "network_security_perimeter": { + "default": "none", + "param_type": "keyword_only" + }, + "resource_association": { + "default": "none", + "param_type": "keyword_only" + }, + "profile": { + "default": "none", + "param_type": "keyword_only" + }, + "provisioning_issues": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provisioning_state": { + "attr_type": null + }, + "network_security_perimeter": { + "attr_type": "network_security_perimeter" + }, + "resource_association": { + "attr_type": "resource_association" + }, + "profile": { + "attr_type": "profile" + }, + "provisioning_issues": { + "attr_type": "provisioning_issues" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "NetworkSecurityPerimeterConfigurationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Operation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "display": { + "attr_type": null + }, + "origin": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationDisplay": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provider": { + "attr_type": null + }, + "resource": { + "attr_type": null + }, + "operation": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OperationMode": { + "type": "Enum", + "methods": {}, + "properties": { + "EXPORT": "EXPORT", + "IMPORT": "IMPORT", + "POLYBASE_IMPORT": "POLYBASE_IMPORT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "OperationOrigin": { + "type": "Enum", + "methods": {}, + "properties": { + "SYSTEM": "SYSTEM", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "OutboundEnvironmentEndpoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "category": { + "attr_type": null + }, + "endpoints": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundEnvironmentEndpointCollection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundFirewallRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "OutboundFirewallRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PartnerInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "location": { + "attr_type": null + }, + "replication_role": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PartnerRegionInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": "location" + }, + "replication_role": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PauseDelayTimeUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "MINUTES": "MINUTES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PerDatabaseAutoPauseDelayTimeRange": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_value": { + "attr_type": null + }, + "max_value": { + "attr_type": null + }, + "step_size": { + "attr_type": null + }, + "default": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "do_not_pause_value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PerformanceLevelCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PerformanceLevelUnit": { + "type": "Enum", + "methods": {}, + "properties": { + "DTU": "DTU", + "V_CORES": "V_CORES", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Phase": { + "type": "Enum", + "methods": {}, + "properties": { + "BUILDING_HYPERSCALE_COMPONENTS": "BUILDING_HYPERSCALE_COMPONENTS", + "CATCHUP": "CATCHUP", + "COPYING": "COPYING", + "CUTOVER_IN_PROGRESS": "CUTOVER_IN_PROGRESS", + "LOG_TRANSITION_IN_PROGRESS": "LOG_TRANSITION_IN_PROGRESS", + "WAITING_FOR_CUTOVER": "WAITING_FOR_CUTOVER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PhaseDetails": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "phase": { + "attr_type": null + }, + "phase_information": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PricingModel": { + "type": "Enum", + "methods": {}, + "properties": { + "FREEMIUM": "FREEMIUM", + "REGULAR": "REGULAR", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrincipalType": { + "type": "Enum", + "methods": {}, + "properties": { + "APPLICATION": "APPLICATION", + "GROUP": "GROUP", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "group_ids": { + "attr_type": null + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "private_link_service_connection_state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_endpoint": { + "attr_type": "private_endpoint" + }, + "group_ids": { + "attr_type": null + }, + "private_link_service_connection_state": { + "attr_type": "private_link_service_connection_state" + }, + "provisioning_state": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointConnectionRequestStatus": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_link_service_id": { + "attr_type": null + }, + "private_endpoint_connection_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateEndpointProvisioningState": { + "type": "Enum", + "methods": {}, + "properties": { + "APPROVING": "APPROVING", + "DROPPING": "DROPPING", + "FAILED": "FAILED", + "READY": "READY", + "REJECTING": "REJECTING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateLinkResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkResourceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkResourceProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_id": { + "attr_type": null + }, + "required_members": { + "attr_type": null + }, + "required_zone_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkServiceConnectionStateActionsRequire": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "PrivateLinkServiceConnectionStateProperty": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "status": { + "default": null, + "param_type": "keyword_only" + }, + "description": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": "status" + }, + "description": { + "attr_type": "description" + }, + "actions_required": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "PrivateLinkServiceConnectionStateStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "APPROVED": "APPROVED", + "DISCONNECTED": "DISCONNECTED", + "PENDING": "PENDING", + "REJECTED": "REJECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ProvisioningState": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "CREATED": "CREATED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "SUCCEEDED": "SUCCEEDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ProxyResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ProxyResourceWithWritableName": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryCheck": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "query": { + "attr_type": null + }, + "expected_result": { + "attr_type": null + }, + "column_names": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricInterval": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "metrics": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "interval_start_time": { + "attr_type": null + }, + "interval_type": { + "attr_type": null + }, + "execution_count": { + "attr_type": null + }, + "metrics": { + "attr_type": "metrics" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "display_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "min": { + "attr_type": null + }, + "max": { + "attr_type": null + }, + "avg": { + "attr_type": null + }, + "sum": { + "attr_type": null + }, + "stdev": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryMetricUnitType": { + "type": "Enum", + "methods": {}, + "properties": { + "COUNT": "COUNT", + "KB": "KB", + "MICROSECONDS": "MICROSECONDS", + "PERCENTAGE": "PERCENTAGE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "QueryStatistics": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "intervals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "query_id": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "intervals": { + "attr_type": "intervals" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryStatisticsProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "intervals": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "query_id": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "intervals": { + "attr_type": "intervals" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "QueryTimeGrainType": { + "type": "Enum", + "methods": {}, + "properties": { + "P1_D": "P1_D", + "PT1_H": "PT1_H", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReadOnlyEndpointFailoverPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReadScaleCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "max_number_of_replicas": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReadWriteEndpointFailoverPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTOMATIC": "AUTOMATIC", + "MANUAL": "MANUAL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedAction": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "recommendation_reason": { + "attr_type": null + }, + "valid_since": { + "attr_type": null + }, + "last_refresh": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "is_executable_action": { + "attr_type": null + }, + "is_revertable_action": { + "attr_type": null + }, + "is_archived_action": { + "attr_type": null + }, + "execute_action_start_time": { + "attr_type": null + }, + "execute_action_duration": { + "attr_type": null + }, + "revert_action_start_time": { + "attr_type": null + }, + "revert_action_duration": { + "attr_type": null + }, + "execute_action_initiated_by": { + "attr_type": null + }, + "execute_action_initiated_time": { + "attr_type": null + }, + "revert_action_initiated_by": { + "attr_type": null + }, + "revert_action_initiated_time": { + "attr_type": null + }, + "score": { + "attr_type": null + }, + "implementation_details": { + "attr_type": null + }, + "error_details": { + "attr_type": null + }, + "estimated_impact": { + "attr_type": null + }, + "observed_impact": { + "attr_type": null + }, + "time_series": { + "attr_type": null + }, + "linked_objects": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionAutoGenerated": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "recommendation_reason": { + "attr_type": null + }, + "valid_since": { + "attr_type": null + }, + "last_refresh": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "is_executable_action": { + "attr_type": null + }, + "is_revertable_action": { + "attr_type": null + }, + "is_archived_action": { + "attr_type": null + }, + "execute_action_start_time": { + "attr_type": null + }, + "execute_action_duration": { + "attr_type": null + }, + "revert_action_start_time": { + "attr_type": null + }, + "revert_action_duration": { + "attr_type": null + }, + "execute_action_initiated_by": { + "attr_type": null + }, + "execute_action_initiated_time": { + "attr_type": null + }, + "revert_action_initiated_by": { + "attr_type": null + }, + "revert_action_initiated_time": { + "attr_type": null + }, + "score": { + "attr_type": null + }, + "implementation_details": { + "attr_type": null + }, + "error_details": { + "attr_type": null + }, + "estimated_impact": { + "attr_type": null + }, + "observed_impact": { + "attr_type": null + }, + "time_series": { + "attr_type": null + }, + "linked_objects": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionCurrentState": { + "type": "Enum", + "methods": {}, + "properties": { + "ACTIVE": "ACTIVE", + "ERROR": "ERROR", + "EXECUTING": "EXECUTING", + "EXPIRED": "EXPIRED", + "IGNORED": "IGNORED", + "MONITORING": "MONITORING", + "PENDING": "PENDING", + "PENDING_REVERT": "PENDING_REVERT", + "RESOLVED": "RESOLVED", + "REVERTED": "REVERTED", + "REVERTING": "REVERTING", + "REVERT_CANCELLED": "REVERT_CANCELLED", + "SUCCESS": "SUCCESS", + "VERIFYING": "VERIFYING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedActionErrorInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "error_code": { + "attr_type": null + }, + "is_retryable": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionImpactRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "dimension_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "absolute_value": { + "attr_type": null + }, + "change_value_absolute": { + "attr_type": null + }, + "change_value_relative": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionImplementationInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "method": { + "attr_type": null + }, + "script": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionInitiatedBy": { + "type": "Enum", + "methods": {}, + "properties": { + "SYSTEM": "SYSTEM", + "USER": "USER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedActionMetricInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "metric_name": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "time_grain": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "value": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedActionStateInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "current_value": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "current_value": { + "attr_type": "current_value" + }, + "action_initiated_by": { + "attr_type": null + }, + "last_modified": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedSensitivityLabelUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "op": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "table": { + "default": "none", + "param_type": "keyword_only" + }, + "column": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "op": { + "attr_type": "op" + }, + "schema": { + "attr_type": "schema" + }, + "table": { + "attr_type": "table" + }, + "column": { + "attr_type": "column" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecommendedSensitivityLabelUpdateKind": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLE": "DISABLE", + "ENABLE": "ENABLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RecommendedSensitivityLabelUpdateList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operations": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operations": { + "attr_type": "operations" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "edition": { + "attr_type": null + }, + "service_level_objective": { + "attr_type": null + }, + "elastic_pool_name": { + "attr_type": null + }, + "last_available_backup_date": { + "attr_type": null + }, + "keys": { + "attr_type": "keys" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "last_available_backup_date": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RecoverableManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RefreshExternalGovernanceStatusOperationResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RefreshExternalGovernanceStatusOperationResultMI": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "request_id": { + "attr_type": null + }, + "request_type": { + "attr_type": null + }, + "queued_time": { + "attr_type": null + }, + "managed_instance_name": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Remediation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "description": { + "attr_type": null + }, + "scripts": { + "attr_type": null + }, + "automated": { + "attr_type": null + }, + "portal_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicaConnectedState": { + "type": "Enum", + "methods": {}, + "properties": { + "CONNECTED": "CONNECTED", + "DISCONNECTED": "DISCONNECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicaSynchronizationHealth": { + "type": "Enum", + "methods": {}, + "properties": { + "HEALTHY": "HEALTHY", + "NOT_HEALTHY": "NOT_HEALTHY", + "PARTIALLY_HEALTHY": "PARTIALLY_HEALTHY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicaType": { + "type": "Enum", + "methods": {}, + "properties": { + "PRIMARY": "PRIMARY", + "READABLE_SECONDARY": "READABLE_SECONDARY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationLink": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "partner_server": { + "attr_type": null + }, + "partner_database": { + "attr_type": null + }, + "partner_database_id": { + "attr_type": null + }, + "partner_location": { + "attr_type": null + }, + "role": { + "attr_type": null + }, + "partner_role": { + "attr_type": null + }, + "replication_mode": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "replication_state": { + "attr_type": null + }, + "is_termination_allowed": { + "attr_type": null + }, + "link_type": { + "attr_type": "link_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationLinkListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationLinkType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "NAMED": "NAMED", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationLinkUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "link_type": { + "attr_type": "link_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ReplicationModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "ASYNC": "ASYNC", + "SYNC": "SYNC", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationRole": { + "type": "Enum", + "methods": {}, + "properties": { + "COPY": "COPY", + "NON_READABLE_SECONDARY": "NON_READABLE_SECONDARY", + "PRIMARY": "PRIMARY", + "SECONDARY": "SECONDARY", + "SOURCE": "SOURCE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ReplicationState": { + "type": "Enum", + "methods": {}, + "properties": { + "CATCH_UP": "CATCH_UP", + "PENDING": "PENDING", + "SEEDING": "SEEDING", + "SUSPENDED": "SUSPENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Resource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "user_assigned_identities": { + "default": "none", + "param_type": "keyword_only" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "user_assigned_identities": { + "attr_type": "user_assigned_identities" + }, + "principal_id": { + "attr_type": null + }, + "type": { + "attr_type": "type" + }, + "tenant_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceMoveDefinition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": "id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ResourceWithWritableName": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": "name" + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "location": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "keys": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "database_name": { + "attr_type": null + }, + "max_size_bytes": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "deletion_date": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "backup_storage_redundancy": { + "attr_type": null + }, + "keys": { + "attr_type": "keys" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedManagedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_name": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "deletion_date": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorableDroppedManagedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestoreDetailsName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RestorePoint": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "restore_point_type": { + "attr_type": null + }, + "earliest_restore_date": { + "attr_type": null + }, + "restore_point_creation_date": { + "attr_type": null + }, + "restore_point_label": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorePointListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "RestorePointType": { + "type": "Enum", + "methods": {}, + "properties": { + "CONTINUOUS": "CONTINUOUS", + "DISCRETE": "DISCRETE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RoleChangeType": { + "type": "Enum", + "methods": {}, + "properties": { + "FORCED": "FORCED", + "PLANNED": "PLANNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleSeverity": { + "type": "Enum", + "methods": {}, + "properties": { + "HIGH": "HIGH", + "INFORMATIONAL": "INFORMATIONAL", + "LOW": "LOW", + "MEDIUM": "MEDIUM", + "OBSOLETE": "OBSOLETE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "FINDING": "FINDING", + "INTERNAL_ERROR": "INTERNAL_ERROR", + "NON_FINDING": "NON_FINDING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "RuleType": { + "type": "Enum", + "methods": {}, + "properties": { + "BASELINE_EXPECTED": "BASELINE_EXPECTED", + "BINARY": "BINARY", + "NEGATIVE_LIST": "NEGATIVE_LIST", + "POSITIVE_LIST": "POSITIVE_LIST", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SQLVulnerabilityAssessmentScanListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SampleName": { + "type": "Enum", + "methods": {}, + "properties": { + "ADVENTURE_WORKS_LT": "ADVENTURE_WORKS_LT", + "WIDE_WORLD_IMPORTERS_FULL": "WIDE_WORLD_IMPORTERS_FULL", + "WIDE_WORLD_IMPORTERS_STD": "WIDE_WORLD_IMPORTERS_STD", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ScheduleItem": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_day": { + "default": null, + "param_type": "keyword_only" + }, + "start_time": { + "default": null, + "param_type": "keyword_only" + }, + "stop_day": { + "default": null, + "param_type": "keyword_only" + }, + "stop_time": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "start_day": { + "attr_type": "start_day" + }, + "start_time": { + "attr_type": "start_time" + }, + "stop_day": { + "attr_type": "stop_day" + }, + "stop_time": { + "attr_type": "stop_time" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecondaryInstanceType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecondaryType": { + "type": "Enum", + "methods": {}, + "properties": { + "GEO": "GEO", + "NAMED": "NAMED", + "STANDBY": "STANDBY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyNameAutoGenerated": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "NEW": "NEW", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityAlertsPolicyState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityEvent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "event_time": { + "attr_type": null + }, + "security_event_type": { + "attr_type": null + }, + "subscription": { + "attr_type": null + }, + "server": { + "attr_type": null + }, + "database": { + "attr_type": null + }, + "client_ip": { + "attr_type": null + }, + "application_name": { + "attr_type": null + }, + "principal_name": { + "attr_type": null + }, + "security_event_sql_injection_additional_properties": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventCollection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventSqlInjectionAdditionalProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "threat_id": { + "attr_type": null + }, + "statement": { + "attr_type": null + }, + "statement_highlight_offset": { + "attr_type": null + }, + "statement_highlight_length": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SecurityEventType": { + "type": "Enum", + "methods": {}, + "properties": { + "SQL_INJECTION_EXPLOIT": "SQL_INJECTION_EXPLOIT", + "SQL_INJECTION_VULNERABILITY": "SQL_INJECTION_VULNERABILITY", + "UNDEFINED": "UNDEFINED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SecurityEventsFilterParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "event_time": { + "default": "none", + "param_type": "keyword_only" + }, + "show_server_records": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "event_time": { + "attr_type": "event_time" + }, + "show_server_records": { + "attr_type": "show_server_records" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SeedingModeType": { + "type": "Enum", + "methods": {}, + "properties": { + "AUTOMATIC": "AUTOMATIC", + "MANUAL": "MANUAL", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabel": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "label_name": { + "default": "none", + "param_type": "keyword_only" + }, + "label_id": { + "default": "none", + "param_type": "keyword_only" + }, + "information_type": { + "default": "none", + "param_type": "keyword_only" + }, + "information_type_id": { + "default": "none", + "param_type": "keyword_only" + }, + "rank": { + "default": "none", + "param_type": "keyword_only" + }, + "client_classification_source": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "managed_by": { + "attr_type": null + }, + "schema_name": { + "attr_type": null + }, + "table_name": { + "attr_type": null + }, + "column_name": { + "attr_type": null + }, + "label_name": { + "attr_type": "label_name" + }, + "label_id": { + "attr_type": "label_id" + }, + "information_type": { + "attr_type": "information_type" + }, + "information_type_id": { + "attr_type": "information_type_id" + }, + "is_disabled": { + "attr_type": null + }, + "rank": { + "attr_type": "rank" + }, + "client_classification_source": { + "attr_type": "client_classification_source" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelRank": { + "type": "Enum", + "methods": {}, + "properties": { + "CRITICAL": "CRITICAL", + "HIGH": "HIGH", + "LOW": "LOW", + "MEDIUM": "MEDIUM", + "NONE": "NONE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelSource": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "RECOMMENDED": "RECOMMENDED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "op": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "table": { + "default": "none", + "param_type": "keyword_only" + }, + "column": { + "default": "none", + "param_type": "keyword_only" + }, + "sensitivity_label": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "op": { + "attr_type": "op" + }, + "schema": { + "attr_type": "schema" + }, + "table": { + "attr_type": "table" + }, + "column": { + "attr_type": "column" + }, + "sensitivity_label": { + "attr_type": "sensitivity_label" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SensitivityLabelUpdateKind": { + "type": "Enum", + "methods": {}, + "properties": { + "REMOVE": "REMOVE", + "SET": "SET", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SensitivityLabelUpdateList": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operations": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operations": { + "attr_type": "operations" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "Server": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "public_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "restrict_outbound_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "is_i_pv6_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "kind": { + "attr_type": null + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "version": { + "attr_type": "version" + }, + "state": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "public_network_access": { + "attr_type": "public_network_access" + }, + "workspace_feature": { + "attr_type": null + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "restrict_outbound_network_access": { + "attr_type": "restrict_outbound_network_access" + }, + "is_i_pv6_enabled": { + "attr_type": "is_i_pv6_enabled" + }, + "external_governance_status": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAdvancedThreatProtection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAutomaticTuning": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "desired_state": { + "default": "none", + "param_type": "keyword_only" + }, + "options": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "desired_state": { + "attr_type": "desired_state" + }, + "actual_state": { + "attr_type": null + }, + "options": { + "attr_type": "options" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAzureADAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerAzureADOnlyAuthentication": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerBlobAuditingPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_devops_audit_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "audit_actions_and_groups": { + "default": "none", + "param_type": "keyword_only" + }, + "is_storage_secondary_key_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "queue_delay_ms": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_devops_audit_enabled": { + "attr_type": "is_devops_audit_enabled" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "audit_actions_and_groups": { + "attr_type": "audit_actions_and_groups" + }, + "is_storage_secondary_key_in_use": { + "attr_type": "is_storage_secondary_key_in_use" + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "queue_delay_ms": { + "attr_type": "queue_delay_ms" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerBlobAuditingPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOption": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_value": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_configuration_option_value": { + "attr_type": "server_configuration_option_value" + }, + "provisioning_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOptionListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConfigurationOptionName": { + "type": "Enum", + "methods": {}, + "properties": { + "ALLOW_POLYBASE_EXPORT": "ALLOW_POLYBASE_EXPORT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerConnectionPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": null + }, + "kind": { + "attr_type": null + }, + "connection_type": { + "attr_type": "connection_type" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConnectionPolicyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerConnectionType": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "PROXY": "PROXY", + "REDIRECT": "REDIRECT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerCreateMode": { + "type": "Enum", + "methods": {}, + "properties": { + "NORMAL": "NORMAL", + "RESTORE": "RESTORE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerDevOpsAuditSettingsListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDevOpsAuditingSettings": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_azure_monitor_target_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "is_managed_identity_in_use": { + "default": "none", + "param_type": "keyword_only" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_subscription_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "is_azure_monitor_target_enabled": { + "attr_type": "is_azure_monitor_target_enabled" + }, + "is_managed_identity_in_use": { + "attr_type": "is_managed_identity_in_use" + }, + "state": { + "attr_type": "state" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "storage_account_subscription_id": { + "attr_type": "storage_account_subscription_id" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAlias": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "azure_dns_record": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAliasAcquisition": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "old_server_dns_alias_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "old_server_dns_alias_id": { + "attr_type": "old_server_dns_alias_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerDnsAliasListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerExternalAdministrator": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_type": { + "default": "none", + "param_type": "keyword_only" + }, + "principal_type": { + "default": "none", + "param_type": "keyword_only" + }, + "login": { + "default": "none", + "param_type": "keyword_only" + }, + "sid": { + "default": "none", + "param_type": "keyword_only" + }, + "tenant_id": { + "default": "none", + "param_type": "keyword_only" + }, + "azure_ad_only_authentication": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "administrator_type": { + "attr_type": "administrator_type" + }, + "principal_type": { + "attr_type": "principal_type" + }, + "login": { + "attr_type": "login" + }, + "sid": { + "attr_type": "sid" + }, + "tenant_id": { + "attr_type": "tenant_id" + }, + "azure_ad_only_authentication": { + "attr_type": "azure_ad_only_authentication" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerInfo": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_id": { + "default": null, + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "server_id": { + "attr_type": "server_id" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKey": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_key_type": { + "default": "none", + "param_type": "keyword_only" + }, + "uri": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "kind": { + "attr_type": null + }, + "location": { + "attr_type": null + }, + "subregion": { + "attr_type": null + }, + "server_key_type": { + "attr_type": "server_key_type" + }, + "uri": { + "attr_type": "uri" + }, + "thumbprint": { + "attr_type": null + }, + "creation_date": { + "attr_type": null + }, + "auto_rotation_enabled": { + "attr_type": null + }, + "key_version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKeyListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_KEY_VAULT": "AZURE_KEY_VAULT", + "SERVICE_MANAGED": "SERVICE_MANAGED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerNetworkAccessFlag": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "operation": { + "attr_type": null + }, + "operation_friendly_name": { + "attr_type": null + }, + "percent_complete": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "error_code": { + "attr_type": null + }, + "error_description": { + "attr_type": null + }, + "error_severity": { + "attr_type": null + }, + "is_user_error": { + "attr_type": null + }, + "estimated_completion_time": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "is_cancellable": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerOperationListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerPrivateEndpointConnection": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "properties": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerPublicNetworkAccessFlag": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "SECURED_BY_PERIMETER": "SECURED_BY_PERIMETER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerSecurityAlertPolicy": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "disabled_alerts": { + "default": "none", + "param_type": "keyword_only" + }, + "email_addresses": { + "default": "none", + "param_type": "keyword_only" + }, + "email_account_admins": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "disabled_alerts": { + "attr_type": "disabled_alerts" + }, + "email_addresses": { + "attr_type": "email_addresses" + }, + "email_account_admins": { + "attr_type": "email_account_admins" + }, + "storage_endpoint": { + "attr_type": "storage_endpoint" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "retention_days": { + "attr_type": "retention_days" + }, + "creation_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "public_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "public_blob": { + "attr_type": "public_blob" + }, + "thumbprint": { + "attr_type": null + }, + "certificate_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustCertificatesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_members": { + "default": "none", + "param_type": "keyword_only" + }, + "trust_scopes": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "group_members": { + "attr_type": "group_members" + }, + "trust_scopes": { + "attr_type": "trust_scopes" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerTrustGroupPropertiesTrustScopesItem": { + "type": "Enum", + "methods": {}, + "properties": { + "GLOBAL_TRANSACTIONS": "GLOBAL_TRANSACTIONS", + "SERVICE_BROKER": "SERVICE_BROKER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServerUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "identity": { + "default": "none", + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login": { + "default": "none", + "param_type": "keyword_only" + }, + "administrator_login_password": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "minimal_tls_version": { + "default": "none", + "param_type": "keyword_only" + }, + "public_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "primary_user_assigned_identity_id": { + "default": "none", + "param_type": "keyword_only" + }, + "federated_client_id": { + "default": "none", + "param_type": "keyword_only" + }, + "key_id": { + "default": "none", + "param_type": "keyword_only" + }, + "administrators": { + "default": "none", + "param_type": "keyword_only" + }, + "restrict_outbound_network_access": { + "default": "none", + "param_type": "keyword_only" + }, + "is_i_pv6_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "retention_days": { + "default": "none", + "param_type": "keyword_only" + }, + "create_mode": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "identity": { + "attr_type": "identity" + }, + "tags": { + "attr_type": "tags" + }, + "administrator_login": { + "attr_type": "administrator_login" + }, + "administrator_login_password": { + "attr_type": "administrator_login_password" + }, + "version": { + "attr_type": "version" + }, + "state": { + "attr_type": null + }, + "fully_qualified_domain_name": { + "attr_type": null + }, + "private_endpoint_connections": { + "attr_type": null + }, + "minimal_tls_version": { + "attr_type": "minimal_tls_version" + }, + "public_network_access": { + "attr_type": "public_network_access" + }, + "workspace_feature": { + "attr_type": null + }, + "primary_user_assigned_identity_id": { + "attr_type": "primary_user_assigned_identity_id" + }, + "federated_client_id": { + "attr_type": "federated_client_id" + }, + "key_id": { + "attr_type": "key_id" + }, + "administrators": { + "attr_type": "administrators" + }, + "restrict_outbound_network_access": { + "attr_type": "restrict_outbound_network_access" + }, + "is_i_pv6_enabled": { + "attr_type": "is_i_pv6_enabled" + }, + "external_governance_status": { + "attr_type": null + }, + "retention_days": { + "attr_type": "retention_days" + }, + "create_mode": { + "attr_type": "create_mode" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVersionCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": null + }, + "supported_editions": { + "attr_type": null + }, + "supported_elastic_pool_editions": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "storage_container_path": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_container_sas_key": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_account_access_key": { + "default": "none", + "param_type": "keyword_only" + }, + "recurring_scans": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_container_path": { + "attr_type": "storage_container_path" + }, + "storage_container_sas_key": { + "attr_type": "storage_container_sas_key" + }, + "storage_account_access_key": { + "attr_type": "storage_account_access_key" + }, + "recurring_scans": { + "attr_type": "recurring_scans" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServerWorkspaceFeature": { + "type": "Enum", + "methods": {}, + "properties": { + "CONNECTED": "CONNECTED", + "DISCONNECTED": "DISCONNECTED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ServiceObjectiveCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "supported_max_sizes": { + "attr_type": null + }, + "performance_level": { + "attr_type": null + }, + "sku": { + "attr_type": null + }, + "supported_license_types": { + "attr_type": null + }, + "included_max_size": { + "attr_type": null + }, + "zone_redundant": { + "attr_type": null + }, + "supported_auto_pause_delay": { + "attr_type": null + }, + "supported_min_capacities": { + "attr_type": null + }, + "compute_model": { + "attr_type": null + }, + "supported_maintenance_configurations": { + "attr_type": null + }, + "zone_pinning": { + "attr_type": null + }, + "supported_zones": { + "attr_type": null + }, + "supported_free_limit_exhaustion_behaviors": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServicePrincipal": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "tenant_id": { + "attr_type": null + }, + "type": { + "attr_type": "type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ServicePrincipalType": { + "type": "Enum", + "methods": {}, + "properties": { + "NONE": "NONE", + "SYSTEM_ASSIGNED": "SYSTEM_ASSIGNED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SetLegalHoldImmutability": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "ShortTermRetentionPolicyName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Sku": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "name": { + "default": null, + "param_type": "keyword_only" + }, + "tier": { + "default": "none", + "param_type": "keyword_only" + }, + "size": { + "default": "none", + "param_type": "keyword_only" + }, + "family": { + "default": "none", + "param_type": "keyword_only" + }, + "capacity": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name": { + "attr_type": "name" + }, + "tier": { + "attr_type": "tier" + }, + "size": { + "attr_type": "size" + }, + "family": { + "attr_type": "family" + }, + "capacity": { + "attr_type": "capacity" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlAgentConfiguration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlAgentConfigurationPropertiesState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SqlVulnerabilityAssessment": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "state": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "state": { + "attr_type": "state" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SqlVulnerabilityAssessmentScanError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "scan_id": { + "attr_type": null + }, + "trigger_type": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "errors": { + "attr_type": null + }, + "server": { + "attr_type": null + }, + "database": { + "attr_type": null + }, + "sql_version": { + "attr_type": null + }, + "high_severity_failed_rules_count": { + "attr_type": null + }, + "medium_severity_failed_rules_count": { + "attr_type": null + }, + "low_severity_failed_rules_count": { + "attr_type": null + }, + "total_passed_rules_count": { + "attr_type": null + }, + "total_failed_rules_count": { + "attr_type": null + }, + "total_rules_count": { + "attr_type": null + }, + "is_baseline_applied": { + "attr_type": null + }, + "last_scan_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanRecordListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentScanResults": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "rule_id": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "error_message": { + "attr_type": null + }, + "is_trimmed": { + "attr_type": null + }, + "query_results": { + "attr_type": null + }, + "remediation": { + "attr_type": null + }, + "baseline_adjusted_result": { + "attr_type": null + }, + "rule_metadata": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SqlVulnerabilityAssessmentState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StartStopManagedInstanceSchedule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "description": { + "default": "str", + "param_type": "keyword_only" + }, + "time_zone_id": { + "default": "str", + "param_type": "keyword_only" + }, + "schedule_list": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "system_data": { + "attr_type": null + }, + "description": { + "attr_type": "description" + }, + "time_zone_id": { + "attr_type": "time_zone_id" + }, + "schedule_list": { + "attr_type": "schedule_list" + }, + "next_run_action": { + "attr_type": null + }, + "next_execution_time": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StartStopManagedInstanceScheduleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StartStopScheduleName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StorageCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "storage_account_type": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "StorageCapabilityStorageAccountType": { + "type": "Enum", + "methods": {}, + "properties": { + "GRS": "GRS", + "GZRS": "GZRS", + "LRS": "LRS", + "ZRS": "ZRS", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "StorageKeyType": { + "type": "Enum", + "methods": {}, + "properties": { + "MANAGED_IDENTITY": "MANAGED_IDENTITY", + "SHARED_ACCESS_KEY": "SHARED_ACCESS_KEY", + "STORAGE_ACCESS_KEY": "STORAGE_ACCESS_KEY", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SubscriptionUsage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "display_name": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SubscriptionUsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspace": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workspaces": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "workspaces": { + "attr_type": "workspaces" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspaceInfoProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workspace_id": { + "default": "none", + "param_type": "keyword_only" + }, + "link_connection_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "workspace_id": { + "attr_type": "workspace_id" + }, + "link_connection_name": { + "attr_type": "link_connection_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SynapseLinkWorkspaceListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgent": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "name_properties_name": { + "attr_type": null + }, + "sync_database_id": { + "attr_type": "sync_database_id" + }, + "last_alive_time": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "is_up_to_date": { + "attr_type": null + }, + "expiry_time": { + "attr_type": null + }, + "version": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentKeyProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sync_agent_key": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentLinkedDatabase": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_type": { + "attr_type": null + }, + "database_id": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "server_name": { + "attr_type": null + }, + "database_name": { + "attr_type": null + }, + "user_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentLinkedDatabaseListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncAgentState": { + "type": "Enum", + "methods": {}, + "properties": { + "NEVER_CONNECTED": "NEVER_CONNECTED", + "OFFLINE": "OFFLINE", + "ONLINE": "ONLINE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncConflictResolutionPolicy": { + "type": "Enum", + "methods": {}, + "properties": { + "HUB_WIN": "HUB_WIN", + "MEMBER_WIN": "MEMBER_WIN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncDatabaseIdListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncDatabaseIdProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncDirection": { + "type": "Enum", + "methods": {}, + "properties": { + "BIDIRECTIONAL": "BIDIRECTIONAL", + "ONE_WAY_HUB_TO_MEMBER": "ONE_WAY_HUB_TO_MEMBER", + "ONE_WAY_MEMBER_TO_HUB": "ONE_WAY_MEMBER_TO_HUB", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncFullSchemaProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tables": { + "attr_type": null + }, + "last_update_time": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaPropertiesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "columns": { + "attr_type": null + }, + "error_id": { + "attr_type": null + }, + "has_error": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "quoted_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncFullSchemaTableColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "data_size": { + "attr_type": null + }, + "data_type": { + "attr_type": null + }, + "error_id": { + "attr_type": null + }, + "has_error": { + "attr_type": null + }, + "is_primary_key": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "quoted_name": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sku": { + "default": "none", + "param_type": "keyword_only" + }, + "interval": { + "default": "none", + "param_type": "keyword_only" + }, + "conflict_resolution_policy": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "hub_database_user_name": { + "default": "none", + "param_type": "keyword_only" + }, + "hub_database_password": { + "default": "none", + "param_type": "keyword_only" + }, + "schema": { + "default": "none", + "param_type": "keyword_only" + }, + "enable_conflict_logging": { + "default": "none", + "param_type": "keyword_only" + }, + "conflict_logging_retention_in_days": { + "default": "none", + "param_type": "keyword_only" + }, + "use_private_link_connection": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "sku": { + "attr_type": "sku" + }, + "interval": { + "attr_type": "interval" + }, + "last_sync_time": { + "attr_type": null + }, + "conflict_resolution_policy": { + "attr_type": "conflict_resolution_policy" + }, + "sync_database_id": { + "attr_type": "sync_database_id" + }, + "hub_database_user_name": { + "attr_type": "hub_database_user_name" + }, + "hub_database_password": { + "attr_type": "hub_database_password" + }, + "sync_state": { + "attr_type": null + }, + "schema": { + "attr_type": "schema" + }, + "enable_conflict_logging": { + "attr_type": "enable_conflict_logging" + }, + "conflict_logging_retention_in_days": { + "attr_type": "conflict_logging_retention_in_days" + }, + "use_private_link_connection": { + "attr_type": "use_private_link_connection" + }, + "private_endpoint_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "timestamp": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "source": { + "attr_type": null + }, + "details": { + "attr_type": null + }, + "tracing_id": { + "attr_type": null + }, + "operation_status": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupLogType": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "ERROR": "ERROR", + "SUCCESS": "SUCCESS", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncGroupSchema": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tables": { + "default": "none", + "param_type": "keyword_only" + }, + "master_sync_member_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tables": { + "attr_type": "tables" + }, + "master_sync_member_name": { + "attr_type": "master_sync_member_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupSchemaTable": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "columns": { + "default": "none", + "param_type": "keyword_only" + }, + "quoted_name": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "columns": { + "attr_type": "columns" + }, + "quoted_name": { + "attr_type": "quoted_name" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupSchemaTableColumn": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "quoted_name": { + "default": "none", + "param_type": "keyword_only" + }, + "data_size": { + "default": "none", + "param_type": "keyword_only" + }, + "data_type": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "quoted_name": { + "attr_type": "quoted_name" + }, + "data_size": { + "attr_type": "data_size" + }, + "data_type": { + "attr_type": "data_type" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncGroupState": { + "type": "Enum", + "methods": {}, + "properties": { + "ERROR": "ERROR", + "GOOD": "GOOD", + "NOT_READY": "NOT_READY", + "PROGRESSING": "PROGRESSING", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncGroupsType": { + "type": "Enum", + "methods": {}, + "properties": { + "ALL": "ALL", + "ERROR": "ERROR", + "SUCCESS": "SUCCESS", + "WARNING": "WARNING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncMember": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_type": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_agent_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sql_server_database_id": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_member_azure_database_resource_id": { + "default": "none", + "param_type": "keyword_only" + }, + "use_private_link_connection": { + "default": "none", + "param_type": "keyword_only" + }, + "server_name": { + "default": "none", + "param_type": "keyword_only" + }, + "database_name": { + "default": "none", + "param_type": "keyword_only" + }, + "user_name": { + "default": "none", + "param_type": "keyword_only" + }, + "password": { + "default": "none", + "param_type": "keyword_only" + }, + "sync_direction": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "database_type": { + "attr_type": "database_type" + }, + "sync_agent_id": { + "attr_type": "sync_agent_id" + }, + "sql_server_database_id": { + "attr_type": "sql_server_database_id" + }, + "sync_member_azure_database_resource_id": { + "attr_type": "sync_member_azure_database_resource_id" + }, + "use_private_link_connection": { + "attr_type": "use_private_link_connection" + }, + "private_endpoint_name": { + "attr_type": null + }, + "server_name": { + "attr_type": "server_name" + }, + "database_name": { + "attr_type": "database_name" + }, + "user_name": { + "attr_type": "user_name" + }, + "password": { + "attr_type": "password" + }, + "sync_direction": { + "attr_type": "sync_direction" + }, + "sync_state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncMemberDbType": { + "type": "Enum", + "methods": {}, + "properties": { + "AZURE_SQL_DATABASE": "AZURE_SQL_DATABASE", + "SQL_SERVER_DATABASE": "SQL_SERVER_DATABASE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SyncMemberListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "SyncMemberState": { + "type": "Enum", + "methods": {}, + "properties": { + "DE_PROVISIONED": "DE_PROVISIONED", + "DE_PROVISIONING": "DE_PROVISIONING", + "DE_PROVISION_FAILED": "DE_PROVISION_FAILED", + "DISABLED_BACKUP_RESTORE": "DISABLED_BACKUP_RESTORE", + "DISABLED_TOMBSTONE_CLEANUP": "DISABLED_TOMBSTONE_CLEANUP", + "PROVISIONED": "PROVISIONED", + "PROVISIONING": "PROVISIONING", + "PROVISION_FAILED": "PROVISION_FAILED", + "REPROVISIONING": "REPROVISIONING", + "REPROVISION_FAILED": "REPROVISION_FAILED", + "SYNC_CANCELLED": "SYNC_CANCELLED", + "SYNC_CANCELLING": "SYNC_CANCELLING", + "SYNC_FAILED": "SYNC_FAILED", + "SYNC_IN_PROGRESS": "SYNC_IN_PROGRESS", + "SYNC_SUCCEEDED": "SYNC_SUCCEEDED", + "SYNC_SUCCEEDED_WITH_WARNINGS": "SYNC_SUCCEEDED_WITH_WARNINGS", + "UN_PROVISIONED": "UN_PROVISIONED", + "UN_REPROVISIONED": "UN_REPROVISIONED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "SystemData": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "created_by": { + "default": "none", + "param_type": "keyword_only" + }, + "created_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "created_at": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_by_type": { + "default": "none", + "param_type": "keyword_only" + }, + "last_modified_at": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "created_by": { + "attr_type": "created_by" + }, + "created_by_type": { + "attr_type": "created_by_type" + }, + "created_at": { + "attr_type": "created_at" + }, + "last_modified_by": { + "attr_type": "last_modified_by" + }, + "last_modified_by_type": { + "attr_type": "last_modified_by_type" + }, + "last_modified_at": { + "attr_type": "last_modified_at" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TableTemporalType": { + "type": "Enum", + "methods": {}, + "properties": { + "HISTORY_TABLE": "HISTORY_TABLE", + "NON_TEMPORAL_TABLE": "NON_TEMPORAL_TABLE", + "SYSTEM_VERSIONED_TEMPORAL_TABLE": "SYSTEM_VERSIONED_TEMPORAL_TABLE", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TdeCertificate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_blob": { + "default": "none", + "param_type": "keyword_only" + }, + "cert_password": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "private_blob": { + "attr_type": "private_blob" + }, + "cert_password": { + "attr_type": "cert_password" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TimeBasedImmutability": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TimeBasedImmutabilityMode": { + "type": "Enum", + "methods": {}, + "properties": { + "LOCKED": "LOCKED", + "UNLOCKED": "UNLOCKED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TimeZone": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "time_zone_id": { + "attr_type": null + }, + "display_name": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TimeZoneListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TopQueries": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "queries": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "number_of_queries": { + "attr_type": null + }, + "aggregation_function": { + "attr_type": null + }, + "observation_metric": { + "attr_type": null + }, + "interval_type": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "queries": { + "attr_type": "queries" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TopQueriesListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TrackedResource": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "TransparentDataEncryptionName": { + "type": "Enum", + "methods": {}, + "properties": { + "CURRENT": "CURRENT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TransparentDataEncryptionScanState": { + "type": "Enum", + "methods": {}, + "properties": { + "ABORTED": "ABORTED", + "COMPLETED": "COMPLETED", + "NONE": "NONE", + "RESUME": "RESUME", + "RUNNING": "RUNNING", + "SUSPEND": "SUSPEND", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "TransparentDataEncryptionState": { + "type": "Enum", + "methods": {}, + "properties": { + "DISABLED": "DISABLED", + "ENABLED": "ENABLED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "UpdateLongTermRetentionBackupParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "requested_backup_storage_redundancy": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "requested_backup_storage_redundancy": { + "attr_type": "requested_backup_storage_redundancy" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpdateVirtualClusterDnsServersOperation": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "status": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationParameters": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "family": { + "default": "none", + "param_type": "keyword_only" + }, + "tier": { + "default": "none", + "param_type": "keyword_only" + }, + "v_cores": { + "default": "none", + "param_type": "keyword_only" + }, + "storage_size_in_gb": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "family": { + "attr_type": "family" + }, + "tier": { + "attr_type": "tier" + }, + "v_cores": { + "attr_type": "v_cores" + }, + "storage_size_in_gb": { + "attr_type": "storage_size_in_gb" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationStepWithEstimatesAndDuration": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "step_end_time": { + "default": "none", + "param_type": "keyword_only" + }, + "time_elapsed": { + "default": "none", + "param_type": "keyword_only" + }, + "order": { + "default": "none", + "param_type": "keyword_only" + }, + "name": { + "default": "none", + "param_type": "keyword_only" + }, + "status": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "step_start_time": { + "attr_type": "step_start_time" + }, + "step_end_time": { + "attr_type": "step_end_time" + }, + "time_elapsed": { + "attr_type": "time_elapsed" + }, + "order": { + "attr_type": "order" + }, + "name": { + "attr_type": "name" + }, + "status": { + "attr_type": "status" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UpsertManagedServerOperationStepWithEstimatesAndDurationStatus": { + "type": "Enum", + "methods": {}, + "properties": { + "CANCELED": "CANCELED", + "COMPLETED": "COMPLETED", + "FAILED": "FAILED", + "IN_PROGRESS": "IN_PROGRESS", + "NOT_STARTED": "NOT_STARTED", + "SLOWED_DOWN": "SLOWED_DOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "Usage": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "unit": { + "attr_type": null + }, + "current_value": { + "attr_type": null + }, + "limit": { + "attr_type": null + }, + "requested_limit": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UsageListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "UserIdentity": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "principal_id": { + "attr_type": null + }, + "client_id": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VaRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "rule_id": { + "attr_type": null + }, + "severity": { + "attr_type": null + }, + "category": { + "attr_type": null + }, + "rule_type": { + "attr_type": null + }, + "title": { + "attr_type": null + }, + "description": { + "attr_type": null + }, + "rationale": { + "attr_type": null + }, + "query_check": { + "attr_type": null + }, + "benchmark_references": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualCluster": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location": { + "default": null, + "param_type": "keyword_only" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "subnet_id": { + "attr_type": null + }, + "version": { + "attr_type": "version" + }, + "child_resources": { + "attr_type": null + }, + "location": { + "attr_type": "location" + }, + "tags": { + "attr_type": "tags" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualClusterListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualClusterUpdate": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tags": { + "default": "none", + "param_type": "keyword_only" + }, + "version": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "tags": { + "attr_type": "tags" + }, + "subnet_id": { + "attr_type": null + }, + "version": { + "attr_type": "version" + }, + "child_resources": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRule": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_subnet_id": { + "default": "none", + "param_type": "keyword_only" + }, + "ignore_missing_vnet_service_endpoint": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "virtual_network_subnet_id": { + "attr_type": "virtual_network_subnet_id" + }, + "ignore_missing_vnet_service_endpoint": { + "attr_type": "ignore_missing_vnet_service_endpoint" + }, + "state": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRuleListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VirtualNetworkRuleState": { + "type": "Enum", + "methods": {}, + "properties": { + "DELETING": "DELETING", + "FAILED": "FAILED", + "INITIALIZING": "INITIALIZING", + "IN_PROGRESS": "IN_PROGRESS", + "READY": "READY", + "UNKNOWN": "UNKNOWN", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentPolicyBaselineName": { + "type": "Enum", + "methods": {}, + "properties": { + "DEFAULT": "DEFAULT", + "MASTER": "MASTER", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentRecurringScansProperties": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "is_enabled": { + "default": "none", + "param_type": "keyword_only" + }, + "email_subscription_admins": { + "default": "bool", + "param_type": "keyword_only" + }, + "emails": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "is_enabled": { + "attr_type": "is_enabled" + }, + "email_subscription_admins": { + "attr_type": "email_subscription_admins" + }, + "emails": { + "attr_type": "emails" + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanError": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "code": { + "attr_type": null + }, + "message": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanRecord": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "scan_id": { + "attr_type": null + }, + "trigger_type": { + "attr_type": null + }, + "state": { + "attr_type": null + }, + "start_time": { + "attr_type": null + }, + "end_time": { + "attr_type": null + }, + "errors": { + "attr_type": null + }, + "storage_container_path": { + "attr_type": null + }, + "number_of_failed_security_checks": { + "attr_type": null + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanRecordListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "VulnerabilityAssessmentScanState": { + "type": "Enum", + "methods": {}, + "properties": { + "FAILED": "FAILED", + "FAILED_TO_RUN": "FAILED_TO_RUN", + "IN_PROGRESS": "IN_PROGRESS", + "PASSED": "PASSED", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "VulnerabilityAssessmentScanTriggerType": { + "type": "Enum", + "methods": {}, + "properties": { + "ON_DEMAND": "ON_DEMAND", + "RECURRING": "RECURRING", + "capitalize": "capitalize", + "casefold": "casefold", + "center": "center", + "count": "count", + "encode": "encode", + "endswith": "endswith", + "expandtabs": "expandtabs", + "find": "find", + "format": "format", + "format_map": "format_map", + "index": "index", + "isalnum": "isalnum", + "isalpha": "isalpha", + "isascii": "isascii", + "isdecimal": "isdecimal", + "isdigit": "isdigit", + "isidentifier": "isidentifier", + "islower": "islower", + "isnumeric": "isnumeric", + "isprintable": "isprintable", + "isspace": "isspace", + "istitle": "istitle", + "isupper": "isupper", + "join": "join", + "ljust": "ljust", + "lower": "lower", + "lstrip": "lstrip", + "maketrans": "maketrans", + "partition": "partition", + "removeprefix": "removeprefix", + "removesuffix": "removesuffix", + "replace": "replace", + "rfind": "rfind", + "rindex": "rindex", + "rjust": "rjust", + "rpartition": "rpartition", + "rsplit": "rsplit", + "rstrip": "rstrip", + "split": "split", + "splitlines": "splitlines", + "startswith": "startswith", + "strip": "strip", + "swapcase": "swapcase", + "title": "title", + "translate": "translate", + "upper": "upper", + "zfill": "zfill" + } + }, + "WorkloadClassifier": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "member_name": { + "default": "none", + "param_type": "keyword_only" + }, + "label": { + "default": "none", + "param_type": "keyword_only" + }, + "context": { + "default": "none", + "param_type": "keyword_only" + }, + "start_time": { + "default": "none", + "param_type": "keyword_only" + }, + "end_time": { + "default": "none", + "param_type": "keyword_only" + }, + "importance": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "member_name": { + "attr_type": "member_name" + }, + "label": { + "attr_type": "label" + }, + "context": { + "attr_type": "context" + }, + "start_time": { + "attr_type": "start_time" + }, + "end_time": { + "attr_type": "end_time" + }, + "importance": { + "attr_type": "importance" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadClassifierListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadGroup": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "min_resource_percent": { + "default": "none", + "param_type": "keyword_only" + }, + "max_resource_percent": { + "default": "none", + "param_type": "keyword_only" + }, + "min_resource_percent_per_request": { + "default": "none", + "param_type": "keyword_only" + }, + "max_resource_percent_per_request": { + "default": "none", + "param_type": "keyword_only" + }, + "importance": { + "default": "none", + "param_type": "keyword_only" + }, + "query_execution_timeout": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "min_resource_percent": { + "attr_type": "min_resource_percent" + }, + "max_resource_percent": { + "attr_type": "max_resource_percent" + }, + "min_resource_percent_per_request": { + "attr_type": "min_resource_percent_per_request" + }, + "max_resource_percent_per_request": { + "attr_type": "max_resource_percent_per_request" + }, + "importance": { + "attr_type": "importance" + }, + "query_execution_timeout": { + "attr_type": "query_execution_timeout" + }, + "id": { + "attr_type": null + }, + "name": { + "attr_type": null + }, + "type": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "WorkloadGroupListResult": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "value": { + "attr_type": null + }, + "next_link": { + "attr_type": null + }, + "additional_properties": { + "attr_type": null + } + } + }, + "ZonePinningCapability": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "reason": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "as_dict": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "key_transformer": { + "default": "attribute_transformer", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "deserialize": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "enable_additional_properties_sending": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "from_dict": { + "parameters": { + "data": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_extractors": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "content_type": { + "default": "none", + "param_type": "positional_or_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "is_xml_model": { + "parameters": {}, + "is_async": false, + "overloads": [] + }, + "serialize": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "keep_readonly": { + "default": "bool", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": { + "availability_zone": { + "attr_type": null + }, + "status": { + "attr_type": null + }, + "reason": { + "attr_type": "reason" + }, + "additional_properties": { + "attr_type": null + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.aio": { + "class_nodes": { + "SqlManagementClient": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential": { + "default": null, + "param_type": "positional_or_keyword" + }, + "subscription_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "base_url": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "cloud_setting": { + "default": "none", + "param_type": "keyword_only" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "close": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": { + "client_side_validation": { + "attr_type": false + }, + "backup_short_term_retention_policies": { + "attr_type": "BackupShortTermRetentionPoliciesOperations" + }, + "server_blob_auditing_policies": { + "attr_type": "ServerBlobAuditingPoliciesOperations" + }, + "database_blob_auditing_policies": { + "attr_type": "DatabaseBlobAuditingPoliciesOperations" + }, + "extended_database_blob_auditing_policies": { + "attr_type": "ExtendedDatabaseBlobAuditingPoliciesOperations" + }, + "extended_server_blob_auditing_policies": { + "attr_type": "ExtendedServerBlobAuditingPoliciesOperations" + }, + "database_advanced_threat_protection_settings": { + "attr_type": "DatabaseAdvancedThreatProtectionSettingsOperations" + }, + "database_advisors": { + "attr_type": "DatabaseAdvisorsOperations" + }, + "database_automatic_tuning": { + "attr_type": "DatabaseAutomaticTuningOperations" + }, + "database_columns": { + "attr_type": "DatabaseColumnsOperations" + }, + "database_encryption_protectors": { + "attr_type": "DatabaseEncryptionProtectorsOperations" + }, + "database_extensions": { + "attr_type": "DatabaseExtensionsOperations" + }, + "database_operations": { + "attr_type": "DatabaseOperationsOperations" + }, + "database_recommended_actions": { + "attr_type": "DatabaseRecommendedActionsOperations" + }, + "databases": { + "attr_type": "DatabasesOperations" + }, + "database_schemas": { + "attr_type": "DatabaseSchemasOperations" + }, + "database_security_alert_policies": { + "attr_type": "DatabaseSecurityAlertPoliciesOperations" + }, + "database_sql_vulnerability_assessment_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentBaselinesOperations" + }, + "database_sql_vulnerability_assessment_execute_scan": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations" + }, + "database_sql_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_sql_vulnerability_assessment_scan_result": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScanResultOperations" + }, + "database_sql_vulnerability_assessment_scans": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentScansOperations" + }, + "database_sql_vulnerability_assessments_settings": { + "attr_type": "DatabaseSqlVulnerabilityAssessmentsSettingsOperations" + }, + "database_tables": { + "attr_type": "DatabaseTablesOperations" + }, + "database_usages": { + "attr_type": "DatabaseUsagesOperations" + }, + "database_vulnerability_assessment_rule_baselines": { + "attr_type": "DatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "database_vulnerability_assessments": { + "attr_type": "DatabaseVulnerabilityAssessmentsOperations" + }, + "database_vulnerability_assessment_scans": { + "attr_type": "DatabaseVulnerabilityAssessmentScansOperations" + }, + "data_masking_policies": { + "attr_type": "DataMaskingPoliciesOperations" + }, + "data_masking_rules": { + "attr_type": "DataMaskingRulesOperations" + }, + "data_warehouse_user_activities": { + "attr_type": "DataWarehouseUserActivitiesOperations" + }, + "deleted_servers": { + "attr_type": "DeletedServersOperations" + }, + "distributed_availability_groups": { + "attr_type": "DistributedAvailabilityGroupsOperations" + }, + "elastic_pool_operations": { + "attr_type": "ElasticPoolOperationsOperations" + }, + "elastic_pools": { + "attr_type": "ElasticPoolsOperations" + }, + "encryption_protectors": { + "attr_type": "EncryptionProtectorsOperations" + }, + "endpoint_certificates": { + "attr_type": "EndpointCertificatesOperations" + }, + "failover_groups": { + "attr_type": "FailoverGroupsOperations" + }, + "firewall_rules": { + "attr_type": "FirewallRulesOperations" + }, + "geo_backup_policies": { + "attr_type": "GeoBackupPoliciesOperations" + }, + "instance_failover_groups": { + "attr_type": "InstanceFailoverGroupsOperations" + }, + "instance_pool_operations": { + "attr_type": "InstancePoolOperationsOperations" + }, + "instance_pools": { + "attr_type": "InstancePoolsOperations" + }, + "ipv6_firewall_rules": { + "attr_type": "IPv6FirewallRulesOperations" + }, + "job_agents": { + "attr_type": "JobAgentsOperations" + }, + "job_credentials": { + "attr_type": "JobCredentialsOperations" + }, + "job_executions": { + "attr_type": "JobExecutionsOperations" + }, + "job_private_endpoints": { + "attr_type": "JobPrivateEndpointsOperations" + }, + "jobs": { + "attr_type": "JobsOperations" + }, + "job_step_executions": { + "attr_type": "JobStepExecutionsOperations" + }, + "job_steps": { + "attr_type": "JobStepsOperations" + }, + "job_target_executions": { + "attr_type": "JobTargetExecutionsOperations" + }, + "job_target_groups": { + "attr_type": "JobTargetGroupsOperations" + }, + "job_versions": { + "attr_type": "JobVersionsOperations" + }, + "ledger_digest_uploads": { + "attr_type": "LedgerDigestUploadsOperations" + }, + "capabilities": { + "attr_type": "CapabilitiesOperations" + }, + "long_term_retention_backups": { + "attr_type": "LongTermRetentionBackupsOperations" + }, + "long_term_retention_managed_instance_backups": { + "attr_type": "LongTermRetentionManagedInstanceBackupsOperations" + }, + "long_term_retention_policies": { + "attr_type": "LongTermRetentionPoliciesOperations" + }, + "maintenance_window_options": { + "attr_type": "MaintenanceWindowOptionsOperations" + }, + "maintenance_windows": { + "attr_type": "MaintenanceWindowsOperations" + }, + "managed_backup_short_term_retention_policies": { + "attr_type": "ManagedBackupShortTermRetentionPoliciesOperations" + }, + "managed_database_advanced_threat_protection_settings": { + "attr_type": "ManagedDatabaseAdvancedThreatProtectionSettingsOperations" + }, + "managed_database_columns": { + "attr_type": "ManagedDatabaseColumnsOperations" + }, + "managed_database_move_operations": { + "attr_type": "ManagedDatabaseMoveOperationsOperations" + }, + "managed_database_queries": { + "attr_type": "ManagedDatabaseQueriesOperations" + }, + "managed_database_restore_details": { + "attr_type": "ManagedDatabaseRestoreDetailsOperations" + }, + "managed_databases": { + "attr_type": "ManagedDatabasesOperations" + }, + "managed_database_schemas": { + "attr_type": "ManagedDatabaseSchemasOperations" + }, + "managed_database_security_alert_policies": { + "attr_type": "ManagedDatabaseSecurityAlertPoliciesOperations" + }, + "managed_database_security_events": { + "attr_type": "ManagedDatabaseSecurityEventsOperations" + }, + "managed_database_sensitivity_labels": { + "attr_type": "ManagedDatabaseSensitivityLabelsOperations" + }, + "managed_database_recommended_sensitivity_labels": { + "attr_type": "ManagedDatabaseRecommendedSensitivityLabelsOperations" + }, + "managed_database_tables": { + "attr_type": "ManagedDatabaseTablesOperations" + }, + "managed_database_transparent_data_encryption": { + "attr_type": "ManagedDatabaseTransparentDataEncryptionOperations" + }, + "managed_database_vulnerability_assessment_rule_baselines": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations" + }, + "managed_database_vulnerability_assessments": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentsOperations" + }, + "managed_database_vulnerability_assessment_scans": { + "attr_type": "ManagedDatabaseVulnerabilityAssessmentScansOperations" + }, + "managed_instance_administrators": { + "attr_type": "ManagedInstanceAdministratorsOperations" + }, + "managed_instance_advanced_threat_protection_settings": { + "attr_type": "ManagedInstanceAdvancedThreatProtectionSettingsOperations" + }, + "managed_instance_azure_ad_only_authentications": { + "attr_type": "ManagedInstanceAzureADOnlyAuthenticationsOperations" + }, + "managed_instance_dtcs": { + "attr_type": "ManagedInstanceDtcsOperations" + }, + "managed_instance_encryption_protectors": { + "attr_type": "ManagedInstanceEncryptionProtectorsOperations" + }, + "managed_instance_keys": { + "attr_type": "ManagedInstanceKeysOperations" + }, + "managed_instance_long_term_retention_policies": { + "attr_type": "ManagedInstanceLongTermRetentionPoliciesOperations" + }, + "managed_instance_operations": { + "attr_type": "ManagedInstanceOperationsOperations" + }, + "managed_instance_private_endpoint_connections": { + "attr_type": "ManagedInstancePrivateEndpointConnectionsOperations" + }, + "managed_instance_private_link_resources": { + "attr_type": "ManagedInstancePrivateLinkResourcesOperations" + }, + "managed_instances": { + "attr_type": "ManagedInstancesOperations" + }, + "managed_instance_tde_certificates": { + "attr_type": "ManagedInstanceTdeCertificatesOperations" + }, + "managed_instance_vulnerability_assessments": { + "attr_type": "ManagedInstanceVulnerabilityAssessmentsOperations" + }, + "managed_ledger_digest_uploads": { + "attr_type": "ManagedLedgerDigestUploadsOperations" + }, + "managed_restorable_dropped_database_backup_short_term_retention_policies": { + "attr_type": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations" + }, + "managed_server_dns_aliases": { + "attr_type": "ManagedServerDnsAliasesOperations" + }, + "managed_server_security_alert_policies": { + "attr_type": "ManagedServerSecurityAlertPoliciesOperations" + }, + "network_security_perimeter_configurations": { + "attr_type": "NetworkSecurityPerimeterConfigurationsOperations" + }, + "operations": { + "attr_type": "Operations" + }, + "outbound_firewall_rules": { + "attr_type": "OutboundFirewallRulesOperations" + }, + "private_endpoint_connections": { + "attr_type": "PrivateEndpointConnectionsOperations" + }, + "private_link_resources": { + "attr_type": "PrivateLinkResourcesOperations" + }, + "recoverable_databases": { + "attr_type": "RecoverableDatabasesOperations" + }, + "recoverable_managed_databases": { + "attr_type": "RecoverableManagedDatabasesOperations" + }, + "replication_links": { + "attr_type": "ReplicationLinksOperations" + }, + "restorable_dropped_databases": { + "attr_type": "RestorableDroppedDatabasesOperations" + }, + "restorable_dropped_managed_databases": { + "attr_type": "RestorableDroppedManagedDatabasesOperations" + }, + "restore_points": { + "attr_type": "RestorePointsOperations" + }, + "sensitivity_labels": { + "attr_type": "SensitivityLabelsOperations" + }, + "recommended_sensitivity_labels": { + "attr_type": "RecommendedSensitivityLabelsOperations" + }, + "server_advanced_threat_protection_settings": { + "attr_type": "ServerAdvancedThreatProtectionSettingsOperations" + }, + "server_advisors": { + "attr_type": "ServerAdvisorsOperations" + }, + "server_automatic_tuning": { + "attr_type": "ServerAutomaticTuningOperations" + }, + "server_azure_ad_administrators": { + "attr_type": "ServerAzureADAdministratorsOperations" + }, + "server_azure_ad_only_authentications": { + "attr_type": "ServerAzureADOnlyAuthenticationsOperations" + }, + "server_configuration_options": { + "attr_type": "ServerConfigurationOptionsOperations" + }, + "server_connection_policies": { + "attr_type": "ServerConnectionPoliciesOperations" + }, + "server_dev_ops_audit_settings": { + "attr_type": "ServerDevOpsAuditSettingsOperations" + }, + "server_dns_aliases": { + "attr_type": "ServerDnsAliasesOperations" + }, + "server_keys": { + "attr_type": "ServerKeysOperations" + }, + "server_operations": { + "attr_type": "ServerOperationsOperations" + }, + "servers": { + "attr_type": "ServersOperations" + }, + "server_security_alert_policies": { + "attr_type": "ServerSecurityAlertPoliciesOperations" + }, + "server_trust_certificates": { + "attr_type": "ServerTrustCertificatesOperations" + }, + "server_trust_groups": { + "attr_type": "ServerTrustGroupsOperations" + }, + "server_usages": { + "attr_type": "ServerUsagesOperations" + }, + "server_vulnerability_assessments": { + "attr_type": "ServerVulnerabilityAssessmentsOperations" + }, + "sql_agent": { + "attr_type": "SqlAgentOperations" + }, + "sql_vulnerability_assessment_baseline": { + "attr_type": "SqlVulnerabilityAssessmentBaselineOperations" + }, + "sql_vulnerability_assessment_baselines": { + "attr_type": "SqlVulnerabilityAssessmentBaselinesOperations" + }, + "sql_vulnerability_assessment_execute_scan": { + "attr_type": "SqlVulnerabilityAssessmentExecuteScanOperations" + }, + "sql_vulnerability_assessment_rule_baseline": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselineOperations" + }, + "sql_vulnerability_assessment_rule_baselines": { + "attr_type": "SqlVulnerabilityAssessmentRuleBaselinesOperations" + }, + "sql_vulnerability_assessment_scan_result": { + "attr_type": "SqlVulnerabilityAssessmentScanResultOperations" + }, + "sql_vulnerability_assessment_scans": { + "attr_type": "SqlVulnerabilityAssessmentScansOperations" + }, + "sql_vulnerability_assessments_settings": { + "attr_type": "SqlVulnerabilityAssessmentsSettingsOperations" + }, + "sql_vulnerability_assessments": { + "attr_type": "SqlVulnerabilityAssessmentsOperations" + }, + "start_stop_managed_instance_schedules": { + "attr_type": "StartStopManagedInstanceSchedulesOperations" + }, + "subscription_usages": { + "attr_type": "SubscriptionUsagesOperations" + }, + "synapse_link_workspaces": { + "attr_type": "SynapseLinkWorkspacesOperations" + }, + "sync_agents": { + "attr_type": "SyncAgentsOperations" + }, + "sync_groups": { + "attr_type": "SyncGroupsOperations" + }, + "sync_members": { + "attr_type": "SyncMembersOperations" + }, + "tde_certificates": { + "attr_type": "TdeCertificatesOperations" + }, + "time_zones": { + "attr_type": "TimeZonesOperations" + }, + "transparent_data_encryptions": { + "attr_type": "TransparentDataEncryptionsOperations" + }, + "usages": { + "attr_type": "UsagesOperations" + }, + "virtual_clusters": { + "attr_type": "VirtualClustersOperations" + }, + "virtual_network_rules": { + "attr_type": "VirtualNetworkRulesOperations" + }, + "workload_classifiers": { + "attr_type": "WorkloadClassifiersOperations" + }, + "workload_groups": { + "attr_type": "WorkloadGroupsOperations" + } + } + } + }, + "function_nodes": {} + }, + "azure.mgmt.sql.aio.operations": { + "class_nodes": { + "BackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "BackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "CapabilitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "include": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DataMaskingRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DataMaskingRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "type": "Union[str, DataMaskingPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_masking_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DataWarehouseUserActivitiesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "data_warehouse_user_activity_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_revert": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseExtensionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseExtensions", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "extension_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseRecommendedActionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database_advisor": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedActionAutoGenerated", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "recommended_action_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseSqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Database", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExportDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_import_method": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportExistingDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_pause": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_upgrade_data_warehouse": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "rename": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ResourceMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "DeletedServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_recover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "deleted_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "DistributedAvailabilityGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupsFailoverRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_set_role": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroupSetRole", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DistributedAvailabilityGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "distributed_availability_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_elastic_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ElasticPoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ElasticPoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "elastic_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "EncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "EndpointCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "endpoint_type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedDatabaseBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedDatabaseBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ExtendedServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ExtendedServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_try_planned_before_forced_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FailoverGroupUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "replace": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "FirewallRuleList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "GeoBackupPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "GeoBackupPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "type": "Union[str, GeoBackupPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "geo_backup_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "IPv6FirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IPv6FirewallRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "firewall_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstanceFailoverGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstanceFailoverGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_force_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "failover_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "InstancePoolsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePool", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "InstancePoolUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobAgentUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobCredentialsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobCredential", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "credential_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobPrivateEndpointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobPrivateEndpoint", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobStepsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobStep", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_version": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetExecutionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job_execution": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_step": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_execution_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "step_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "create_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "create_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_min": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time_max": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "is_active": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobTargetGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "JobTargetGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "target_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobVersionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_version": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_job": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "JobsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Job", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_agent": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "job_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, LedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_change_access_tier": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_change_access_tier_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ChangeLongTermRetentionBackupAccessTierParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_copy": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_copy_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CopyLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_lock_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_lock_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_time_based_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_remove_time_based_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_set_legal_hold_immutability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_set_legal_hold_immutability_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "UpdateLongTermRetentionBackupParameters", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "long_term_retention_server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionManagedInstanceBackupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "backup_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "database_state": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "LongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, LongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_options_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "MaintenanceWindowsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "MaintenanceWindows", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "maintenance_window_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseColumnsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "table": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "column": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "order_by": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_table": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseMoveOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "only_latest_per_database": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseQueriesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_query": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "query_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseRecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseRestoreDetailsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_details_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSchemasOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSecurityEventsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skip": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "top": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "skiptoken": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedDatabaseTablesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseTransparentDataEncryptionOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessmentRuleBaseline", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, VulnerabilityAssessmentPolicyBaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_initiate_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "export": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabaseVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_cancel_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_complete_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_complete_restore": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CompleteDatabaseRestoreDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabase", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_start_move": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseStartMoveDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedDatabaseUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_inaccessible_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceDtcsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceDtc", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "type": "Union[str, DtcName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dtc_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceEncryptionProtectorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceEncryptionProtector", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "type": "Union[str, EncryptionProtectorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_revalidate": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "encryption_protector_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceLongTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceLongTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedInstanceLongTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "cancel": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "operation_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstancePrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancePrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstanceTdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ManagedInstanceVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedInstancesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstance", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "replica_type": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_reevaluate_inaccessible_database_state": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_start": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_stop": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_validate_azure_key_vault_encryption_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedInstanceValidateAzureKeyVaultEncryptionKeyRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "number_of_queries": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "databases": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "interval": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "aggregation_function": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "observation_metric": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_outbound_network_dependencies_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedLedgerDigestUploadsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedLedgerDigestUploads", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "type": "Union[str, ManagedLedgerDigestUploadsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_disable": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "ledger_digest_uploads": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedBackupShortTermRetentionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "type": "Union[str, ManagedShortTermRetentionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_restorable_dropped_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerDnsAliasCreation", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ManagedServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ManagedServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "NetworkSecurityPerimeterConfigurationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_reconcile": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "nsp_config_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "Operations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "OutboundFirewallRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "outbound_rule_fqdn": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateEndpointConnectionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "PrivateEndpointConnection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "private_endpoint_connection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "PrivateLinkResourcesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecommendedSensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "RecommendedSensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "RecoverableDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RecoverableManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "recoverable_database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ReplicationLinksOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLink", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_failover_allow_data_loss": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ReplicationLinkUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "link_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorableDroppedManagedDatabasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restorable_dropped_database_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "RestorePointsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CreateDatabaseRestorePointDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "restore_point_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SensitivityLabelsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabel", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "disable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "enable_recommendation": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "schema_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "table_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "column_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sensitivity_label_source": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_current_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "count": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_recommended_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "skip_token": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "include_disabled_recommendations": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "filter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SensitivityLabelUpdateList", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAdvancedThreatProtectionSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAdvancedThreatProtection", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "type": "Union[str, AdvancedThreatProtectionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advanced_threat_protection_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAdvisorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Advisor", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "advisor_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAutomaticTuningOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAutomaticTuning", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "ServerAzureADAdministratorsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADAdministrator", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "type": "Union[str, AdministratorName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "administrator_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerAzureADOnlyAuthenticationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerAzureADOnlyAuthentication", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "type": "Union[str, AuthenticationName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "authentication_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerBlobAuditingPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerBlobAuditingPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConfigurationOptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConfigurationOption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "type": "Union[str, ServerConfigurationOptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_configuration_option_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_managed_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerConnectionPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerConnectionPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "type": "Union[str, ConnectionPolicyName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "connection_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDevOpsAuditSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDevOpsAuditingSettings", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "type": "Union[str, DevOpsAuditingSettingsName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dev_ops_auditing_settings_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerDnsAliasesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_acquire": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerDnsAliasAcquisition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "dns_alias_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerKeysOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerKey", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "key_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerOperationsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerSecurityAlertPoliciesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerSecurityAlertPolicy", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "type": "Union[str, SecurityAlertPolicyNameAutoGenerated]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "security_alert_policy_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "certificate_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerTrustGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerTrustGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_trust_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServerVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "ServersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "Server", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_import_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ImportNewDatabaseDefinition", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_refresh_status": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "ServerUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "check_name_availability": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "CheckNameAvailabilityRequest", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlAgentOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlAgentConfiguration", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessment": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineListInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentExecuteScanOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_execute": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselineOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "DatabaseSqlVulnerabilityAssessmentRuleBaselineInput", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "type": "Union[str, BaselineName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_baseline": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentRuleBaselinesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "baseline_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "rule_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScanResultOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_result_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_scan": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentScansOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "scan_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sql_vulnerability_assessments": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SqlVulnerabilityAssessmentsSettingsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SqlVulnerabilityAssessment", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "type": "Union[str, VulnerabilityAssessmentName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "vulnerability_assessment_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "StartStopManagedInstanceSchedulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "StartStopManagedInstanceSchedule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "type": "Union[str, StartStopScheduleName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_stop_schedule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_instance": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "managed_instance_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SubscriptionUsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "usage_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SynapseLinkWorkspacesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncAgentsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncAgent", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "generate_key": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_linked_databases": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_agent_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "SyncGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_hub_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "cancel_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_hub_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_logs": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "start_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "end_time": { + "default": null, + "param_type": "positional_or_keyword" + }, + "type": { + "default": null, + "param_type": "positional_or_keyword" + }, + "continuation_token_parameter": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_sync_database_ids": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "trigger_sync": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + } + }, + "properties": {} + }, + "SyncMembersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_refresh_member_schema": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "SyncMember", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_sync_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_member_schemas": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "sync_member_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TdeCertificatesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "TdeCertificate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + } + }, + "properties": {} + }, + "TimeZonesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "time_zone_id": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_location": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "location_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "TransparentDataEncryptionsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "LogicalDatabaseTransparentDataEncryption", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "type": "Union[str, TransparentDataEncryptionName]", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_resume": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_suspend": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "tde_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "UsagesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_instance_pool": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "instance_pool_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "expand_children": { + "default": "none", + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualClustersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualCluster", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "begin_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualClusterUpdate", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_update_dns_servers": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_cluster_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "list_by_resource_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "VirtualNetworkRulesOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "VirtualNetworkRule", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "virtual_network_rule_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_server": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadClassifiersOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadClassifier", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_classifier_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_workload_group": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + }, + "WorkloadGroupsOperations": { + "type": null, + "methods": { + "__init__": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "args": { + "default": null, + "param_type": "var_positional" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + }, + "begin_create_or_update": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [ + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "WorkloadGroup", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + }, + { + "parameters": { + "self": { + "type": null, + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "type": "str", + "default": null, + "param_type": "positional_or_keyword" + }, + "parameters": { + "type": "IO[bytes]", + "default": null, + "param_type": "positional_or_keyword" + }, + "content_type": { + "type": "str", + "default": "application/json", + "param_type": "keyword_only" + } + }, + "is_async": true, + "return_type": null + } + ] + }, + "begin_delete": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "get": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "workload_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": true, + "overloads": [] + }, + "list_by_database": { + "parameters": { + "self": { + "default": null, + "param_type": "positional_or_keyword" + }, + "resource_group_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "server_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "database_name": { + "default": null, + "param_type": "positional_or_keyword" + }, + "kwargs": { + "default": null, + "param_type": "var_keyword" + } + }, + "is_async": false, + "overloads": [] + } + }, + "properties": {} + } + }, + "function_nodes": {} + } +} \ No newline at end of file diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py index 9e14c1a5ea38..8eb1c1db58d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_administrators.begin_create_or_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/AdministratorCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py index 12ff054d36e8..076c789e98a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_azure_ad_administrators.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorDelete.json +# x-ms-original-file: 2025-02-01-preview/AdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py index 5955fb352087..7af13c066cb1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_administrators.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorGet.json +# x-ms-original-file: 2025-02-01-preview/AdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py index 4fdb375a6988..a5f15bf444a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/administrator_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_administrators.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AdministratorList.json +# x-ms-original-file: 2025-02-01-preview/AdministratorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py index c0101891a4d8..c6aa1f8f3f9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_only_authentications.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/AzureADOnlyAuthCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py index 4887fc865326..e632b9467500 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_azure_ad_only_authentications.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthDelete.json +# x-ms-original-file: 2025-02-01-preview/AzureADOnlyAuthDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py index 3f754d4ea3a6..d59bd0643420 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_only_authentications.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthGet.json +# x-ms-original-file: 2025-02-01-preview/AzureADOnlyAuthGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py index 5a0c679ce067..d86ab1ec44f0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/azure_ad_only_auth_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_azure_ad_only_authentications.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/AzureADOnlyAuthList.json +# x-ms-original-file: 2025-02-01-preview/AzureADOnlyAuthList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py index 643a2f49c9a4..a71671148986 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_database_operation.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.database_operations.cancel( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelDatabaseOperation.json +# x-ms-original-file: 2025-02-01-preview/CancelDatabaseOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py index 25927debd268..b75424cd4206 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_elastic_pool_operation.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.elastic_pool_operations.cancel( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelElasticPoolOperation.json +# x-ms-original-file: 2025-02-01-preview/CancelElasticPoolOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py index 42bc0e241b3a..4e6f26b010a9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_job_execution.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_executions.cancel( @@ -40,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelJobExecution.json +# x-ms-original-file: 2025-02-01-preview/CancelJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py index b5f5fda54f39..b9e435e6203e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/cancel_managed_instance_operation.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_operations.cancel( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CancelManagedInstanceOperation.json +# x-ms-original-file: 2025-02-01-preview/CancelManagedInstanceOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py b/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py index c04e805a55d9..02ed6472a84e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/change_long_term_retention_backup_access_tier.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_change_access_tier( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ChangeLongTermRetentionBackupAccessTier.json +# x-ms-original-file: 2025-02-01-preview/ChangeLongTermRetentionBackupAccessTier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py index 2407f4e04316..129b9679982a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_already_exists.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.check_name_availability( @@ -37,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerAlreadyExists.json +# x-ms-original-file: 2025-02-01-preview/CheckNameAvailabilityServerAlreadyExists.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py index 32ffca67e681..bb6167626321 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_available.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.check_name_availability( @@ -37,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerAvailable.json +# x-ms-original-file: 2025-02-01-preview/CheckNameAvailabilityServerAvailable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py index 239517aef24b..f333a1ba8527 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/check_name_availability_server_invalid.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.check_name_availability( @@ -37,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CheckNameAvailabilityServerInvalid.json +# x-ms-original-file: 2025-02-01-preview/CheckNameAvailabilityServerInvalid.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py index 6c5a2e4c7a7c..5edee27f7c6b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sensitivity_labels.create_or_update( @@ -38,6 +37,7 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="current", parameters={ "properties": { "clientClassificationSource": "Native", @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ColumnSensitivityLabelCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py index 938b1aee2941..ac4dc2651595 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sensitivity_labels.delete( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="current", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelDelete.json +# x-ms-original-file: 2025-02-01-preview/ColumnSensitivityLabelDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py index 1ac64c2465c1..86c358d83257 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/column_sensitivity_label_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sensitivity_labels.get( @@ -43,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnSensitivityLabelGet.json +# x-ms-original-file: 2025-02-01-preview/ColumnSensitivityLabelGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py index 75ca5a95a8b0..f579896be8f0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_columns.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnsListByDatabaseMax.json +# x-ms-original-file: 2025-02-01-preview/ColumnsListByDatabaseMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py index 2fb4b329c2ca..e6543e23d5ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/columns_list_by_database_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_columns.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ColumnsListByDatabaseMin.json +# x-ms-original-file: 2025-02-01-preview/ColumnsListByDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py index 539384b02a80..14ce9feba993 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_configured_backup_storage_redundancy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseConfiguredBackupStorageRedundancy.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseConfiguredBackupStorageRedundancy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py index 792bca0aba56..def8c5f9299c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_copy_mode.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseCopyMode.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseCopyMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py index cfab8b4787d6..0d5f99478838 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultEnclave.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py index a07bd919b419..e7b40f3a4258 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultMode.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseDefaultMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py index c6573fb098ef..f4ae458f2cce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_keys_and_encryption_protector.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseDefaultModeWithKeysAndEncryptionProtector.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py index aaf7cf6acf6f..81978fd48a50 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_default_mode_with_versionless_keys_and_versionless_encryption_protector.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseDefaultModeWithVersionlessKeysAndVersionlessEncryptionProtector.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseDefaultModeWithVersionlessKeysAndVersionlessEncryptionProtector.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py index 10ae330e8631..c36eb4ef0b47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_ledger.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseLedger.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseLedger.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py index a5dfd710d9c4..14814df680b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py index 86c20f16c07c..35a6204e918d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseMin.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py index 210c15153346..6fb2c113673c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_named_replica.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseNamedReplica.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseNamedReplica.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py index f7318da41e81..9d883e455bb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_pitr_mode.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabasePITRMode.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabasePITRMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py index ec8e635d0ace..6393025a7a24 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_secondary_mode.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseSecondaryMode.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseSecondaryMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py index 099080c1a046..55b2db650062 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_standby_mode.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseStandbyMode.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseStandbyMode.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py index b3c5c18added..a92a983ff6e2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_vbs_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseVBSEnclave.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py index 7f7baaf56d45..993c3d6e02d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_availability_zone.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseWithAvailabilityZone.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py index 1d93caa83eeb..42b0d34d46b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_database_with_encryption_protector_auto_rotation.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDatabaseWithEncryptionProtectorAutoRotation.json +# x-ms-original-file: 2025-02-01-preview/CreateDatabaseWithEncryptionProtectorAutoRotation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py index 76a4ed4e17e9..bd97ac1c27d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_pitr.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionPITR.json +# x-ms-original-file: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionPITR.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py index 52cbea519655..b48b44bcad49 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_recovery.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionRecovery.json +# x-ms-original-file: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionRecovery.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py index abffe0c65ef3..1073ea17460c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_dw_database_cross_subscription_restore.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateDwDatabaseCrossSubscriptionRestore.json +# x-ms-original-file: 2025-02-01-preview/CreateDwDatabaseCrossSubscriptionRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py index b3f29c82d826..875825fe29e1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_elastic_pool_with_availability_zone.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateElasticPoolWithAvailabilityZone.json +# x-ms-original-file: 2025-02-01-preview/CreateElasticPoolWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py index d92404fb2f70..599a70c39d05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_job_execution.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.begin_create( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateJobExecution.json +# x-ms-original-file: 2025-02-01-preview/CreateJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py index 7d8d7ee545d9..40ddbdedb455 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_database_ledger.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateManagedDatabaseLedger.json +# x-ms-original-file: 2025-02-01-preview/CreateManagedDatabaseLedger.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy.py new file mode 100644 index 000000000000..d2ead71edb57 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_managed_short_term_retention_policy.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.managed_backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + managed_instance_name="testsvr", + database_name="testdb", + policy_name="default", + parameters={"properties": {"retentionDays": 14}}, + ).result() + + +# x-ms-original-file: 2025-02-01-preview/CreateManagedShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy_restorable_dropped.py new file mode 100644 index 000000000000..6e4cb2ef0748 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_managed_short_term_retention_policy_restorable_dropped.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_managed_short_term_retention_policy_restorable_dropped.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + client.managed_restorable_dropped_database_backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + managed_instance_name="testsvr", + restorable_dropped_database_id="testdb,131403269876900000", + policy_name="default", + parameters={"properties": {"retentionDays": 14}}, + ).result() + + +# x-ms-original-file: 2025-02-01-preview/CreateManagedShortTermRetentionPolicyRestorableDropped.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py index e1fdc46c809e..23b41dde86fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_database_extensions.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="a1c0814d-3c18-4e1e-a247-c128c12b1677", + subscription_id="SUBSCRIPTION_ID", ) - response = client.database_extensions.begin_create_or_update( + client.database_extensions.begin_create_or_update( resource_group_name="rg_20cbe0f0-c2d9-4522-9177-5469aad53029", server_name="srv_1ffd1cf8-9951-47fb-807d-a9c384763849", database_name="878e303f-1ea0-4f17-aa3d-a22ac5e9da08", @@ -45,9 +45,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateDatabaseExtensions.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py index 8b5baafebb14..58b62f76e89f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.begin_create_or_update( @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateInstancePoolMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateInstancePoolMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py index 5db9278ad304..fc9ba44c7d9b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_instance_pool_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateInstancePoolMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateInstancePoolMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py index 0c266ac139fd..76f7027e0a4c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_create_or_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgent.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py index 7239a60c0ec8..66592270d889 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_create_or_update( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgentWithIdentity.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobAgentWithIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py index 26d828b9f3d3..2f56bbde1b1b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_agent_with_sku.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobAgentWithSku.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobAgentWithSku.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py index 144f9bdfce39..3d9a31ecefee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_credential.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_credentials.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobCredential.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py index 9ecff6f693e0..ae6779401857 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_execution.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.begin_create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobExecution.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py index 85d10db6b557..5563336f6011 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.create_or_update( @@ -52,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py index de1cdaec3b76..b5a04adcdf8a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.create_or_update( @@ -37,23 +36,33 @@ def main(): job_agent_name="agent1", job_name="job1", parameters={ - "description": "", "id": "str", "name": "str", - "schedule": { - "enabled": bool, - "endTime": "9999-12-31T03:59:59-08:00", - "interval": "str", - "startTime": "0001-01-01T16:00:00-08:00", - "type": "Once", + "properties": { + "description": "str", + "schedule": { + "enabled": bool, + "endTime": "2020-02-20 00:00:00", + "interval": "str", + "startTime": "2020-02-20 00:00:00", + "type": "str", + }, + "version": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", - "version": 0, }, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py index 328d63a11906..6acaeeff60fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_private_endpoint.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_private_endpoints.begin_create_or_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobPrivateEndpoint.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py index c7bed9231d36..51c135ce8ae4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.create_or_update( @@ -66,6 +66,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobStepMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobStepMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py index f1b91f0f9342..6ad5d7e1d505 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_step_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobStepMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobStepMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py index 62f32a26c4ec..ba8b53ea1b94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_groups.create_or_update( @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobTargetGroupMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobTargetGroupMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py index 9622e5c5dfac..dfa9aa401130 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_job_target_group_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_groups.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateJobTargetGroupMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateJobTargetGroupMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py index 8c13253479de..7020675859a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_maintenance_windows.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,22 +25,22 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.maintenance_windows.create_or_update( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdwdb", - maintenance_window_name="current", parameters={ "properties": {"timeRanges": [{"dayOfWeek": "Saturday", "duration": "PT60M", "startTime": "00:00:00"}]} }, + maintenance_window_name="current", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateMaintenanceWindows.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateMaintenanceWindows.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py index a9d6524e7c4e..79ac707b3a0d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_classifiers.begin_create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadClassifierMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateWorkloadClassifierMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py index 78a64eb33323..ed865c57d604 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_classifier_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_classifiers.begin_create_or_update( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadClassifierMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateWorkloadClassifierMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py index 1e0cab96af47..8f0336759369 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_groups.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadGroupMax.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateWorkloadGroupMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py index d8ff300de107..e3bc7a2cda30 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_or_update_workload_group_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_groups.begin_create_or_update( @@ -43,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateOrUpdateWorkloadGroupMin.json +# x-ms-original-file: 2025-02-01-preview/CreateOrUpdateWorkloadGroupMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_short_term_retention_policy.py new file mode 100644 index 000000000000..efdd7ac52c53 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_short_term_retention_policy.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python create_short_term_retention_policy.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.backup_short_term_retention_policies.begin_create_or_update( + resource_group_name="resourceGroup", + server_name="testsvr", + database_name="testdb", + policy_name="default", + parameters={"properties": {"diffBackupIntervalInHours": 24, "retentionDays": 7}}, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/CreateShortTermRetentionPolicy.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py index 32c15fc288f6..8fac07b45e4a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_service_objective.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateVCoreDatabaseByServiceObjective.json +# x-ms-original-file: 2025-02-01-preview/CreateVCoreDatabaseByServiceObjective.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py index 5f3c78df4a42..629196ba36be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/create_vcore_database_by_sku_name_capacity.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/CreateVCoreDatabaseBySkuNameCapacity.json +# x-ms-original-file: 2025-02-01-preview/CreateVCoreDatabaseBySkuNameCapacity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py index 4338de5a6fa8..362357c41df5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_policies.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyCreateOrUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingPolicyCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py index 080675e76795..fa8b66da6488 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_create_or_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_policies.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyCreateOrUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingPolicyCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py index f419de64fe0d..546dbbde1047 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_policy_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingPolicyGet.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py index 67e0574331a6..6da36e097d9f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_rules.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingRuleCreateOrUpdateDefaultMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py index f7068671643e..84626eb2f524 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_default_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_rules.create_or_update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateDefaultMin.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingRuleCreateOrUpdateDefaultMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py index 0addb3ac0d52..32e1e5d13292 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_number.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_rules.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateNumber.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingRuleCreateOrUpdateNumber.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py index 4a8752210357..a37b6b1992dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_create_or_update_text.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_rules.create_or_update( @@ -52,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleCreateOrUpdateText.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingRuleCreateOrUpdateText.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py index 27f7eea3e6c1..ed2ef1ad808e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_masking_rule_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_masking_rules.list_by_database( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataMaskingRuleListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DataMaskingRuleListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py index bd895b76695b..f6c510a075f0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restore_points.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataWarehouseRestorePointsGet.json +# x-ms-original-file: 2025-02-01-preview/DataWarehouseRestorePointsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py index 65dfea720386..24d798e672ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/data_warehouse_restore_points_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restore_points.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DataWarehouseRestorePointsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DataWarehouseRestorePointsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py index 78a296a992af..945f8471804a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advanced_threat_protection_settings.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py index 0cc9a946e543..cc64a3ea86fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advanced_threat_protection_settings.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py index e936d509a839..479d2f94cef2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advanced_threat_protection_settings.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py index 5dcd420a2a41..b31417bbaabb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advanced_threat_protection_settings_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advanced_threat_protection_settings.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py index e846ea54a141..b971a4457718 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advisors.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvisorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py index a909d3ee4d6e..4e4081aebb76 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advisors.list_by_database( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorList.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvisorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py index f920f09a196b..d73716e1bbb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_advisor_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advisors.update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAdvisorUpdate.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAdvisorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py index 5f8d150dbcf5..c7573d83a824 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_auditing_settings_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_blob_auditing_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAuditingSettingsList.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py index 61786958244a..9b2c26909b2c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_automatic_tuning.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAutomaticTuningGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py index 92362b3786b6..0f7b38622f21 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_automatic_tuning.update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAutomaticTuningUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py index 0bba129933b4..1bb752fec2f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_automatic_tuning_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_automatic_tuning.update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAutomaticTuningUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAutomaticTuningUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py index 008784bac735..6224a43b39d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_azure_monitor_auditing_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseAzureMonitorAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseAzureMonitorAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py index a37b36e90284..45c57e5ab73d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,15 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={ "properties": { "auditActionsAndGroups": [ @@ -56,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingCreateMax.json +# x-ms-original-file: 2025-02-01-preview/DatabaseBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py index 04feea9a6569..854def200292 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_create_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,15 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={ "properties": { "state": "Enabled", @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py index ce01d1119356..f44c6b2ec6ac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_blob_auditing_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_blob_auditing_policies.get( resource_group_name="blobauditingtest-6852", server_name="blobauditingtest-2080", database_name="testdb", + blob_auditing_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseBlobAuditingGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py index f632898aa3cf..f1b818b126b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_columns.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseColumnGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseColumnGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py index 1ab1ee3fa104..b63ad5c9d323 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_column_list_by_table.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_columns.list_by_table( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseColumnListByTable.json +# x-ms-original-file: 2025-02-01-preview/DatabaseColumnListByTable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py index 4b5ee5528ff5..ee60b16f2041 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revalidate.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.database_encryption_protectors.begin_revalidate( + response = client.database_encryption_protectors.begin_revalidate( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", database_name="sqlcrudtestdb-2342", encryption_protector_name="current", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseEncryptionProtectorRevalidate.json +# x-ms-original-file: 2025-02-01-preview/DatabaseEncryptionProtectorRevalidate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py index 2396d43dec92..5341fb8d811c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_encryption_protector_revert.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.database_encryption_protectors.begin_revert( + response = client.database_encryption_protectors.begin_revert( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", database_name="sqlcrudtestdb-2342", encryption_protector_name="current", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseEncryptionProtectorRevert.json +# x-ms-original-file: 2025-02-01-preview/DatabaseEncryptionProtectorRevert.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py index a234ea489b03..c707b1672fce 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_extended_auditing_settings_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_database_blob_auditing_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseExtendedAuditingSettingsList.json +# x-ms-original-file: 2025-02-01-preview/DatabaseExtendedAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py index bb417162066d..7dc3052c51f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_recommended_actions.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRecommendedActionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py index d3748127adf2..ac5429542d7c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_recommended_actions.list_by_database_advisor( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionList.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRecommendedActionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py index a617f45661ba..81cebc66c40d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_list_expand.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_advisors.list_by_database( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionListExpand.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRecommendedActionListExpand.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py index b4e9a7e5c54a..5dda7a8c7a7a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_recommended_action_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_recommended_actions.update( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRecommendedActionUpdate.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRecommendedActionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py index c4e8b091c4d4..4249d05d9dfb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.restore_points.delete( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsDelete.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRestorePointsDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py index 881fa386e3c8..8dc020cdfa41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restore_points.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRestorePointsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py index 673a0e447a8a..a924185333b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restore_points.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRestorePointsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py index 67d6dff2151d..9991aebb9f90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_restore_points_post.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restore_points.begin_create( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseRestorePointsPost.json +# x-ms-original-file: 2025-02-01-preview/DatabaseRestorePointsPost.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py index fb36a97d0c23..a94aed8b8126 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_schemas.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSchemaGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSchemaGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py index 96b1b4b882f6..a09f4d12e1f6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_schema_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_schemas.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSchemaListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSchemaListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py index 070b36ecf38e..b01461fa8602 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,16 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_security_alert_policies.create_or_update( resource_group_name="securityalert-4799", server_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", parameters={ "properties": { "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertCreateMax.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py index 30b0e45e2c2d..a13eaa878583 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,21 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_security_alert_policies.create_or_update( resource_group_name="securityalert-4799", server_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", parameters={"properties": {"state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertCreateMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py index e769b829003c..853d2aeec89b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_security_alert_policies.get( resource_group_name="securityalert-6852", server_name="securityalert-2080", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py index 215bceaae731..b054faa993fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_security_alert_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_security_alert_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSecurityAlertListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSecurityAlertListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py index 826412301918..c6a90240560e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_baselines.create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentBaselineAdd.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py index 3517466acecd..5ba3c39749d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_add_latest.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_baselines.create_or_update( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentBaselineAddLatest.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py index 3aa64fa602b3..ce2037e8ef39 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_baselines.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index 7977422d1fc4..9564d5fcce1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py index edb8abff1a3d..76e0d858c41c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessments_settings.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py index 9bb2f6eda378..6a41df51fce9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessments_settings.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py index e18bab380d39..1d3ef5513f9e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_list_scans_results.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_scan_result.list_by_scan( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py index 15a36404b464..75a340989426 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_rule_baselines.create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py index 1b1d6cffe023..ab062b75969b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.database_sql_vulnerability_assessment_rule_baselines.delete( @@ -41,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py index a5e86faf456a..158f56cdc3d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_rule_baselines.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index 9d0ebd9a22d8..ca222727d970 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py index 2e2d8c01d298..a7727bd3cd38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_scans.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScan.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py index ad7960e28389..ab59898ad13f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scan_records_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py index 7b6932a3e9c8..632b7145fa46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_execute.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.database_sql_vulnerability_assessment_execute_scan.begin_execute( + response = client.database_sql_vulnerability_assessment_execute_scan.begin_execute( resource_group_name="vulnerabilityassessmenttest-4711", server_name="vulnerabilityassessmenttest-6411", database_name="testdb", vulnerability_assessment_name="default", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py index bb167473743b..d7c2371054dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_sql_vulnerability_assessment_scans_results.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_sql_vulnerability_assessment_scan_result.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseSqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: 2025-02-01-preview/DatabaseSqlVulnerabilityAssessmentScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py index d9769afed6d9..32e0cd61af00 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_tables.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseTableGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseTableGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py index ddce9b9e3435..ba97759f0ced 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_table_list_by_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_tables.list_by_schema( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseTableListBySchema.json +# x-ms-original-file: 2025-02-01-preview/DatabaseTableListBySchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py index 16561122696d..81228445727f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_container_sas_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessments.create_or_update( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py index 7272c7af7572..23a34d5e1fed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessments.create_or_update( @@ -52,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py index f3d32d2a4242..443f9dd4bc9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_create_storage_access_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessments.create_or_update( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py index 747d089e0a1a..75750e8b939f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.database_vulnerability_assessments.delete( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentDelete.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py index 340f497169a6..a9634754c229 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessments.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py index 3eeaf8d6b231..a086065428a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessments.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py index 357084d61faa..d2cf175a25ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessment_rule_baselines.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py index eaab234ea798..72fd7a89a9a9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.database_vulnerability_assessment_rule_baselines.delete( @@ -41,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py index 2fb2880e22af..d47eae218c1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_rule_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessment_rule_baselines.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py index aa6c18f188ff..cc5b6aaa8a97 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_export.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessment_scans.export( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanExport.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentScanExport.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py index e1b569d89437..98c163a66b16 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessment_scans.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentScanRecordsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py index 46965b25fc52..a2a78f8ff1f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scan_records_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_vulnerability_assessment_scans.list_by_database( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py index e8af3fe4c4a1..dd11e0f8e40f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/database_vulnerability_assessment_scans_execute.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.database_vulnerability_assessment_scans.begin_initiate_scan( + response = client.database_vulnerability_assessment_scans.begin_initiate_scan( resource_group_name="vulnerabilityassessmenttest-4711", server_name="vulnerabilityassessmenttest-6411", database_name="testdb", vulnerability_assessment_name="default", scan_id="scan01", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DatabaseVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: 2025-02-01-preview/DatabaseVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py index ab1d4f3dccb6..19228acaaf78 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.databases.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteDatabase.json +# x-ms-original-file: 2025-02-01-preview/DeleteDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py index 94620e563a9a..cc8e9517ceae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_instance_pool.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.instance_pools.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteInstancePool.json +# x-ms-original-file: 2025-02-01-preview/DeleteInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py index f8913c103425..9e1cc729630d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.jobs.delete( @@ -38,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJob.json +# x-ms-original-file: 2025-02-01-preview/DeleteJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py index 072c73a274fd..edc24b8fef4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_agents.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobAgent.json +# x-ms-original-file: 2025-02-01-preview/DeleteJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py index e8e59a0e503e..1e2723aaa671 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_credential.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_credentials.delete( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobCredential.json +# x-ms-original-file: 2025-02-01-preview/DeleteJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py index 54ec50ffb70b..07c84ee2fad2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_private_endpoint.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_private_endpoints.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobPrivateEndpoint.json +# x-ms-original-file: 2025-02-01-preview/DeleteJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py index 24a1bd96f7ca..db0de09a498a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_step.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_steps.delete( @@ -39,6 +39,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobStep.json +# x-ms-original-file: 2025-02-01-preview/DeleteJobStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py index 31c3cdf63867..e7c4763b2ea8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_job_target_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.job_target_groups.delete( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteJobTargetGroup.json +# x-ms-original-file: 2025-02-01-preview/DeleteJobTargetGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py index 8495808e150b..c9970cc3825d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_classifier.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.workload_classifiers.begin_delete( @@ -40,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteWorkloadClassifier.json +# x-ms-original-file: 2025-02-01-preview/DeleteWorkloadClassifier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py index a125477e22d7..612f0a0ab61e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/delete_workload_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.workload_groups.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeleteWorkloadGroup.json +# x-ms-original-file: 2025-02-01-preview/DeleteWorkloadGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py index b5a87347483f..524c65d2810b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.deleted_servers.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerGet.json +# x-ms-original-file: 2025-02-01-preview/DeletedServerGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py index 8c0394be1045..fa58b6231ea0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.deleted_servers.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerList.json +# x-ms-original-file: 2025-02-01-preview/DeletedServerList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py index f92e8058fa94..26dad5dceed3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_list_by_subscription.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.deleted_servers.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerListBySubscription.json +# x-ms-original-file: 2025-02-01-preview/DeletedServerListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py index 4a1533ee9e86..1b6b2a8b0567 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/deleted_server_recover.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.deleted_servers.begin_recover( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DeletedServerRecover.json +# x-ms-original-file: 2025-02-01-preview/DeletedServerRecover.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/distributed_availability_groups_create_max.py index b34b496f4d65..74b9c6465b54 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsCreateMax.json if __name__ == "__main__": main() 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_min.py index c6450ffcad55..cf944f080329 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_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.begin_create_or_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsCreateMin.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 2ee8e2bdf02c..12d68d56cc4f 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.distributed_availability_groups.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsDelete.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsDelete.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/distributed_availability_groups_failover.py index ba2b3e53fc76..85886d1456d8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_failover.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.begin_failover( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsFailover.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsFailover.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 a8847917f08f..f32d5ba74e7f 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsGet.json +# x-ms-original-file: 2025-02-01-preview/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 02bb431c93d0..73190d545e3b 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsListByInstance.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsListByInstance.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/distributed_availability_groups_set_role.py index 12f78dce2516..0a68685ed7a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/distributed_availability_groups_set_role.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.begin_set_role( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsSetRole.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsSetRole.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 663a9b43fbed..7b6a585bf346 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.distributed_availability_groups.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/DistributedAvailabilityGroupsUpdate.json +# x-ms-original-file: 2025-02-01-preview/DistributedAvailabilityGroupsUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py index 156f2317f732..93e2a864ae10 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -44,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py index 73e0cf0ff410..2fa7b6592cff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py index bac7668eaec0..928fb76cad8b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_serverless_properties.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateServerlessProperties.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateOrUpdateServerlessProperties.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py index 5d5a66420810..208e875bebd3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_or_update_set_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateOrUpdateSetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py index 7d9a69d44bf7..ea664d23f95b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_default_preferred_enclave_type.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -44,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithDefaultPreferredEnclaveType.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateWithDefaultPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py index 63a72c072cc5..696848be53cb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_create_with_vbs_preferred_enclave_type.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -44,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolCreateWithVBSPreferredEnclaveType.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolCreateWithVBSPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py index aba8e4ab4cf3..297b63907792 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.elastic_pools.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolDelete.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py index 5b793a22653a..7fb44fb63671 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGet.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py index d58876610bd4..434f6ab6c25c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_get_with_preferred_enclave_type.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolGetWithPreferredEnclaveType.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolGetWithPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py index 5ce84a1c1194..d3774a2b1cab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolListByServer.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py index 81e196240a70..54fa680f6c58 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_assign_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateAssignMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py index 8ae60b6eba87..dfb55504bbe5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py index 59c926f8d36a..87b0098d6518 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -36,23 +35,26 @@ def main(): server_name="sqlcrudtest-8069", elastic_pool_name="sqlcrudtest-8102", parameters={ - "autoPauseDelay": 0, - "availabilityZone": "str", - "highAvailabilityReplicaCount": 0, - "licenseType": "str", - "maintenanceConfigurationId": "str", - "maxSizeBytes": 0, - "minCapacity": 0.0, - "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, - "preferredEnclaveType": "str", + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "zoneRedundant": bool, + }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, - "zoneRedundant": bool, }, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py index 8180be2538f4..2a7e8c0e3a77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_reset_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateResetMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateResetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py index 681ac1234f3c..1d01a6065f64 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_serverless_properties.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateServerlessProperties.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateServerlessProperties.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py index fc629b4b5c64..7a2a50d1695f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_default_preferred_enclave_type.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateWithDefaultPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py index ad54c3b6b8a6..84b75ec3de5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/elastic_pool_update_with_vbs_preferred_enclave_type.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ElasticPoolUpdateWithVBSPreferredEnclaveType.json +# x-ms-original-file: 2025-02-01-preview/ElasticPoolUpdateWithVBSPreferredEnclaveType.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py index 814ae1d59230..8745658a46a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.encryption_protectors.begin_create_or_update( + client.encryption_protectors.begin_create_or_update( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", encryption_protector_name="current", @@ -43,9 +42,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateKeyVault.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorCreateOrUpdateKeyVault.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py index 70aa2646255a..6a897a7440c6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_key_vault_with_versionless_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.encryption_protectors.begin_create_or_update( + client.encryption_protectors.begin_create_or_update( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", encryption_protector_name="current", @@ -43,9 +42,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateKeyVaultWithVersionlessKey.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorCreateOrUpdateKeyVaultWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py index 260fdd46cf12..1c9ab1372b29 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_create_or_update_service_managed.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.encryption_protectors.begin_create_or_update( + client.encryption_protectors.begin_create_or_update( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", encryption_protector_name="current", parameters={"properties": {"serverKeyName": "ServiceManaged", "serverKeyType": "ServiceManaged"}}, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorCreateOrUpdateServiceManaged.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorCreateOrUpdateServiceManaged.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py index e67506cd42b8..98d5a455b11c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.encryption_protectors.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorGet.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py index a8d6ed811897..05bee4c9cb2e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_get_with_versionless_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.encryption_protectors.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorGetWithVersionlessKey.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorGetWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py index 338deecef5b0..71de8ec7ca40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.encryption_protectors.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorList.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py index 313d1edf8e71..5bbf686a34e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/encryption_protector_revalidate.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.encryption_protectors.begin_revalidate( + response = client.encryption_protectors.begin_revalidate( resource_group_name="sqlcrudtest-7398", server_name="sqlcrudtest-4645", encryption_protector_name="current", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EncryptionProtectorRevalidate.json +# x-ms-original-file: 2025-02-01-preview/EncryptionProtectorRevalidate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py index 09fac71b97d5..db62348b0632 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + subscription_id="SUBSCRIPTION_ID", ) response = client.endpoint_certificates.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EndpointCertificatesGet.json +# x-ms-original-file: 2025-02-01-preview/EndpointCertificatesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py index 6466eb57bb6c..8ccfe84fe8dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/endpoint_certificates_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + subscription_id="SUBSCRIPTION_ID", ) response = client.endpoint_certificates.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/EndpointCertificatesListByInstance.json +# x-ms-original-file: 2025-02-01-preview/EndpointCertificatesListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py index 4584cd712f56..a10e23e6698b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_export( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabase.json +# x-ms-original-file: 2025-02-01-preview/ExportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py index 8d14375f3363..1f410a28116d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="0ca8cd24-0b47-4ad5-bc7e-d70e35c44adf", + subscription_id="SUBSCRIPTION_ID", ) - response = client.database_extensions.begin_create_or_update( + client.database_extensions.begin_create_or_update( resource_group_name="rg_d1ef9eae-044d-4710-ba59-b82e84ad3157", server_name="srv_9243d320-ac4e-4f97-8e06-b1167dae5f4c", database_name="db_7fe424c8-23cf-4ac3-bdc3-e21f424bdb68", @@ -48,9 +48,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseUsingDatabaseExtensions.json +# x-ms-original-file: 2025-02-01-preview/ExportDatabaseUsingDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py index e85ed81e3125..ef799847cbf2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_using_database_extensions_with_managed_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="0ca8cd24-0b47-4ad5-bc7e-d70e35c44adf", + subscription_id="SUBSCRIPTION_ID", ) - response = client.database_extensions.begin_create_or_update( + client.database_extensions.begin_create_or_update( resource_group_name="rg_d1ef9eae-044d-4710-ba59-b82e84ad3157", server_name="srv_9243d320-ac4e-4f97-8e06-b1167dae5f4c", database_name="db_7fe424c8-23cf-4ac3-bdc3-e21f424bdb68", @@ -47,9 +47,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseUsingDatabaseExtensionsWithManagedIdentity.json +# x-ms-original-file: 2025-02-01-preview/ExportDatabaseUsingDatabaseExtensionsWithManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py index 23324b721cfb..8f0aa4fc472c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_managed_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_export( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseWithManagedIdentity.json +# x-ms-original-file: 2025-02-01-preview/ExportDatabaseWithManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py index 07681a1e3fcc..01483a877a25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/export_database_with_network_isolation.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_export( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExportDatabaseWithNetworkIsolation.json +# x-ms-original-file: 2025-02-01-preview/ExportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py index 6f01c70289ce..e92e58e45da3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_azure_monitor_auditing_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={"properties": {"isAzureMonitorTargetEnabled": True, "state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ExtendedDatabaseAzureMonitorAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py index ccf9652884fb..c242b731f65b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,15 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={ "properties": { "auditActionsAndGroups": [ @@ -57,6 +58,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ExtendedDatabaseBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py index 08cbfc577e7b..0513709fd18e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_create_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,15 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_database_blob_auditing_policies.create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", database_name="testdb", + blob_auditing_policy_name="default", parameters={ "properties": { "state": "Enabled", @@ -46,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ExtendedDatabaseBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py index 7ceeae3146c0..fe701c655e27 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_database_blob_auditing_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_database_blob_auditing_policies.get( resource_group_name="blobauditingtest-6852", server_name="blobauditingtest-2080", database_name="testdb", + blob_auditing_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedDatabaseBlobAuditingGet.json +# x-ms-original-file: 2025-02-01-preview/ExtendedDatabaseBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py index 0d9cded720b2..ecb1eecbd317 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,14 +26,15 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.extended_server_blob_auditing_policies.begin_create_or_update( + client.extended_server_blob_auditing_policies.begin_create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", parameters={ "properties": { "auditActionsAndGroups": [ @@ -53,9 +54,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ExtendedServerBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py index 10af521cfeeb..c0526115ec79 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_create_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,14 +26,15 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.extended_server_blob_auditing_policies.begin_create_or_update( + client.extended_server_blob_auditing_policies.begin_create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", parameters={ "properties": { "state": "Enabled", @@ -42,9 +43,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ExtendedServerBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py index df5018fdb561..abff0e1100ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/extended_server_blob_auditing_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_server_blob_auditing_policies.get( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ExtendedServerBlobAuditingGet.json +# x-ms-original-file: 2025-02-01-preview/ExtendedServerBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py index 783fad25643a..47b3dc3c2b21 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.databases.begin_failover( + response = client.databases.begin_failover( resource_group_name="group1", server_name="testServer", database_name="testDatabase", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverDatabase.json +# x-ms-original-file: 2025-02-01-preview/FailoverDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py index 69fe0b46c98b..d1c734685d8b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_elastic_pool.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.elastic_pools.begin_failover( + response = client.elastic_pools.begin_failover( resource_group_name="group1", server_name="testServer", elastic_pool_name="testElasticPool", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverElasticPool.json +# x-ms-original-file: 2025-02-01-preview/FailoverElasticPool.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 9fab257bde09..30a9b5860e27 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_create_or_update( @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/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 index a3639112631f..042fd4becfc7 100644 --- 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_create_or_update( @@ -55,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupCreateOrUpdateStandbySecondary.json +# x-ms-original-file: 2025-02-01-preview/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 b279a48c8c5d..317fb6d9535d 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.failover_groups.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupDelete.json +# x-ms-original-file: 2025-02-01-preview/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 4ab908bff7b1..87044530261d 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_failover( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupFailover.json +# x-ms-original-file: 2025-02-01-preview/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 d591d8da21d2..1d1ed95768b5 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_force_failover_allow_data_loss( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: 2025-02-01-preview/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 79d286b7c741..106f0100e95f 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupGet.json +# x-ms-original-file: 2025-02-01-preview/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 9b16cf6dc607..10b5f75964e8 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupList.json +# x-ms-original-file: 2025-02-01-preview/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 63053c767e3c..658162b9e82d 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_try_planned_before_forced_failover( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupTryPlannedBeforeForcedFailover.json +# x-ms-original-file: 2025-02-01-preview/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 69435c772528..8b412a37ae94 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupUpdate.json +# x-ms-original-file: 2025-02-01-preview/FailoverGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py index 2462755b32a2..55aafc9e1674 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/failover_group_update_standby_secondary.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.failover_groups.begin_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverGroupUpdateStandbySecondary.json +# x-ms-original-file: 2025-02-01-preview/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 266fa6964124..cf50ac763e66 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,17 +25,18 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_instances.begin_failover( + response = client.managed_instances.begin_failover( resource_group_name="group1", managed_instance_name="instanceName", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FailoverManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/FailoverManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py index 598ea00ba9c3..6e9473de6f34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.firewall_rules.create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleCreate.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py index 1ec41e71dfaa..1673813d40a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.firewall_rules.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleDelete.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py index 7bce1c896468..980acf6d4e3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.firewall_rules.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleGet.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py index 635ade3599df..22890255a80e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.firewall_rules.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleList.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py index f425b3492f18..99f63e110e70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_replace.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.firewall_rules.replace( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleReplace.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleReplace.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py index 9e9a591c27bb..fa3e7273bc00 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/firewall_rule_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.firewall_rules.create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/FirewallRuleUpdate.json +# x-ms-original-file: 2025-02-01-preview/FirewallRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py index d163c36c7813..67d3b6812e78 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.geo_backup_policies.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/GeoBackupPoliciesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py index c8f5b84b0901..3e5b403b50c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.geo_backup_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesGet.json +# x-ms-original-file: 2025-02-01-preview/GeoBackupPoliciesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py index b9ceeb6a790b..098a8bb49cc9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/geo_backup_policies_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.geo_backup_policies.list( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GeoBackupPoliciesList.json +# x-ms-original-file: 2025-02-01-preview/GeoBackupPoliciesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py index 9cba9d2522f8..e68db78c83e2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_data_warehouse_user_activities.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_warehouse_user_activities.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDataWarehouseUserActivities.json +# x-ms-original-file: 2025-02-01-preview/GetDataWarehouseUserActivities.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py index e68a85273e6e..ed6c9ce66f69 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_extensions.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="a3473687-7581-41e1-ac24-6bcca5843f07", + subscription_id="SUBSCRIPTION_ID", ) client.database_extensions.get( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseExtensions.json +# x-ms-original-file: 2025-02-01-preview/GetDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py index ddc05024ff0c..2c5c4773bb38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_usages.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_usages.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseUsages.json +# x-ms-original-file: 2025-02-01-preview/GetDatabaseUsages.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py index c29d1d019ef6..319506955bbe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_database_with_availability_zone.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetDatabaseWithAvailabilityZone.json +# x-ms-original-file: 2025-02-01-preview/GetDatabaseWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py index b410efdd1d5b..235bdfef381b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_availability_zone.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithAvailabilityZone.json +# x-ms-original-file: 2025-02-01-preview/GetElasticPoolWithAvailabilityZone.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py index 9b47f437a0d6..12148c8be8f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_elastic_pool_with_serverless_properties.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetElasticPoolWithServerlessProperties.json +# x-ms-original-file: 2025-02-01-preview/GetElasticPoolWithServerlessProperties.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py index 494c5c599706..49bbd1419f43 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetInstancePool.json +# x-ms-original-file: 2025-02-01-preview/GetInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py index 577e6c27295e..608b97a912ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_instance_pool_operation.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pool_operations.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetInstancePoolOperation.json +# x-ms-original-file: 2025-02-01-preview/GetInstancePoolOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py index 5a9dcf38c5fa..b2173ffbdd10 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.get( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJob.json +# x-ms-original-file: 2025-02-01-preview/GetJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py index dc182e27d1ff..8d5395abec50 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_agent.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobAgent.json +# x-ms-original-file: 2025-02-01-preview/GetJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py index f3b2242d9ac2..c3944dc10ee6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_credential.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_credentials.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobCredential.json +# x-ms-original-file: 2025-02-01-preview/GetJobCredential.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py index 729bc29790a2..acaeb53bd08a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecution.json +# x-ms-original-file: 2025-02-01-preview/GetJobExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py index d6c2492d1c47..1ca5ea38ac08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_step.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_step_executions.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecutionStep.json +# x-ms-original-file: 2025-02-01-preview/GetJobExecutionStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py index 6c971082f949..b7e6a35e69a7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_execution_target.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_executions.get( @@ -43,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobExecutionTarget.json +# x-ms-original-file: 2025-02-01-preview/GetJobExecutionTarget.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py index aa060bb87fcb..ab33c4add4f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_private_endpoint.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_private_endpoints.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobPrivateEndpoint.json +# x-ms-original-file: 2025-02-01-preview/GetJobPrivateEndpoint.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py index ed95acc80fb6..3942053fd4e4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_job.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobStepByJob.json +# x-ms-original-file: 2025-02-01-preview/GetJobStepByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py index f870e790cd2f..32e0b9109bd9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_step_by_version.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.get_by_version( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobStepByVersion.json +# x-ms-original-file: 2025-02-01-preview/GetJobStepByVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py index daaff152c7b6..a016ee677b2b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_target_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_groups.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobTargetGroup.json +# x-ms-original-file: 2025-02-01-preview/GetJobTargetGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py index b2a0fd11bf32..a7ce90492ec9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_job_version.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_versions.get( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetJobVersion.json +# x-ms-original-file: 2025-02-01-preview/GetJobVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py index f6ca3c8c15d3..672e93431007 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_backup_short_term_retention_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetListManagedShortTermRetentionPolicy.json +# x-ms-original-file: 2025-02-01-preview/GetListManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py index 0c7ea9448957..8c39e9019a29 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_list_managed_short_term_retention_policy_restorable_dropped.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: 2025-02-01-preview/GetListManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py index e32c51919bdd..50be19878373 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_window_options.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.maintenance_window_options.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetMaintenanceWindowOptions.json +# x-ms-original-file: 2025-02-01-preview/GetMaintenanceWindowOptions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py index 2212c9513222..acfd69437a52 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_maintenance_windows.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.maintenance_windows.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetMaintenanceWindows.json +# x-ms-original-file: 2025-02-01-preview/GetMaintenanceWindows.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py index e24ef093b5e3..0258035b4e70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_instance_operation.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_operations.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedInstanceOperation.json +# x-ms-original-file: 2025-02-01-preview/GetManagedInstanceOperation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py index aa1d48e2afd0..c33c2125cc3c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_backup_short_term_retention_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedShortTermRetentionPolicy.json +# x-ms-original-file: 2025-02-01-preview/GetManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py index 7ccb89e6d649..cf07abe952b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_managed_short_term_retention_policy_restorable_dropped.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: 2025-02-01-preview/GetManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py index 3bfec38901d4..7355342a7c5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_recoverable_managed_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.recoverable_managed_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRecoverableManagedDatabase.json +# x-ms-original-file: 2025-02-01-preview/GetRecoverableManagedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py index 7314215e3eaf..b3bc14000c61 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restorable_dropped_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedDatabase.json +# x-ms-original-file: 2025-02-01-preview/GetRestorableDroppedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py index 8a2bd735565f..2774ae810db8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_database_with_expand_equals_keys.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restorable_dropped_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json +# x-ms-original-file: 2025-02-01-preview/GetRestorableDroppedDatabaseWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py index 95f39dd280ff..66a3a1d59010 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_restorable_dropped_managed_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restorable_dropped_managed_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetRestorableDroppedManagedDatabase.json +# x-ms-original-file: 2025-02-01-preview/GetRestorableDroppedManagedDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py index 55f402bec959..8e31342b341b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_short_term_retention_policy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.backup_short_term_retention_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetShortTermRetentionPolicy.json +# x-ms-original-file: 2025-02-01-preview/GetShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py index 8754756e2c69..6561b1f1c923 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabase.json +# x-ms-original-file: 2025-02-01-preview/GetVCoreDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py index 769fcf71179f..39176cb9aeb7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_default_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseDefaultEnclave.json +# x-ms-original-file: 2025-02-01-preview/GetVCoreDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py index 4ad01341d570..043eef68196a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_vbs_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseVBSEnclave.json +# x-ms-original-file: 2025-02-01-preview/GetVCoreDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py index a4faa0a24d07..df5f7652be11 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseWithExpandEqualsKeys.json +# x-ms-original-file: 2025-02-01-preview/GetVCoreDatabaseWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py index b0be4aa03bb2..a15009a9693b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_vcore_database_with_expand_equals_keys_with_versionless_keys.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetVCoreDatabaseWithExpandEqualsKeysWithVersionlessKeys.json +# x-ms-original-file: 2025-02-01-preview/GetVCoreDatabaseWithExpandEqualsKeysWithVersionlessKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py index 267d206fa854..f9e85336c57f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_classifiers.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadClassifier.json +# x-ms-original-file: 2025-02-01-preview/GetWorkloadClassifier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py index 6c6142a60fe2..686aa99247ed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_classifier_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_classifiers.list_by_workload_group( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadClassifierList.json +# x-ms-original-file: 2025-02-01-preview/GetWorkloadClassifierList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py index 54451e5b706b..582404310813 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_groups.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadGroup.json +# x-ms-original-file: 2025-02-01-preview/GetWorkloadGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py index 4737ebf33877..28c13943483e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/get_workload_group_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.workload_groups.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/GetWorkloadGroupList.json +# x-ms-original-file: 2025-02-01-preview/GetWorkloadGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py index 25a6051dec7d..33f4db8e63d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_create_or_update_set_high_availability_replica_count.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_create_or_update( @@ -44,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json +# x-ms-original-file: 2025-02-01-preview/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py index a5d68308dcb0..ffb5c728b173 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolGet.json +# x-ms-original-file: 2025-02-01-preview/HyperscaleElasticPoolGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py index 21b712b298a4..e17d0fe8c3f2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/hyperscale_elastic_pool_update_set_high_availability_replica_count.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pools.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json +# x-ms-original-file: 2025-02-01-preview/HyperscaleElasticPoolUpdateSetHighAvailabilityReplicaCount.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py index 952bc4d4b5ea..51ed0b9f927f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_import_method( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabase.json +# x-ms-original-file: 2025-02-01-preview/ImportDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py index b640426a71f2..2d74a837fd65 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_using_database_extensions.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="17ca4d13-bf7d-4c33-a60e-b87a2820a325", + subscription_id="SUBSCRIPTION_ID", ) - response = client.database_extensions.begin_create_or_update( + client.database_extensions.begin_create_or_update( resource_group_name="rg_062866bf-c4f4-41f9-abf0-b59132ca7924", server_name="srv_2d6be2d2-26c8-4930-8fb6-82a5e95e0e82", database_name="db_2a47e946-e414-4c00-94ac-ed886bb78302", @@ -48,9 +48,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseUsingDatabaseExtensions.json +# x-ms-original-file: 2025-02-01-preview/ImportDatabaseUsingDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py index 4cf9c71108df..07d7980ce61e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_managed_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_import_method( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseWithManagedIdentity.json +# x-ms-original-file: 2025-02-01-preview/ImportDatabaseWithManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py index beaa302b2971..20ec0f68a012 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_database_with_network_isolation.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_import_method( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportDatabaseWithNetworkIsolation.json +# x-ms-original-file: 2025-02-01-preview/ImportDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py index 62afcf3c3f49..42d27323ea34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_import_database( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabase.json +# x-ms-original-file: 2025-02-01-preview/ImportNewDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py index 23071d3c512f..97c8c770b056 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_managed_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_import_database( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabaseWithManagedIdentity.json +# x-ms-original-file: 2025-02-01-preview/ImportNewDatabaseWithManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py index a5d3717d1c08..cf1c686bccef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/import_new_database_with_network_isolation.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_import_database( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ImportNewDatabaseWithNetworkIsolation.json +# x-ms-original-file: 2025-02-01-preview/ImportNewDatabaseWithNetworkIsolation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py index 6466a4b62790..2b5dbc4a0a84 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/inaccessible_managed_database_list_by_managed_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.list_inaccessible_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InaccessibleManagedDatabaseListByManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/InaccessibleManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py index 7d6eb9816546..aefd66b09070 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_create_or_update.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_failover_groups.begin_create_or_update( @@ -53,6 +53,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py index 43025fea6b77..f00ba2ace903 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.instance_failover_groups.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupDelete.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py index 2973e56cec97..11dd772ab010 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_failover.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_failover_groups.begin_failover( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupFailover.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupFailover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py index 10841706ba11..e0ef8cab5c0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_force_failover_allow_data_loss.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_failover_groups.begin_force_failover_allow_data_loss( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupForceFailoverAllowDataLoss.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py index 05785ba81deb..3f20cde5a41b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_failover_groups.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupGet.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py index c1b83fc0fe8c..89860da3429c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/instance_failover_group_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_failover_groups.list_by_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/InstanceFailoverGroupList.json +# x-ms-original-file: 2025-02-01-preview/InstanceFailoverGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py index de8a6d977647..1ec70943385b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ipv6_firewall_rules.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleCreate.json +# x-ms-original-file: 2025-02-01-preview/IPv6FirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py index b8c6bf3f7e55..90dcc934ec4f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.ipv6_firewall_rules.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleDelete.json +# x-ms-original-file: 2025-02-01-preview/IPv6FirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py index 465968c1535b..bcd4ba70f6b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ipv6_firewall_rules.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleGet.json +# x-ms-original-file: 2025-02-01-preview/IPv6FirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py index 47c7e1f583d6..88b5861abee9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ipv6_firewall_rules.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleList.json +# x-ms-original-file: 2025-02-01-preview/IPv6FirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py index 86261d98a90e..46f2ebe2ae30 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ipv6_firewall_rule_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ipv6_firewall_rules.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/IPv6FirewallRuleUpdate.json +# x-ms-original-file: 2025-02-01-preview/IPv6FirewallRuleUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py index 8142ef3108c1..a9250420b3ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_disable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ledger_digest_uploads.begin_disable( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsDisable.json +# x-ms-original-file: 2025-02-01-preview/LedgerDigestUploadsDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py index 2eeb7383c648..143212e14610 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_enable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,21 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.ledger_digest_uploads.begin_create_or_update( + client.ledger_digest_uploads.begin_create_or_update( resource_group_name="ledgertestrg", server_name="ledgertestserver", database_name="testdb", ledger_digest_uploads="current", parameters={"properties": {"digestStorageEndpoint": "https://MyAccount.blob.core.windows.net"}}, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsEnable.json +# x-ms-original-file: 2025-02-01-preview/LedgerDigestUploadsEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py index 39b5046019ce..5335d5a6da57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ledger_digest_uploads.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsGet.json +# x-ms-original-file: 2025-02-01-preview/LedgerDigestUploadsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py index 24a9768a369d..fbaaeb892bb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/ledger_digest_uploads_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.ledger_digest_uploads.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LedgerDigestUploadsList.json +# x-ms-original-file: 2025-02-01-preview/LedgerDigestUploadsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py index f16a06184b34..35673b931bef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_data_warehouse_user_activities.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.data_warehouse_user_activities.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDataWarehouseUserActivities.json +# x-ms-original-file: 2025-02-01-preview/ListDataWarehouseUserActivities.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py index f37c051560ca..eb8eb0de457c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_extensions.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="7b2515fe-f230-4017-8cf0-695163acab85", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_extensions.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabaseExtensions.json +# x-ms-original-file: 2025-02-01-preview/ListDatabaseExtensions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py index 79f6eb620720..4b81f7762424 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_database_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,13 +25,13 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.database_operations.list_by_database( - resource_group_name="sqlcrudtestgroup", + resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdb", ) @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabaseOperations.json +# x-ms-original-file: 2025-02-01-preview/ListDatabaseOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py index 729478eb9d04..a5b29cb96b7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_databases_by_elastic_pool.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,13 +25,13 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.list_by_elastic_pool( - resource_group_name="sqlcrudtestgroup", + resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", elastic_pool_name="pool1", ) @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListDatabasesByElasticPool.json +# x-ms-original-file: 2025-02-01-preview/ListDatabasesByElasticPool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py index aff1827be35a..ecfd5732e26a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_elastic_pool_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.elastic_pool_operations.list_by_elastic_pool( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListElasticPoolOperations.json +# x-ms-original-file: 2025-02-01-preview/ListElasticPoolOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py index 410422f625a8..bcf73bb79325 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pool_operations.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolOperations.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py index f0dbdb76c164..2c86f65fd3fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_operations_empty.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pool_operations.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolOperationsEmpty.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolOperationsEmpty.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py index e295c72d2d80..112c144df3f0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.usages.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolUsage.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolUsage.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py index dfb77479dd46..b6210de8b161 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pool_usage_expanded.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.usages.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolUsageExpanded.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolUsageExpanded.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py index d6e4d3bc7f89..c4174c682374 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_resource_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolsByResourceGroup.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolsByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py index dce7b5c46e40..7b14a3bedb99 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_instance_pools_by_subscription_id.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListInstancePoolsBySubscriptionId.json +# x-ms-original-file: 2025-02-01-preview/ListInstancePoolsBySubscriptionId.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py index c9684d4654d0..f71ad6595cfe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_agents_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobAgentsByServer.json +# x-ms-original-file: 2025-02-01-preview/ListJobAgentsByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py index 4fdc5e08e6d6..7edb12458a40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_credentials_by_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_credentials.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobCredentialsByAgent.json +# x-ms-original-file: 2025-02-01-preview/ListJobCredentialsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py index 6af754cc73a8..08c4ec989dfb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_steps.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_step_executions.list_by_job_execution( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionSteps.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionSteps.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py index 5e918ec53d3f..5beb09d7635d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_execution.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_executions.list_by_job_execution( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionTargetsByExecution.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionTargetsByExecution.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py index 5d0e4d50ad25..2b377e581ab6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_execution_targets_by_step.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_executions.list_by_step( @@ -43,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionTargetsByStep.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionTargetsByStep.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py index 80d5cd1e3d4d..789255bd4245 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByAgent.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py index 54d542546a2b..235c4509a0be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_agent_with_filter.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByAgentWithFilter.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionsByAgentWithFilter.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py index 7ec2a94c97be..bc92a8c92081 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_executions_by_job.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_executions.list_by_job( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobExecutionsByJob.json +# x-ms-original-file: 2025-02-01-preview/ListJobExecutionsByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py index a19664e79185..22476fbdbd79 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_private_endpoints_by_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_private_endpoints.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobPrivateEndpointsByAgent.json +# x-ms-original-file: 2025-02-01-preview/ListJobPrivateEndpointsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py index 4b8319c00cea..6537cfdc2311 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_job.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.list_by_job( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobStepsByJob.json +# x-ms-original-file: 2025-02-01-preview/ListJobStepsByJob.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py index bc567b2856a7..13aed5dccf9b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_steps_by_version.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_steps.list_by_version( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobStepsByVersion.json +# x-ms-original-file: 2025-02-01-preview/ListJobStepsByVersion.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py index 7e3832cbd438..73e3f18528cb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_target_groups.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_target_groups.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobTargetGroups.json +# x-ms-original-file: 2025-02-01-preview/ListJobTargetGroups.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py index cd9cf4f1a99d..4d70996349e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_job_versions.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_versions.list_by_job( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobVersions.json +# x-ms-original-file: 2025-02-01-preview/ListJobVersions.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py index daee34f8220c..c32ad8c1d7bd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_jobs_by_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.jobs.list_by_agent( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListJobsByAgent.json +# x-ms-original-file: 2025-02-01-preview/ListJobsByAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py index a9001786cc05..4cd7cd5875d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_managed_instance_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_operations.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListManagedInstanceOperations.json +# x-ms-original-file: 2025-02-01-preview/ListManagedInstanceOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py index 80a40146126e..4d87477d3514 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,7 +25,7 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), subscription_id="SUBSCRIPTION_ID", ) @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListOperations.json +# x-ms-original-file: 2025-02-01-preview/ListOperations.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 9345ceb12d7a..b4a430c6dba8 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="20d7082a-0fc7-4468-82bd-542694d5042b", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_outbound_network_dependencies_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListOutboundNetworkDependenciesByManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/ListOutboundNetworkDependenciesByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py index a3f35485b781..4c0d0d597aa6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_recoverable_managed_databases_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.recoverable_managed_databases.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListRecoverableManagedDatabasesByServer.json +# x-ms-original-file: 2025-02-01-preview/ListRecoverableManagedDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py index e441a284cb18..5f930cf63b79 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_restorable_dropped_databases_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restorable_dropped_databases.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListRestorableDroppedDatabasesByServer.json +# x-ms-original-file: 2025-02-01-preview/ListRestorableDroppedDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py index 5b121bc07f07..97fbb25d8023 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_server_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_operations.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListServerOperations.json +# x-ms-original-file: 2025-02-01-preview/ListServerOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py index b8e69660f174..88952245515d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_short_term_retention_policies_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.backup_short_term_retention_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListShortTermRetentionPoliciesByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ListShortTermRetentionPoliciesByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py index 45ad9f0de003..f16a85f934f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreDatabasesByServer.json +# x-ms-original-file: 2025-02-01-preview/ListVCoreDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server_with_odata.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server_with_odata.py new file mode 100644 index 000000000000..78f87f5bec71 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_by_server_with_odata.py @@ -0,0 +1,43 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python list_vcore_databases_by_server_with_odata.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.databases.list_by_server( + resource_group_name="Default-SQL-SouthEastAsia", + server_name="testsvr", + ) + for item in response: + print(item) + + +# x-ms-original-file: 2025-02-01-preview/ListVCoreDatabasesByServerWithOdata.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py index 2aeafe2f0760..d88496d6116c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_databases_enclave_type_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreDatabasesEnclaveTypeByServer.json +# x-ms-original-file: 2025-02-01-preview/ListVCoreDatabasesEnclaveTypeByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py index 8214c976eb03..177b496c597b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/list_vcore_inaccessible_databases_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.list_inaccessible_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ListVCoreInaccessibleDatabasesByServer.json +# x-ms-original-file: 2025-02-01-preview/ListVCoreInaccessibleDatabasesByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py index 6f68f717818f..dec69bc0ed11 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/location_capability_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.capabilities.list_by_location( @@ -37,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LocationCapabilityListByLocation.json +# x-ms-original-file: 2025-02-01-preview/LocationCapabilityListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py index d8e976621a03..45dd92655336 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/lock_time_based_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_lock_time_based_immutability( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LockTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/LockTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py index b27f29fd2e91..14801a123fc8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_copy.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_copy( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupCopy.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupCopy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py index a65a3afc8421..008fca429b1e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.long_term_retention_backups.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupDelete.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py index 0896cacec82b..33ec00d6b663 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupGet.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py index 877bb5af8cbc..36b43778d745 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py index 3e1ed0520912..c7453418feb8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByLocation.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py index bf1f3feb880c..f598e61859c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupListByServer.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py index 6b3d3e4166c4..79eaee6a7f08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_backup_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionBackupUpdate.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionBackupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py index 8571f48fe62d..6afbe02d9f76 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.long_term_retention_policies.begin_create_or_update( + client.long_term_retention_policies.begin_create_or_update( resource_group_name="resourceGroup", server_name="testserver", database_name="testDatabase", @@ -47,9 +46,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionPolicyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py index 71392ff30ea1..c64ebd0ff069 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyGet.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py index dab8e9534455..9e6d0e16691a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/long_term_retention_policy_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/LongTermRetentionPolicyListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/LongTermRetentionPolicyListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py index 7c665ca91dc1..d894970aab5a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_columns.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedColumnsListByDatabaseMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedColumnsListByDatabaseMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py index 1b03e192bd88..85c37446d889 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_columns_list_by_database_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_columns.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedColumnsListByDatabaseMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedColumnsListByDatabaseMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py index 052f74aaa39e..5ca00c76120d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_advanced_threat_protection_settings.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py index d73bdd450a67..3d0d78d5c8d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_advanced_threat_protection_settings.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py index c7190b29d3d5..57fdf735fd64 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_advanced_threat_protection_settings.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py index 0862d789e600..99c7ce0bb8ff 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_advanced_threat_protection_settings_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_advanced_threat_protection_settings.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseAdvancedThreatProtectionSettingsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py index 729f5b4fc7f4..4e05721f3b94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_cancel_move.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_databases.begin_cancel_move( + response = client.managed_databases.begin_cancel_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -39,8 +39,9 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCancelMove.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCancelMove.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py index f4ce12235156..98be8962d11f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_columns.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseColumnGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py index 4597a89bbca0..95bb5d93469a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_list_by_table.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_columns.list_by_table( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnListByTable.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseColumnListByTable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py index e2fc8f690f01..6ae2229b154b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_sensitivity_labels.create_or_update( @@ -38,6 +37,7 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="current", parameters={ "properties": { "clientClassificationSource": "Native", @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelCreate.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseColumnSensitivityLabelCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py index 7c7530ba0423..3382573e68f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_sensitivity_labels.delete( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="current", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseColumnSensitivityLabelDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py index 14ed1dffa3f2..3f11154776aa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_column_sensitivity_label_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_sensitivity_labels.get( @@ -43,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseColumnSensitivityLabelGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseColumnSensitivityLabelGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py index 215047c617c9..97a9eb036a20 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_external_restore.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_databases.begin_complete_restore( + response = client.managed_databases.begin_complete_restore( resource_group_name="myRG", managed_instance_name="myManagedInstanceName", database_name="myDatabase", parameters={"lastBackupName": "testdb1_log4"}, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCompleteExternalRestore.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCompleteExternalRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py index fa4ec72f93d8..eec4ee477adf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_complete_move.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_databases.begin_complete_move( + response = client.managed_databases.begin_complete_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -39,8 +39,9 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCompleteMove.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCompleteMove.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py index 506d9da441a8..dd559254b369 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_cross_subscription_point_in_time_restore.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateCrossSubscriptionPointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py index dc94af96f5ad..862e73f5c7d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py index 07b02beb7e33..4b5c33bffb0d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py index fc39dcd699cd..c6b07127e3c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_point_in_time_restore.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreatePointInTimeRestore.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreatePointInTimeRestore.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py index b407f0abefb8..05a3994a291a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_recovery.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRecovery.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateRecovery.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py index 9ffd0100e8d7..f4c1762aa848 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreExternalBackup.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateRestoreExternalBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py index ecfc1d240773..4c0d6ba8c1fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_external_backup_managed_identity.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -50,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateRestoreExternalBackupManagedIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py index a169e75207aa..85c89d590db7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_create_restore_ltr_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseCreateRestoreLtrBackup.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseCreateRestoreLtrBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py index e273db8c9a20..024a648a38a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_databases.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py index 1bbe9a99281b..710098d434fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py index 7009c7f07cf1..7e70bb746326 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_list_by_managed_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseListByManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py index c333636472f4..737dcb034089 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_move_operations.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseMoveOperationResultGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py index 2e67ee9341c2..2693ee015847 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_move_operations.list_by_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultList.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseMoveOperationResultList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py index dafa8c09efe9..c81c20af17f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_last_operations.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_move_operations.list_by_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultListLastOperations.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseMoveOperationResultListLastOperations.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py index 8d94fa525c8c..bb86eb639bcf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_move_operation_result_list_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_move_operations.list_by_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseMoveOperationResultListMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseMoveOperationResultListMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py index fa7e7dcdef75..7fb0dd1d5421 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_disable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_sensitivity_labels.disable_recommendation( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="recommended", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py index f07c5dd51263..91efdb7b9969 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_recommended_column_sensitivity_label_enable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_sensitivity_labels.enable_recommendation( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="recommended", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py index 3a9064519d93..80e664872899 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_reevaluate_inaccessible_database_state.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_reevaluate_inaccessible_database_state( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseReevaluateInaccessibleDatabaseState.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseReevaluateInaccessibleDatabaseState.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py index cf09445c460b..6f47dce07ecd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_restore_details.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_restore_details.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseRestoreDetails.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseRestoreDetails.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py index 418a13882981..6c0c235b5082 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_schemas.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSchemaGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSchemaGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py index 1114ad5ad1ef..d506e6c3fd33 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_schema_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_schemas.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSchemaListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSchemaListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py index 78f7596a01a0..f86325c46562 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,16 +26,16 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_alert_policies.create_or_update( resource_group_name="securityalert-4799", managed_instance_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", parameters={ "properties": { "disabledAlerts": ["Sql_Injection", "Usage_Anomaly"], @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py index 3fa2e45d892d..314aaa7aec1d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,21 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_alert_policies.create_or_update( resource_group_name="securityalert-4799", managed_instance_name="securityalert-6440", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", parameters={"properties": {"state": "Enabled"}}, ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py index 98458e0b22b7..ea11329051c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_alert_policies.get( resource_group_name="securityalert-6852", managed_instance_name="securityalert-2080", database_name="testdb", - security_alert_policy_name="default", + security_alert_policy_name="Default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py index 6117a368ffdf..5d9f3fb9960c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_alert_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_alert_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityAlertListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityAlertListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py index cc510630f93d..2f1f0253aab5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_events.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityEventsGetMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityEventsGetMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py index ea2357d90353..c31848b85d86 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_security_events_get_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_security_events.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSecurityEventsGetMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSecurityEventsGetMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py index f9092f2c52c7..68da0fdd739a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_current_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_sensitivity_labels.update( @@ -75,6 +74,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSensitivityLabelsCurrentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py index 1549b4f7a79b..36870b00a191 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_sensitivity_labels.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSensitivityLabelsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py index e0b4302f4c3c..0c95505d246b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_current.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_sensitivity_labels.list_current_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py index 1a48482d1cd8..30fe1a00fef1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_list_by_database_recommended.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_sensitivity_labels.list_recommended_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py index 2b91bb91c846..c0f038af0a2c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_sensitivity_labels_recommended_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_recommended_sensitivity_labels.update( @@ -45,6 +44,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py index 82025217723a..cd5971b0dcee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_databases.begin_start_move( + response = client.managed_databases.begin_start_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -40,8 +40,9 @@ def main(): "operationMode": "Copy", }, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseStartMoveMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseStartMoveMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py index 3d810ea8b6ef..fb56c81c6700 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_start_move_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +26,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_databases.begin_start_move( + response = client.managed_databases.begin_start_move( resource_group_name="group1", managed_instance_name="testInstanceSrc", database_name="testDatabase", @@ -39,8 +39,9 @@ def main(): "destinationManagedDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/managedInstances/testInstanceTgt/databases/testDatabase" }, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseStartMoveMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseStartMoveMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py index 79b741db61dc..034a83cb213a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_tables.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseTableGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseTableGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py index 2d20fbe8e17d..e751edccb638 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_table_list_by_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_tables.list_by_schema( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseTableListBySchema.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseTableListBySchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py index d374a0a51b9a..4b17d616d380 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py index 9baa4fa695c7..78097a2bdc98 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_databases.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py index 3790410f0d47..eb7df85dc2c2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessments.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py index 9b73b3d8375e..67836cb8d18f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessments.create_or_update( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py index 859bd50cf83c..2fc29570ca97 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_vulnerability_assessments.delete( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py index 826e34860fc1..715c181b17c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessments.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py index 7eab08d74d09..33820f1ac57f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessments.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py index db8689c63c55..b2d22489b2bb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessment_rule_baselines.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py index 35c7503456cb..008a21f24b7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_database_vulnerability_assessment_rule_baselines.delete( @@ -41,6 +40,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py index 03d9bf5ebc57..8922f012f65a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_rule_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessment_rule_baselines.get( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py index ec00baa73cb5..72c085f2b20f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_export.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessment_scans.export( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentScanExport.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py index 48cb92b1b282..1155154ff40b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessment_scans.get( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py index 704f26ff9e53..55fa9b62f088 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scan_records_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_vulnerability_assessment_scans.list_by_database( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py index 31e07a4f93d5..52ef51d0560c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_database_vulnerability_assessment_scans_execute.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( + response = client.managed_database_vulnerability_assessment_scans.begin_initiate_scan( resource_group_name="vulnerabilityassessmenttest-4711", managed_instance_name="vulnerabilityassessmenttest-6411", database_name="testdb", vulnerability_assessment_name="default", scan_id="scan01", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: 2025-02-01-preview/ManagedDatabaseVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py index 386a86990de7..c90237cf807c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instanc_validate_azure_key_vault_encryption_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_instances.begin_validate_azure_key_vault_encryption_key( + response = client.managed_instances.begin_validate_azure_key_vault_encryption_key( resource_group_name="testrg", managed_instance_name="testinstance", parameters={"tdeKeyUri": "https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"}, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancValidateAzureKeyVaultEncryptionKey.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancValidateAzureKeyVaultEncryptionKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py index 5326fc416e2b..0702ae901085 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_administrators.begin_create_or_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorCreate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdministratorCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py index c30ebfa19ac5..72d4edf947d0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_administrators.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdministratorDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py index 50aedf19ca5e..342550d006be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_administrators.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdministratorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py index 668ac24ed837..a4860b9a5e7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_administrators.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdministratorListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py index e25dbae77faa..69b8e9ebcef0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_administrator_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_administrators.begin_create_or_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdministratorUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdministratorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py index 3f32e4acc1a6..38358597c80b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py index a9b2e1878b0e..c8cfca3ac62a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_advanced_threat_protection_settings.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py index 7d042213a875..428168dc1daa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_advanced_threat_protection_settings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py index 3492f45b52b8..ee3dad120f83 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_advanced_threat_protection_settings_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_advanced_threat_protection_settings.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAdvancedThreatProtectionSettingsListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py index 06428606fa65..be2b3a13885d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_azure_ad_only_authentications.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py index 3a0c99ac1cad..e3a175996563 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_azure_ad_only_authentications.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAzureADOnlyAuthDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py index fec0f76b4817..5b7fff16dd52 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_azure_ad_only_authentications.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAzureADOnlyAuthGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py index a61139957d36..60ccb63896da 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_azure_ad_only_auth_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_azure_ad_only_authentications.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceAzureADOnlyAuthListByInstance.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 466b2ba25278..cec0886c209d 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_create_or_update( @@ -72,6 +72,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceCreateMax.json +# x-ms-original-file: 2025-02-01-preview/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 98153e1246c1..602eefde5f6f 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="20D7082A-0FC7-4468-82BD-542694D5042B", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_create_or_update( @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceCreateMin.json +# x-ms-original-file: 2025-02-01-preview/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 e5ce5874c697..470201ad96f9 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instances.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py index 7895321a0891..ba988d99ad15 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_dtcs.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceDtcGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py index 1a13418150ea..d31c030be618 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_dtcs.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceDtcList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py index 1707f4d5990f..1ad8158a9e3a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_enable_dtc.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_dtcs.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcUpdateEnableDtc.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceDtcUpdateEnableDtc.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py index 6f5baefa296e..f65a8424efe8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_dtc_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_dtcs.begin_create_or_update( @@ -56,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceDtcUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceDtcUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py index ac6092a66b29..3896708cd88e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_key_vault.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_encryption_protectors.begin_create_or_update( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py index 0cc07c5426f8..2d5cd69cd421 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_create_or_update_service_managed.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_encryption_protectors.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceEncryptionProtectorCreateOrUpdateServiceManaged.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py index 4b065b37dd3b..864d89f0b743 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_encryption_protectors.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceEncryptionProtectorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py index 8a71de05f06c..ed7cb214735d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_encryption_protectors.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceEncryptionProtectorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py index 6a754951e1c6..a0b68f97c087 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_encryption_protector_revalidate.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_instance_encryption_protectors.begin_revalidate( + response = client.managed_instance_encryption_protectors.begin_revalidate( resource_group_name="sqlcrudtest-7398", managed_instance_name="sqlcrudtest-4645", encryption_protector_name="current", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceEncryptionProtectorRevalidate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceEncryptionProtectorRevalidate.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 769f6c614323..1eebf403f30c 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceGet.json +# x-ms-original-file: 2025-02-01-preview/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 index f8cb520e835f..e3ab8d28b68d 100644 --- 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceGetWhileUpdating.json +# x-ms-original-file: 2025-02-01-preview/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 7d1e2e12f7e8..6236f733ead2 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceGetWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceGetWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py index 3fe90dd106a6..6a1425f849b7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_keys.begin_create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceKeyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py index 34867c71b596..e0d8b3581d03 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_keys.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceKeyDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py index a16cc7ede8d2..17738d6e9f75 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_keys.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py index e1abc78072de..7f85a7405812 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_key_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_keys.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceKeyList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceKeyList.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 466b32ce2a13..293e02e2cbd3 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceList.json +# x-ms-original-file: 2025-02-01-preview/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 3efe5fc9dc05..2047cc993c8b 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceListByInstancePool.json +# x-ms-original-file: 2025-02-01-preview/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 0762ff7ecf2f..f95fcc52c6d3 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_instance_pool( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceListByInstancePoolWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/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 6ba0e3b0bbda..76d3995eb04a 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceListByResourceGroup.json +# x-ms-original-file: 2025-02-01-preview/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 c636c7945d6b..302ac858f3d7 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceListByResourceGroupWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/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 f052075da9e9..12bee906901e 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceListWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceListWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py index a62ea3c7fc34..c97ea4c1bb8c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.long_term_retention_managed_instance_backups.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py index 68db848eeb91..3237fb3b04a6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py index 7eb2de8d0a75..cd2088188fd4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py index b34a2e0a1f1a..ddd6338c4f6c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py index bfe34d2f4248..94f4100c6d91 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py index 4af0de53c44e..c69b44afa71a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_backup_list_by_location_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionBackupListByLocationMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionBackupListByLocationMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py index 946832d58757..583af253d0b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_instance_long_term_retention_policies.begin_create_or_update( + client.managed_instance_long_term_retention_policies.begin_create_or_update( resource_group_name="testResourceGroup", managed_instance_name="testInstance", database_name="testDatabase", @@ -46,9 +45,8 @@ def main(): } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py index e431573ea189..b20b43047dc2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_instance_long_term_retention_policies.begin_delete( + client.managed_instance_long_term_retention_policies.begin_delete( resource_group_name="testResourceGroup", managed_instance_name="testInstance", database_name="testDatabase", policy_name="default", ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionPolicyDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py index 57e3f37e3adf..549f9ab88728 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_long_term_retention_policies.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionPolicyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py index 51110ca03f02..21eb4ef30138 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_long_term_retention_policy_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_long_term_retention_policies.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceLongTermRetentionPolicyListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py index 65aef39bd65c..6d0411cbd78d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_private_endpoint_connections.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py index 358f2a9a1177..d3a10e477227 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_private_endpoint_connections.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py index dc01de16389f..82104c35de66 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_private_endpoint_connections.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py index b8fde645ca5c..4deb0f1df9c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_endpoint_connection_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,27 +25,26 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_instance_private_endpoint_connections.begin_create_or_update( + client.managed_instance_private_endpoint_connections.begin_create_or_update( resource_group_name="Default", managed_instance_name="test-cl", private_endpoint_connection_name="private-endpoint-connection-name", parameters={ "properties": { "privateLinkServiceConnectionState": { - "description": "Approved by johndoe@contoso.com", + "description": "Approved by `johndoe@contoso.com `_", "status": "Approved", } } }, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateEndpointConnectionUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py index 8055dbc7f9f7..cd696c7e8eb9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_private_link_resources.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateLinkResourcesGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py index de5129b4867e..c29a2d0dcacc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_private_link_resources_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_private_link_resources.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstancePrivateLinkResourcesList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstancePrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py index add24eb69e1c..18b9484284f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_queries.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceQueryGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py index 6bfc292afcb0..83e7190b3cb3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_queries.list_by_query( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsList.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceQueryStatisticsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py index 5f5e96d7fd08..a627ccdbf474 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_queries.list_by_query( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsListMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceQueryStatisticsListMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py index 1c914808370c..2d54d1c0d191 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_query_statistics_list_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_queries.list_by_query( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceQueryStatisticsListMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceQueryStatisticsListMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py index 367004897b5a..05616218c5a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_reevaluate_inaccessible_database_state.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,17 +25,18 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_instances.begin_reevaluate_inaccessible_database_state( + response = client.managed_instances.begin_reevaluate_inaccessible_database_state( resource_group_name="testrg", managed_instance_name="testinstance", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceReevaluateInaccessibleDatabaseState.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceReevaluateInaccessibleDatabaseState.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 index eacf2b15b01d..fdf5c37187e5 100644 --- 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_refresh_status( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceRefreshExternalGovernanceStatus.json +# x-ms-original-file: 2025-02-01-preview/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 e047d9b6cc73..831fabe45c8b 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_update( @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceRemoveMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceRemoveMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py index 344961f31374..4dbdc3297bed 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_tde_certificate.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000001", + subscription_id="SUBSCRIPTION_ID", ) - client.managed_instance_tde_certificates.begin_create( + response = client.managed_instance_tde_certificates.begin_create( resource_group_name="testtdecert", managed_instance_name="testtdecert", parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTdeCertificate.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceTdeCertificate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py index 436bf7ceefb4..787f5d5e567a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", + subscription_id="SUBSCRIPTION_ID", ) response = client.time_zones.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTimeZoneGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceTimeZoneGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py index a206ebb0b3c4..7bc438ea8eae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_time_zone_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="37d5e605-6142-4d79-b564-28b6dbfeec0f", + subscription_id="SUBSCRIPTION_ID", ) response = client.time_zones.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTimeZoneListByLocation.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceTimeZoneListByLocation.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 2e271a576054..30abb9a57dac 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTopQueriesList.json +# x-ms-original-file: 2025-02-01-preview/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 008ecd8dbe7a..8eb84e8b3ef9 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTopQueriesListMax.json +# x-ms-original-file: 2025-02-01-preview/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 2047f909ae27..3fa9f8000350 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceTopQueriesListMin.json +# x-ms-original-file: 2025-02-01-preview/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 95fd98556643..e6c1bd208087 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 @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_update( @@ -59,6 +59,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/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 0ed032755f76..821804eaf436 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py index b4c3b32463a5..0e9b86fa4759 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_container_sas_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_vulnerability_assessments.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py index aa1f0e67bcc9..b2e5d8f187bd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_vulnerability_assessments.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py index 8bd5152b6af7..17aea0c6f31a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_create_storage_access_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_vulnerability_assessments.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py index e1bc423218f8..20504750d7f6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_instance_vulnerability_assessments.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py index 8d8f7e47aacf..552436746fe3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_vulnerability_assessments.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py index 2140aba0e673..5ea1c9198843 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_instance_vulnerability_assessment_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instance_vulnerability_assessments.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedInstanceVulnerabilityAssessmentListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py index 24633e58d794..19ea5128928c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_disable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_ledger_digest_uploads.begin_disable( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsDisable.json +# x-ms-original-file: 2025-02-01-preview/ManagedLedgerDigestUploadsDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py index 8918fbade384..cf446ea9a962 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_enable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,21 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_ledger_digest_uploads.begin_create_or_update( + client.managed_ledger_digest_uploads.begin_create_or_update( resource_group_name="ledgertestrg", managed_instance_name="ledgertestserver", database_name="testdb", ledger_digest_uploads="current", parameters={"properties": {"digestStorageEndpoint": "https://MyAccount.blob.core.windows.net"}}, ).result() - print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsEnable.json +# x-ms-original-file: 2025-02-01-preview/ManagedLedgerDigestUploadsEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py index 3de7de741506..9c609d1f4a71 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_ledger_digest_uploads.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedLedgerDigestUploadsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py index 446af77afc81..3a010a1a16ef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_ledger_digest_uploads_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_ledger_digest_uploads.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedLedgerDigestUploadsList.json +# x-ms-original-file: 2025-02-01-preview/ManagedLedgerDigestUploadsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py index 046ecb1aca7b..6ad4ef97a94c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_acquire.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_dns_aliases.begin_acquire( @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasAcquire.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerDnsAliasAcquire.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py index 5fb35c2690f8..6d643e5788ab 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_dns_aliases.begin_create_or_update( resource_group_name="Default", managed_instance_name="dns-mi", dns_alias_name="dns-alias-mi", - parameters={"createDnsRecord": True}, + parameters={"createDnsRecord": bool}, ).result() print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerDnsAliasCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py index e894f0135041..2fb257176126 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.managed_server_dns_aliases.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasDelete.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerDnsAliasDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py index 9b6cd180ecb3..3fc5cebab83f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_dns_aliases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerDnsAliasGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py index 84952d7fa17d..4ef51a83217b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_dns_alias_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_dns_aliases.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerDnsAliasList.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerDnsAliasList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py index adb67d231f77..52d19a2d575b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_security_alert_policies.begin_create_or_update( @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerSecurityAlertCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py index 58693528b585..420bfa596046 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_security_alert_policies.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerSecurityAlertCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py index 8c150339b14b..391450c76175 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_security_alert_policies.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerSecurityAlertGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py index 837a5ad6fc9f..89137b5887f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_server_security_alert_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_server_security_alert_policies.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedServerSecurityAlertListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ManagedServerSecurityAlertListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py index 6772bc7e3812..47411f96a5d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_transparent_data_encryption.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionGet.json +# x-ms-original-file: 2025-02-01-preview/ManagedTransparentDataEncryptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py index 28cb74771b67..bc73136fbba0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_transparent_data_encryption.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionList.json +# x-ms-original-file: 2025-02-01-preview/ManagedTransparentDataEncryptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py index e782f86e793c..e1c0fedf05f5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/managed_transparent_data_encryption_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_database_transparent_data_encryption.create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ManagedTransparentDataEncryptionUpdate.json +# x-ms-original-file: 2025-02-01-preview/ManagedTransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py index 101ea7e204a8..4d91af77d21b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_security_perimeter_configurations.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsGet.json +# x-ms-original-file: 2025-02-01-preview/NetworkSecurityPerimeterConfigurationsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py index d818176231dc..e81bb6afc1f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_security_perimeter_configurations.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsListByServer.json +# x-ms-original-file: 2025-02-01-preview/NetworkSecurityPerimeterConfigurationsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py index 9497aa301739..116c9ab63d4c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/network_security_perimeter_configurations_reconcile.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.network_security_perimeter_configurations.begin_reconcile( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/NetworkSecurityPerimeterConfigurationsReconcile.json +# x-ms-original-file: 2025-02-01-preview/NetworkSecurityPerimeterConfigurationsReconcile.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py index 546c847596fe..3cc9a4edcf36 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.outbound_firewall_rules.begin_create_or_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleCreate.json +# x-ms-original-file: 2025-02-01-preview/OutboundFirewallRuleCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py index 03cf6936a63f..c02471ab12cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.outbound_firewall_rules.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleDelete.json +# x-ms-original-file: 2025-02-01-preview/OutboundFirewallRuleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py index afe8f2e4a04b..ee7ba29d443e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.outbound_firewall_rules.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleGet.json +# x-ms-original-file: 2025-02-01-preview/OutboundFirewallRuleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py index 741f5feb3502..5285adad18b8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/outbound_firewall_rule_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.outbound_firewall_rules.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/OutboundFirewallRuleList.json +# x-ms-original-file: 2025-02-01-preview/OutboundFirewallRuleList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py index 4f541b3a6964..66a1d30e66f9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_default_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchDatabaseDefaultEnclave.json +# x-ms-original-file: 2025-02-01-preview/PatchDatabaseDefaultEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py index 03b1a5058a34..551a9f64ae08 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_database_vbs_enclave.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchDatabaseVBSEnclave.json +# x-ms-original-file: 2025-02-01-preview/PatchDatabaseVBSEnclave.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py index 80666ffe1d3d..4e16bfd99bb6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_instance_pool.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.instance_pools.begin_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchInstancePool.json +# x-ms-original-file: 2025-02-01-preview/PatchInstancePool.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py index 75ce9fe4c9a9..282c09726e1e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -43,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabase.json +# x-ms-original-file: 2025-02-01-preview/PatchVCoreDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py index babccd48d3d0..c2b0b9df8257 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_assign_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/PatchVCoreDatabaseAssignMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py index 65e00da71bd6..2a1174b29322 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_reset_maintenance_configuration.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseResetMaintenanceConfiguration.json +# x-ms-original-file: 2025-02-01-preview/PatchVCoreDatabaseResetMaintenanceConfiguration.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py index 0c01e0c83843..cac49e865187 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/patch_vcore_database_with_keys_and_encryption_protector.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_update( @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json +# x-ms-original-file: 2025-02-01-preview/PatchVCoreDatabaseWithKeysAndEncryptionProtector.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py index c133772b3b94..8203ef94c617 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/pause_database.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_pause( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PauseDatabase.json +# x-ms-original-file: 2025-02-01-preview/PauseDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py index 2634508eef07..93ad6948f1fe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.private_endpoint_connections.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionDelete.json +# x-ms-original-file: 2025-02-01-preview/PrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py index 6734ea54a480..61f69473da78 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionGet.json +# x-ms-original-file: 2025-02-01-preview/PrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py index ed9d0916d9f2..fd2bade32142 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionList.json +# x-ms-original-file: 2025-02-01-preview/PrivateEndpointConnectionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py index 620958a51e9e..d1cb1372015a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_endpoint_connection_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_endpoint_connections.begin_create_or_update( @@ -38,7 +37,7 @@ def main(): parameters={ "properties": { "privateLinkServiceConnectionState": { - "description": "Approved by johndoe@contoso.com", + "description": "Approved by `johndoe@contoso.com `_", "status": "Approved", } } @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateEndpointConnectionUpdate.json +# x-ms-original-file: 2025-02-01-preview/PrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py index b5d4ffcfc7e5..466222f07640 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_link_resources.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateLinkResourcesGet.json +# x-ms-original-file: 2025-02-01-preview/PrivateLinkResourcesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py index 8f61dc062094..91f167696c5e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/private_link_resources_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.private_link_resources.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/PrivateLinkResourcesList.json +# x-ms-original-file: 2025-02-01-preview/PrivateLinkResourcesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py index 303c42457ad1..2d8e3468ad37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_disable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sensitivity_labels.disable_recommendation( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="recommended", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecommendedColumnSensitivityLabelDisable.json +# x-ms-original-file: 2025-02-01-preview/RecommendedColumnSensitivityLabelDisable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py index 94609a201acc..befd26b6b758 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recommended_column_sensitivity_label_enable.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sensitivity_labels.enable_recommendation( @@ -38,9 +37,10 @@ def main(): schema_name="dbo", table_name="myTable", column_name="myColumn", + sensitivity_label_source="recommended", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecommendedColumnSensitivityLabelEnable.json +# x-ms-original-file: 2025-02-01-preview/RecommendedColumnSensitivityLabelEnable.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py index f887595f9df4..21dd683e8aa6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.recoverable_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseGet.json +# x-ms-original-file: 2025-02-01-preview/RecoverableDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py index f64ff51641dd..4b219f213ae4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_get_with_expand_equals_keys.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.recoverable_databases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseGetWithExpandEqualsKeys.json +# x-ms-original-file: 2025-02-01-preview/RecoverableDatabaseGetWithExpandEqualsKeys.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py index 780eda1d829a..2795f3c41a82 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/recoverable_database_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.recoverable_databases.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RecoverableDatabaseList.json +# x-ms-original-file: 2025-02-01-preview/RecoverableDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py index 30f2e1dd7870..3d565fa4aba2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/refresh_external_governance_status.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_refresh_status( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RefreshExternalGovernanceStatus.json +# x-ms-original-file: 2025-02-01-preview/RefreshExternalGovernanceStatus.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py index e09c52379f5c..5caeeb6ec4b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/remove_legal_hold_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_remove_legal_hold_immutability( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RemoveLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/RemoveLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py index 17b473d42670..5f58102dc489 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/remove_time_based_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_remove_time_based_immutability( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RemoveTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/RemoveTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py index 2b769c4b01a4..2b455bae1d0d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/rename_database.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.databases.rename( @@ -41,6 +41,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RenameDatabase.json +# x-ms-original-file: 2025-02-01-preview/RenameDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py index 507013660853..c19439dd35ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.begin_create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/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 004dbe804077..02d7babd5d29 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.replication_links.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkDelete.json +# x-ms-original-file: 2025-02-01-preview/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 8f94a1b2e943..6f8322dfacda 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.begin_failover( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkFailover.json +# x-ms-original-file: 2025-02-01-preview/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 16436ded25ea..4f6b1c9a3c6b 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.begin_failover_allow_data_loss( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkFailoverAllowDataLoss.json +# x-ms-original-file: 2025-02-01-preview/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 3d5d61592b1f..60392d3228ec 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkGet.json +# x-ms-original-file: 2025-02-01-preview/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 76e16b72725a..8e3535a051f5 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/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 e642a5402e94..857a7075ddf1 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkListByServer.json +# x-ms-original-file: 2025-02-01-preview/ReplicationLinkListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py index 557046c84065..4d53498444e5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/replication_link_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.replication_links.begin_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ReplicationLinkUpdate.json +# x-ms-original-file: 2025-02-01-preview/ReplicationLinkUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py index 3212a481b701..308ce625d6a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_change_long_term_retention_backup_access_tier.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_change_access_tier_by_resource_group( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedChangeLongTermRetentionBackupAccessTier.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedChangeLongTermRetentionBackupAccessTier.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py index 42de21cb9122..48c1f667fad6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_lock_time_based_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_lock_time_based_immutability_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLockTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLockTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py index 2eb1f452e993..517a0a55da42 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_copy.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_copy_by_resource_group( @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupCopy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py index 0309fbe3db3b..8963a377da3e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.long_term_retention_backups.begin_delete_by_resource_group( @@ -40,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py index 67c9daef490c..7d1f1a3d717b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.get_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupGet.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py index 6f71ed28baaa..1d5ea3e109aa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_resource_group_database( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py index bdd3a61d5701..d0ad4a3e324a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_resource_group_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py index 81ed5383c068..ce50a6a1fd8c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.list_by_resource_group_server( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py index fb51e4ac9ad3..533457b7b3f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_long_term_retention_backup_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_update_by_resource_group( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedLongTermRetentionBackupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py index 999518b9f68a..ac3aa611cc6c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( @@ -40,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py index ebcfbb0b1507..b2d40fcf58a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.get_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py index 3c643f80bd9e..1b37e3bc8d13 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_resource_group_database( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py index d718bdcac9ea..20b4d0e6fb5c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_resource_group_instance( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py index 67161200e3ab..6773c6d1a032 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_resource_group_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py index 37fdb910c228..6fccb51b20c2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_managed_instance_long_term_retention_backup_list_by_location_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_managed_instance_backups.list_by_resource_group_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocationMax.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocationMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py index 0b2bcf99da21..5594347a8cfd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_legal_hold_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_remove_legal_hold_immutability_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedRemoveLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedRemoveLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py index 54d893eb4c93..1a36993d7298 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_remove_time_based_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_remove_time_based_immutability_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedRemoveTimeBasedImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedRemoveTimeBasedImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py index 971331af84ae..425f357a8860 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resource_group_based_set_legal_hold_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_set_legal_hold_immutability_by_resource_group( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResourceGroupBasedSetLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/ResourceGroupBasedSetLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py index 02b7e148be35..9f2bc0164729 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/restorable_dropped_managed_database_list_by_managed_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.restorable_dropped_managed_databases.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/RestorableDroppedManagedDatabaseListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py index 554db8b13b6a..f15a6329645f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_resume( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResumeDatabase.json +# x-ms-original-file: 2025-02-01-preview/ResumeDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py index 16614334185a..db3a244d3495 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/resume_transparent_data_encryption_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.transparent_data_encryptions.begin_resume( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ResumeTransparentDataEncryptionUpdate.json +# x-ms-original-file: 2025-02-01-preview/ResumeTransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py index 140e73cfbb65..b387bd0f176c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_current_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sensitivity_labels.update( @@ -77,6 +76,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsCurrentUpdate.json +# x-ms-original-file: 2025-02-01-preview/SensitivityLabelsCurrentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py index d19d6fc64cac..c8a4d290511e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sensitivity_labels.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/SensitivityLabelsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py index fb5298703e20..8721f638ee7e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_current.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sensitivity_labels.list_current_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json +# x-ms-original-file: 2025-02-01-preview/SensitivityLabelsListByDatabaseWithSourceCurrent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py index 84c45aea8e99..05ac3db89203 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_list_by_database_with_source_recommended.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sensitivity_labels.list_recommended_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json +# x-ms-original-file: 2025-02-01-preview/SensitivityLabelsListByDatabaseWithSourceRecommended.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py index adcfc995aac8..1eef2db3c007 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sensitivity_labels_recommended_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.recommended_sensitivity_labels.update( @@ -45,6 +44,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SensitivityLabelsRecommendedUpdate.json +# x-ms-original-file: 2025-02-01-preview/SensitivityLabelsRecommendedUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py index 3045e68d1e2f..595496c09ca7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advanced_threat_protection_settings.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvancedThreatProtectionSettingsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py index eeacaccea22c..a82d31e08cbd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advanced_threat_protection_settings.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvancedThreatProtectionSettingsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py index 4eddc823ba12..10835475a58f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advanced_threat_protection_settings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsGet.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvancedThreatProtectionSettingsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py index fd51e8db4211..4218c9243ca4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advanced_threat_protection_settings_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advanced_threat_protection_settings.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvancedThreatProtectionSettingsListByServer.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvancedThreatProtectionSettingsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py index 00f2fe417eff..687707dc6124 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advisors.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorGet.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvisorGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py index e0c788632982..647920824355 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advisors.list_by_server( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorList.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvisorList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py index bd56e7305286..5afec2f2259f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_advisor_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advisors.update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAdvisorUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerAdvisorUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py index 31823b585cd5..7789acfc5544 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_auditing_settings_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_blob_auditing_policies.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAuditingSettingsList.json +# x-ms-original-file: 2025-02-01-preview/ServerAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py index e9fc348691ec..63a3e73cace4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_automatic_tuning.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningGet.json +# x-ms-original-file: 2025-02-01-preview/ServerAutomaticTuningGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py index 5a2e64266b94..a1d25cd55bcc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_automatic_tuning.update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerAutomaticTuningUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py index 5cecc88b85c6..e6721495d257 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_automatic_tuning_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="c3aa9078-0000-0000-0000-e36f151182d7", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_automatic_tuning.update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerAutomaticTuningUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/ServerAutomaticTuningUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py index e38a21d9cd41..7778de15e982 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,14 +26,15 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_blob_auditing_policies.begin_create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", parameters={ "properties": { "auditActionsAndGroups": [ @@ -55,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerBlobAuditingCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py index 80039573d20d..514cca282e0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_create_min.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,14 +26,15 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_blob_auditing_policies.begin_create_or_update( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", parameters={ "properties": { "state": "Enabled", @@ -45,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ServerBlobAuditingCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py index 99046ce13f6c..c33c8e4e37c2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_blob_auditing_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_blob_auditing_policies.get( resource_group_name="blobauditingtest-4799", server_name="blobauditingtest-6440", + blob_auditing_policy_name="default", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerBlobAuditingGet.json +# x-ms-original-file: 2025-02-01-preview/ServerBlobAuditingGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py index 80196f816cdd..be4fa036ab7c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_configuration_options.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionGet.json +# x-ms-original-file: 2025-02-01-preview/ServerConfigurationOptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py index 356fc78398e9..04576bf0bce9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_configuration_options.list_by_managed_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionList.json +# x-ms-original-file: 2025-02-01-preview/ServerConfigurationOptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py index 70e8212892c0..f7a3a6c19e32 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_configuration_option_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_configuration_options.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConfigurationOptionUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerConfigurationOptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py index 8429587ff8b9..5c9031d62793 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_connection_policies.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesGet.json +# x-ms-original-file: 2025-02-01-preview/ServerConnectionPoliciesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py index 0617487a568c..3804f83c9723 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_connection_policies.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesList.json +# x-ms-original-file: 2025-02-01-preview/ServerConnectionPoliciesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py index 7566b94776b9..0bf64981221a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_connection_policies_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_connection_policies.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerConnectionPoliciesUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerConnectionPoliciesUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py index 555e7f18ba0e..b18f99fbd90c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_create.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_create_or_update( @@ -56,6 +56,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerCreate.json +# x-ms-original-file: 2025-02-01-preview/ServerCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py index dd1fa9dd9ab9..ee1a56caa9f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_delete.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.servers.begin_delete( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py index 3e0fcbfb07a2..46da4aaa9d3f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dev_ops_audit_settings.begin_create_or_update( @@ -48,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerDevOpsAuditCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py index 5a475597de90..7a0391847fd0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dev_ops_audit_settings.begin_create_or_update( @@ -46,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ServerDevOpsAuditCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py index 112a3a45e7b9..75f4ad782cb5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dev_ops_audit_settings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditGet.json +# x-ms-original-file: 2025-02-01-preview/ServerDevOpsAuditGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py index 8509b04da4cc..a49a004764b1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dev_ops_audit_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dev_ops_audit_settings.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDevOpsAuditList.json +# x-ms-original-file: 2025-02-01-preview/ServerDevOpsAuditList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py index 44311b7d5d0a..1a174d54f828 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_acquire.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dns_aliases.begin_acquire( @@ -42,6 +42,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasAcquire.json +# x-ms-original-file: 2025-02-01-preview/ServerDnsAliasAcquire.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py index 3a16cf7f33dd..d7ea4a1ef4c1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dns_aliases.begin_create_or_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerDnsAliasCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py index 980d46b61cdd..3e63422bbd8a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_dns_aliases.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerDnsAliasDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py index 6b332f8083d3..e1cb2b2e9ec1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dns_aliases.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasGet.json +# x-ms-original-file: 2025-02-01-preview/ServerDnsAliasGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py index 55be60d86fe0..a30fab2ccef2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_dns_alias_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_dns_aliases.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerDnsAliasList.json +# x-ms-original-file: 2025-02-01-preview/ServerDnsAliasList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py index 06aecbb1ca5c..715929547fd1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_extended_auditing_settings_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.extended_server_blob_auditing_policies.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerExtendedAuditingSettingsList.json +# x-ms-original-file: 2025-02-01-preview/ServerExtendedAuditingSettingsList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py index 8c10da0752c1..6328ccf89997 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.get( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerGet.json +# x-ms-original-file: 2025-02-01-preview/ServerGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py index f0feedc69d9c..ed74a0b76b31 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_get_with_expand_equals_administrators.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerGetWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/ServerGetWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py index f89328390645..35e51aeefcbf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_keys.begin_create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py index ca8c8b205f1f..ca81ae33575e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_create_or_update_with_versionless_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_keys.begin_create_or_update( @@ -42,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyCreateOrUpdateWithVersionlessKey.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyCreateOrUpdateWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py index 6d0e584da7c1..86321c6e1b37 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_keys.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py index e9f828b5f44c..1644fed8b892 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_keys.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyGet.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py index 311ad2ade618..cf40e67a4c4a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_get_with_versionless_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_keys.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyGetWithVersionlessKey.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyGetWithVersionlessKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py index 01cf173f74fe..9501a8a024f3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_key_list.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_keys.list_by_server( @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerKeyList.json +# x-ms-original-file: 2025-02-01-preview/ServerKeyList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py index 784013a2d232..1c26b790082c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.list() @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerList.json +# x-ms-original-file: 2025-02-01-preview/ServerList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py index bbe0925be269..980a8781bbac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListByResourceGroup.json +# x-ms-original-file: 2025-02-01-preview/ServerListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py index 6170be5deffc..371ddb5bdd87 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_by_resource_group_with_expand_equals_administrators.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListByResourceGroupWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/ServerListByResourceGroupWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py index 8cd1cd3aa203..7e1e5d568065 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_list_with_expand_equals_administrators.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerListWithExpandEqualsAdministrators.json +# x-ms-original-file: 2025-02-01-preview/ServerListWithExpandEqualsAdministrators.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py index ae84c8a33ca2..549c70390296 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_recommended_action_list_expand.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_advisors.list_by_server( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerRecommendedActionListExpand.json +# x-ms-original-file: 2025-02-01-preview/ServerRecommendedActionListExpand.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py index 2a99d89b2ef4..be2d1f0793ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_max.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_security_alert_policies.begin_create_or_update( @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerSecurityAlertsCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py index 81b749e921fd..e651e9333692 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_create_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_security_alert_policies.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsCreateMin.json +# x-ms-original-file: 2025-02-01-preview/ServerSecurityAlertsCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py index 05f36336f638..45066a244ab7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_security_alert_policies.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsGet.json +# x-ms-original-file: 2025-02-01-preview/ServerSecurityAlertsGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py index 9f6a3f7cc146..88443e51c281 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_security_alerts_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_security_alert_policies.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerSecurityAlertsListByServer.json +# x-ms-original-file: 2025-02-01-preview/ServerSecurityAlertsListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py index fe58d1f3672d..e008335dbc9b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="0574222d-5c7f-489c-a172-b3013eafab53", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_certificates.begin_create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesCreate.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustCertificatesCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py index 562635e8031d..8aac071d8e23 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + subscription_id="SUBSCRIPTION_ID", ) client.server_trust_certificates.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustCertificatesDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py index 66b0ac6f5cf5..054cb9eef29c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_certificates.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesGet.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustCertificatesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py index 922f9d8ba59d..3de6cc110f57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_certificates_list_by_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="38e0dc56-907f-45ba-a97c-74233baad471", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_certificates.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustCertificatesListByInstance.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustCertificatesListByInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py index 75e9949663a4..add6a87d0c44 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_create.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_groups.begin_create_or_update( @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupCreate.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustGroupCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py index 948fbdb9265c..8a33b1632fad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_trust_groups.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py index a176046311a6..21cc902f3df7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_groups.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupGet.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py index 6b243ad2b7a3..ba4981e13a11 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_groups.list_by_location( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupList.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustGroupList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py index cf5d97953c80..bc5834f92b05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_trust_group_list_by_managed_instance.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_trust_groups.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerTrustGroupListByManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/ServerTrustGroupListByManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py index 0b15fd4bc849..62a9d3653f38 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_update.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.servers.begin_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerUpdate.json +# x-ms-original-file: 2025-02-01-preview/ServerUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py index cd436e75cd93..bb10a369ec9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_usage_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_usages.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerUsageList.json +# x-ms-original-file: 2025-02-01-preview/ServerUsageList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py index 9dc6efc9be57..4e1e11318655 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_container_sas_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_vulnerability_assessments.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentCreateContainerSasKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py index d6379fdd502c..ad18cd92b037 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_vulnerability_assessments.create_or_update( @@ -51,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateMax.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py index 1f0d9cc6458f..8d961ca5a45f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_create_storage_access_key_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_vulnerability_assessments.create_or_update( @@ -45,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentCreateStorageAccessKeyMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py index 462aadec7503..8b124588e292 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.server_vulnerability_assessments.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentDelete.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py index 5e8c9f5aa55e..09d269df7863 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_vulnerability_assessments.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py index 6bcbf6ed0f19..a6c03feb0e5f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/server_vulnerability_assessment_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.server_vulnerability_assessments.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/ServerVulnerabilityAssessmentListByServer.json +# x-ms-original-file: 2025-02-01-preview/ServerVulnerabilityAssessmentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py b/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py index 7b6f1c73a1be..a0b9b4dcc79e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/set_legal_hold_immutability_long_term_retention_backup.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.long_term_retention_backups.begin_set_legal_hold_immutability( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SetLegalHoldImmutabilityLongTermRetentionBackup.json +# x-ms-original-file: 2025-02-01-preview/SetLegalHoldImmutabilityLongTermRetentionBackup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py index 569c55a76c53..35ee4ddd159f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_agent.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlAgentConfigurationGet.json +# x-ms-original-file: 2025-02-01-preview/SqlAgentConfigurationGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py index 82f7cd620918..bab7b08e7a88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_agent_configuration_put.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_agent.create_or_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlAgentConfigurationPut.json +# x-ms-original-file: 2025-02-01-preview/SqlAgentConfigurationPut.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py index 3d8a9a727211..af5cfd0b1163 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_tde_certificate_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000001", + subscription_id="SUBSCRIPTION_ID", ) - client.tde_certificates.begin_create( + response = client.tde_certificates.begin_create( resource_group_name="testtdecert", server_name="testtdecert", parameters={"properties": {"privateBlob": "MIIXXXXXXXX"}}, ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlTdeCertificateCreate.json +# x-ms-original-file: 2025-02-01-preview/SqlTdeCertificateCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py index 5b276febfd9b..b2bac94a6840 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_baselines.create_or_update( @@ -45,10 +44,11 @@ def main(): }, } }, + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineAdd.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentBaselineAdd.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py index e9ee38875763..7d988d89d041 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_add_latest.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_baselines.create_or_update( @@ -37,10 +36,11 @@ def main(): vulnerability_assessment_name="default", baseline_name="default", parameters={"properties": {"latestScan": True, "results": {}}}, + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineAddLatest.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentBaselineAddLatest.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py index 11447e8d2592..7642b1d2ce2d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_baseline.get( @@ -36,10 +35,11 @@ def main(): server_name="vulnerabilityaseessmenttest-6411", vulnerability_assessment_name="default", baseline_name="default", + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py index b619139b299e..3a2ed1b368c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( resource_group_name="vulnerabilityaseessmenttest-4711", server_name="vulnerabilityaseessmenttest-6411", vulnerability_assessment_name="default", + system_database_name="master", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentBaselineListBySqlVulnerabilityAssessment.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py index abcbff5dca20..a4bded55b35c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessments_settings.create_or_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentCreate.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py index 64e9e329b810..c59330e49732 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sql_vulnerability_assessments.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentDelete.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py index 2fef93b36e0b..062acc6b7523 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessments_settings.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentGet.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py index 3d2c6ea57164..e9142ceebd32 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessments_settings.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentListByServer.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py index 0128f2057ebe..b0dab9b97f97 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_list_scans_results.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_scan_result.list_by_scan( @@ -36,11 +35,12 @@ def main(): server_name="testsvr", vulnerability_assessment_name="default", scan_id="scanId1", + system_database_name="master", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentListScansResults.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentListScansResults.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py index 1733b2dc5859..a3ac2a31cec5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_rule_baseline.create_or_update( @@ -43,10 +42,11 @@ def main(): "results": [["userA", "SELECT"], ["userB", "SELECT"], ["userC", "SELECT"]], } }, + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineCreate.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentRuleBaselineCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py index 15568c1a6129..235be403554f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sql_vulnerability_assessment_rule_baselines.delete( @@ -37,9 +36,10 @@ def main(): vulnerability_assessment_name="default", baseline_name="default", rule_id="VA1001", + system_database_name="master", ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineDelete.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentRuleBaselineDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py index f3337cfb2e16..b7eb88d362bc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_rule_baseline.get( @@ -37,10 +36,11 @@ def main(): vulnerability_assessment_name="default", baseline_name="default", rule_id="VA1001", + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineGet.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentRuleBaselineGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py index bc9b9823790a..206c64a7885d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_rule_baseline_list_by_baseline.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( @@ -36,11 +35,12 @@ def main(): server_name="vulnerabilityaseessmenttest-6411", vulnerability_assessment_name="default", baseline_name="default", + system_database_name="master", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentRuleBaselineListByBaseline.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py index ca939a16f0ec..69e3e25d1089 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_scans.get( @@ -36,10 +35,11 @@ def main(): server_name="vulnerabilityassessmenttest-6411", vulnerability_assessment_name="default", scan_id="scan001", + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScan.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentScan.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py index 3bb3ead802a6..5a62c6531938 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scan_records_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( resource_group_name="vulnerabilityassessmenttest-4711", server_name="vulnerabilityassessmenttest-6411", vulnerability_assessment_name="default", + system_database_name="master", ) for item in response: print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentScanRecordsListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py index feaedcfbdf02..9287d8711530 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_execute.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.sql_vulnerability_assessment_execute_scan.begin_execute( + response = client.sql_vulnerability_assessment_execute_scan.begin_execute( resource_group_name="vulnerabilityassessmenttest-4711", server_name="vulnerabilityassessmenttest-6411", vulnerability_assessment_name="default", + system_database_name="master", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScansExecute.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentScansExecute.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py index 9bc1a292751a..3d5235719d2c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sql_vulnerability_assessment_scans_results.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sql_vulnerability_assessment_scan_result.get( @@ -37,10 +36,11 @@ def main(): vulnerability_assessment_name="default", scan_id="scanId1", scan_result_id="VA1234", + system_database_name="master", ) print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SqlVulnerabilityAssessmentScansResults.json +# x-ms-original-file: 2025-02-01-preview/SqlVulnerabilityAssessmentScansResults.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 648caf9dc21f..7a1337a5a881 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_start( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/StartManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py index ce00eda23496..71a8b7ee72ad 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_max.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.start_stop_managed_instance_schedules.create_or_update( @@ -49,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleCreateOrUpdateMax.json +# x-ms-original-file: 2025-02-01-preview/StartStopManagedInstanceScheduleCreateOrUpdateMax.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py index 7f7bea3138df..73c69972240a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_create_or_update_min.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.start_stop_managed_instance_schedules.create_or_update( @@ -47,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleCreateOrUpdateMin.json +# x-ms-original-file: 2025-02-01-preview/StartStopManagedInstanceScheduleCreateOrUpdateMin.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py index 5313e5ad47a7..28e79c9ade69 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.start_stop_managed_instance_schedules.delete( @@ -38,6 +37,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleDelete.json +# x-ms-original-file: 2025-02-01-preview/StartStopManagedInstanceScheduleDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py index 4391b924abef..df49b86dfc6a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.start_stop_managed_instance_schedules.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleGet.json +# x-ms-original-file: 2025-02-01-preview/StartStopManagedInstanceScheduleGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py index e8a5920ed9ef..91394849365a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/start_stop_managed_instance_schedule_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.start_stop_managed_instance_schedules.list_by_instance( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StartStopManagedInstanceScheduleList.json +# x-ms-original-file: 2025-02-01-preview/StartStopManagedInstanceScheduleList.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 c6a3f63d4ef0..cd9eb24b9ee2 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 @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.managed_instances.begin_stop( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/StopManagedInstance.json +# x-ms-original-file: 2025-02-01-preview/StopManagedInstance.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py index 2e938be32a3c..647fd8c19172 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.subscription_usages.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SubscriptionUsageGet.json +# x-ms-original-file: 2025-02-01-preview/SubscriptionUsageGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py index e1ba1ec3cb70..f93334da9690 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/subscription_usage_list_by_location.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.subscription_usages.list_by_location( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SubscriptionUsageListByLocation.json +# x-ms-original-file: 2025-02-01-preview/SubscriptionUsageListByLocation.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py index 8ee96775033c..7b48ffad81c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/suspend_transparent_data_encryption_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.transparent_data_encryptions.begin_suspend( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SuspendTransparentDataEncryptionUpdate.json +# x-ms-original-file: 2025-02-01-preview/SuspendTransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py index 7bbc4d027f01..7c15650cc391 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/synapse_link_workspace_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.synapse_link_workspaces.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SynapseLinkWorkspaceListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/SynapseLinkWorkspaceListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py index a347a70278a3..0eb6f6b5fe0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_create.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.begin_create_or_update( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentCreate.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py index 889e2f2c2ffe..2f547b4978fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sync_agents.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentDelete.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py index 15dba8102803..90aad69d0cd5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_generate_key.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.generate_key( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGenerateKey.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentGenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py index 09cbb321449a..75471fe00b70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.get( @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGet.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py index b7a295bfb173..bd2626a4355f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_get_linked_databases.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.list_linked_databases( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentGetLinkedDatabases.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentGetLinkedDatabases.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py index f9fc5816fc4c..8f4dfefd683b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_list_by_server.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentListByServer.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentListByServer.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py index 9af72439794d..7b36e1d6deb2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_agent_update.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_agents.begin_create_or_update( @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncAgentUpdate.json +# x-ms-original-file: 2025-02-01-preview/SyncAgentUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py index ce6994403636..6522ebd6216e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_cancel_sync.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sync_groups.cancel_sync( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupCancelSync.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupCancelSync.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py index 6dc36ea2aca6..ffad2cdca978 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.begin_create_or_update( @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupCreate.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create_with_identity.py new file mode 100644 index 000000000000..8e40bcb723b0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_create_with_identity.py @@ -0,0 +1,59 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_create_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_groups.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + }, + "properties": { + "conflictResolutionPolicy": "HubWin", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": False, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncGroupCreateWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py index 9557beb15087..d555a221de41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sync_groups.begin_delete( @@ -39,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupDelete.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py index 2a8c0e9a779c..3f6676181969 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.get( @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGet.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py index 395405a80e8e..ae7da2504265 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_hub_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.list_hub_schemas( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetHubSchema.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupGetHubSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py index 21b81e6a7f4a..40d083633cfc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_log.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.list_logs( @@ -44,6 +43,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetLog.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupGetLog.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py index e394f6feecd8..5b7f9d9869b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_sync_database_id.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.list_sync_database_ids( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupGetSyncDatabaseId.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupGetSyncDatabaseId.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_with_identity.py new file mode 100644 index 000000000000..e4406fe0a652 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_get_with_identity.py @@ -0,0 +1,44 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_get_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_groups.get( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + ) + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncGroupGetWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py index 0c71cca6ecb2..c1bc7692b623 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_list_by_database.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupListByDatabase.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupListByDatabase.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py index c58112feb577..f848be2299f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.begin_update( @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupPatch.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupPatch.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_add_and_remove_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_add_and_remove_identity.py new file mode 100644 index 000000000000..88f8bb8f1c43 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_add_and_remove_identity.py @@ -0,0 +1,60 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_patch_add_and_remove_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_groups.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": None, + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi-2": {}, + }, + }, + "properties": { + "conflictResolutionPolicy": "HubWin", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": False, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncGroupPatchAddAndRemoveIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_with_identity.py new file mode 100644 index 000000000000..b23c31805fa9 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_patch_with_identity.py @@ -0,0 +1,59 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_group_patch_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_groups.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + }, + "properties": { + "conflictResolutionPolicy": "HubWin", + "interval": -1, + "syncDatabaseId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncGroupPatchWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py index 17be978204c7..1fe3159d44fa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_refresh_hub_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,19 +25,20 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.sync_groups.begin_refresh_hub_schema( + response = client.sync_groups.begin_refresh_hub_schema( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupRefreshHubSchema.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupRefreshHubSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py index bda0dd7f65e4..040d8d212b1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_trigger_sync.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sync_groups.trigger_sync( @@ -39,6 +38,6 @@ def main(): ) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupTriggerSync.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupTriggerSync.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py index 517ca2546b3e..1b39663e4a3c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_group_update.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_groups.begin_create_or_update( @@ -49,6 +49,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncGroupUpdate.json +# x-ms-original-file: 2025-02-01-preview/SyncGroupUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py index 8865bb1716d1..426c01c76dfc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.begin_create_or_update( @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberCreate.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create_with_identity.py new file mode 100644 index 000000000000..e8bf6bf69418 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_create_with_identity.py @@ -0,0 +1,62 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_create_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_members.begin_create_or_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + }, + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncMemberCreateWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py index 007d8bd27a2e..e412eb082865 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.sync_members.begin_delete( @@ -40,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberDelete.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py index dcf787dc0967..c568182b434b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get.py @@ -2,13 +2,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -25,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.get( @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberGet.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py index 8102d7f339da..cc7323613c57 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.list_member_schemas( @@ -42,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberGetSchema.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberGetSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_with_identity.py new file mode 100644 index 000000000000..298bc55dfaaf --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_get_with_identity.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_get_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_members.get( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + ) + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncMemberGetWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py index a787d90598f3..21fc0bf35cc4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_list_by_sync_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.list_by_sync_group( @@ -41,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberListBySyncGroup.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberListBySyncGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py index 5049534601be..8209cad1970b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.begin_update( @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberPatch.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberPatch.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_add_and_remove_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_add_and_remove_identity.py new file mode 100644 index 000000000000..4426e3c0facd --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_add_and_remove_identity.py @@ -0,0 +1,63 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_patch_add_and_remove_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_members.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": None, + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi-2": {}, + }, + }, + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncMemberPatchAddAndRemoveIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_with_identity.py new file mode 100644 index 000000000000..327f33080671 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_patch_with_identity.py @@ -0,0 +1,62 @@ +# pylint: disable=line-too-long,useless-suppression +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.identity import DefaultAzureCredential + +from azure.mgmt.sql import SqlClient + +""" +# PREREQUISITES + pip install azure-identity + pip install azure-mgmt-sql +# USAGE + python sync_member_patch_with_identity.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 = SqlClient( + credential=DefaultAzureCredential(), + subscription_id="SUBSCRIPTION_ID", + ) + + response = client.sync_members.begin_update( + resource_group_name="syncgroupcrud-65440", + server_name="syncgroupcrud-8475", + database_name="syncgroupcrud-4328", + sync_group_name="syncgroupcrud-3187", + sync_member_name="syncmembercrud-4879", + parameters={ + "identity": { + "type": "UserAssigned", + "userAssignedIdentities": { + "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-umi": {} + }, + }, + "properties": { + "databaseName": "syncgroupcrud-7421", + "databaseType": "AzureSqlDatabase", + "serverName": "syncgroupcrud-3379.database.windows.net", + "syncDirection": "Bidirectional", + "syncMemberAzureDatabaseResourceId": "/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328", + "usePrivateLinkConnection": True, + }, + }, + ).result() + print(response) + + +# x-ms-original-file: 2025-02-01-preview/SyncMemberPatchWithIdentity.json +if __name__ == "__main__": + main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py index 39f6542a6018..555882b22d1a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_refresh_schema.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,20 +25,21 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.sync_members.begin_refresh_member_schema( + response = client.sync_members.begin_refresh_member_schema( resource_group_name="syncgroupcrud-65440", server_name="syncgroupcrud-8475", database_name="syncgroupcrud-4328", sync_group_name="syncgroupcrud-3187", sync_member_name="syncgroupcrud-4879", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberRefreshSchema.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberRefreshSchema.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py index d57b26bc8c30..61b042c69db2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/sync_member_update.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.sync_members.begin_create_or_update( @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/SyncMemberUpdate.json +# x-ms-original-file: 2025-02-01-preview/SyncMemberUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py index f4273cba422a..0038dca7c419 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.transparent_data_encryptions.get( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionGet.json +# x-ms-original-file: 2025-02-01-preview/TransparentDataEncryptionGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py index fa4377ddba12..481938e07815 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.transparent_data_encryptions.list_by_database( @@ -40,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionList.json +# x-ms-original-file: 2025-02-01-preview/TransparentDataEncryptionList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py index ca0051f96978..aea622baf95c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/transparent_data_encryption_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.transparent_data_encryptions.begin_create_or_update( @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/TransparentDataEncryptionUpdate.json +# x-ms-original-file: 2025-02-01-preview/TransparentDataEncryptionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py index f8708ff0e7c5..436639c92c85 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_perform_cutover.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -50,6 +50,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateDatabaseHyperscaleMigrationPerformCutover.json +# x-ms-original-file: 2025-02-01-preview/UpdateDatabaseHyperscaleMigrationPerformCutover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py index 059b2052e699..bcc49945b7de 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_database_hyperscale_migration_with_manual_cutover.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.databases.begin_create_or_update( @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateDatabaseHyperscaleMigrationWithManualCutover.json +# x-ms-original-file: 2025-02-01-preview/UpdateDatabaseHyperscaleMigrationWithManualCutover.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py index 52feb58d6127..adb43dcf3e14 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgent.json +# x-ms-original-file: 2025-02-01-preview/UpdateJobAgent.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py index 193c04a74483..f0c34da0215e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_identity.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_update( @@ -47,6 +47,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgentWithIdentity.json +# x-ms-original-file: 2025-02-01-preview/UpdateJobAgentWithIdentity.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py index 8d63f4b1f797..3f5a3b481969 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_job_agent_with_sku.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.job_agents.begin_update( @@ -40,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateJobAgentWithSku.json +# x-ms-original-file: 2025-02-01-preview/UpdateJobAgentWithSku.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py index dfc3702a8e05..6382ecc7a53a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_backup_short_term_retention_policies.begin_create_or_update( + response = client.managed_backup_short_term_retention_policies.begin_update( resource_group_name="resourceGroup", managed_instance_name="testsvr", database_name="testdb", @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateManagedShortTermRetentionPolicy.json +# x-ms-original-file: 2025-02-01-preview/UpdateManagedShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py index c7556c2eb873..748fe623fdcc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_managed_short_term_retention_policy_restorable_dropped.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.begin_create_or_update( + response = client.managed_restorable_dropped_database_backup_short_term_retention_policies.begin_update( resource_group_name="resourceGroup", managed_instance_name="testsvr", restorable_dropped_database_id="testdb,131403269876900000", @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json +# x-ms-original-file: 2025-02-01-preview/UpdateManagedShortTermRetentionPolicyRestorableDropped.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py index 48d77c3db1c1..e8e7092d27cc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_short_term_retention_policy.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,12 +25,12 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - response = client.backup_short_term_retention_policies.begin_create_or_update( + response = client.backup_short_term_retention_policies.begin_update( resource_group_name="resourceGroup", server_name="testsvr", database_name="testdb", @@ -41,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateShortTermRetentionPolicy.json +# x-ms-original-file: 2025-02-01-preview/UpdateShortTermRetentionPolicy.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py index 1202003ce7be..fb12fcddf2fc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/update_virtual_cluster_dns_servers.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.begin_update_dns_servers( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpdateVirtualClusterDnsServers.json +# x-ms-original-file: 2025-02-01-preview/UpdateVirtualClusterDnsServers.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py index 7c839e487840..14f98446c552 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/upgrade_data_warehouse.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,18 +25,19 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) - client.databases.begin_upgrade_data_warehouse( + response = client.databases.begin_upgrade_data_warehouse( resource_group_name="Default-SQL-SouthEastAsia", server_name="testsvr", database_name="testdwdb", ).result() + print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/UpgradeDataWarehouse.json +# x-ms-original-file: 2025-02-01-preview/UpgradeDataWarehouse.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py index 2c81842dd023..fc1a8179f1ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_create.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.begin_create_or_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterCreate.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterCreate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py index f775bb40bcd4..2d5d670c8c47 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.virtual_clusters.begin_delete( @@ -37,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterDelete.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py index 6531dcf4cf6d..d8b6e1f853a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.get( @@ -38,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterGet.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py index a532343eaf93..94e96abb9797 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444b", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.list() @@ -36,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterList.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py index d9b82b88cfa7..6fa3d30d3f36 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_list_by_resource_group.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444b", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.list_by_resource_group( @@ -38,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterListByResourceGroup.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py index 97861b51411b..ff518166f32b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_cluster_update.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444b", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_clusters.begin_update( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualClusterUpdate.json +# x-ms-original-file: 2025-02-01-preview/VirtualClusterUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py index cf448b924b15..8c213fe933ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_create_or_update.py @@ -3,13 +3,13 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +26,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_network_rules.begin_create_or_update( @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesCreateOrUpdate.json +# x-ms-original-file: 2025-02-01-preview/VirtualNetworkRulesCreateOrUpdate.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py index c56c1dc6a7fb..194d60e99954 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_delete.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) client.virtual_network_rules.begin_delete( @@ -38,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesDelete.json +# x-ms-original-file: 2025-02-01-preview/VirtualNetworkRulesDelete.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py index f88454eb4167..23dd311da7f9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_get.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_network_rules.get( @@ -39,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesGet.json +# x-ms-original-file: 2025-02-01-preview/VirtualNetworkRulesGet.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py index ab9d8a5ee592..54a587f91d25 100644 --- a/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py +++ b/sdk/sql/azure-mgmt-sql/generated_samples/virtual_network_rules_list.py @@ -1,15 +1,14 @@ -# pylint: disable=line-too-long,useless-suppression # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- from azure.identity import DefaultAzureCredential -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient """ # PREREQUISITES @@ -26,9 +25,9 @@ def main(): - client = SqlManagementClient( + client = SqlClient( credential=DefaultAzureCredential(), - subscription_id="00000000-1111-2222-3333-444444444444", + subscription_id="SUBSCRIPTION_ID", ) response = client.virtual_network_rules.list_by_server( @@ -39,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/sql/resource-manager/Microsoft.Sql/SQL/stable/2025-01-01/examples/VirtualNetworkRulesList.json +# x-ms-original-file: 2025-02-01-preview/VirtualNetworkRulesList.json if __name__ == "__main__": main() diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/conftest.py b/sdk/sql/azure-mgmt-sql/generated_tests/conftest.py index bb1c3e7c121f..d51c28ce648b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/conftest.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/conftest.py @@ -2,7 +2,7 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import os @@ -21,14 +21,14 @@ # For security, please avoid record sensitive identity information in recordings @pytest.fixture(scope="session", autouse=True) def add_sanitizers(test_proxy): - sqlmanagement_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - sqlmanagement_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - sqlmanagement_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - sqlmanagement_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=sqlmanagement_subscription_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=sqlmanagement_tenant_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=sqlmanagement_client_id, value="00000000-0000-0000-0000-000000000000") - add_general_regex_sanitizer(regex=sqlmanagement_client_secret, value="00000000-0000-0000-0000-000000000000") + sql_subscription_id = os.environ.get("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") + sql_tenant_id = os.environ.get("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") + sql_client_id = os.environ.get("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") + sql_client_secret = os.environ.get("AZURE_CLIENT_SECRET", "00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=sql_subscription_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=sql_tenant_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=sql_client_id, value="00000000-0000-0000-0000-000000000000") + add_general_regex_sanitizer(regex=sql_client_secret, value="00000000-0000-0000-0000-000000000000") add_header_regex_sanitizer(key="Set-Cookie", value="[set-cookie;]") add_header_regex_sanitizer(key="Cookie", value="cookie;") diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations.py similarity index 67% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations.py index 22e53017dd93..3a80e87db8b2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementBackupShortTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlBackupShortTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_backup_short_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,8 +39,20 @@ def test_backup_short_term_retention_policies_begin_create_or_update(self, resou server_name="str", database_name="str", policy_name="str", - parameters={"diffBackupIntervalInHours": 0, "id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"diffBackupIntervalInHours": 0, "retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -68,9 +66,33 @@ def test_backup_short_term_retention_policies_begin_update(self, resource_group) server_name="str", database_name="str", policy_name="str", - parameters={"diffBackupIntervalInHours": 0, "id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"diffBackupIntervalInHours": 0, "retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations_async.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations_async.py index 48761dc99421..faa76c6345b1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_backup_short_term_retention_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_backup_short_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,13 +42,19 @@ async def test_backup_short_term_retention_policies_begin_create_or_update(self, database_name="str", policy_name="str", parameters={ - "diffBackupIntervalInHours": 0, "id": "str", "name": "str", - "retentionDays": 0, + "properties": {"diffBackupIntervalInHours": 0, "retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -79,15 +71,33 @@ async def test_backup_short_term_retention_policies_begin_update(self, resource_ database_name="str", policy_name="str", parameters={ - "diffBackupIntervalInHours": 0, "id": "str", "name": "str", - "retentionDays": 0, + "properties": {"diffBackupIntervalInHours": 0, "retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations.py index e7713c679950..f1262e7063f7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,16 +14,15 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementCapabilitiesOperations(AzureMgmtRecordedTestCase): +class TestSqlCapabilitiesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_capabilities_list_by_location(self, resource_group): response = self.client.capabilities.list_by_location( location_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations_async.py index be4691665ec1..05db0a18872e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_capabilities_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_capabilities_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,16 +15,15 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementCapabilitiesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlCapabilitiesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_capabilities_list_by_location(self, resource_group): response = await self.client.capabilities.list_by_location( location_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations.py similarity index 69% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations.py index c4a434848d19..ecdfba4acac3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataMaskingPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlDataMaskingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_data_masking_policies_get(self, resource_group): server_name="str", database_name="str", data_masking_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,17 +40,26 @@ def test_data_masking_policies_create_or_update(self, resource_group): database_name="str", data_masking_policy_name="str", parameters={ - "applicationPrincipals": "str", - "dataMaskingState": "str", - "exemptPrincipals": "str", "id": "str", "kind": "str", "location": "str", - "maskingLevel": "str", "name": "str", + "properties": { + "dataMaskingState": "str", + "applicationPrincipals": "str", + "exemptPrincipals": "str", + "maskingLevel": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations_async.py similarity index 69% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations_async.py index b635763e1c4f..49cf96947383 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataMaskingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDataMaskingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_data_masking_policies_get(self, resource_group): server_name="str", database_name="str", data_masking_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -42,17 +41,26 @@ async def test_data_masking_policies_create_or_update(self, resource_group): database_name="str", data_masking_policy_name="str", parameters={ - "applicationPrincipals": "str", - "dataMaskingState": "str", - "exemptPrincipals": "str", "id": "str", "kind": "str", "location": "str", - "maskingLevel": "str", "name": "str", + "properties": { + "dataMaskingState": "str", + "applicationPrincipals": "str", + "exemptPrincipals": "str", + "maskingLevel": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations.py index 7a8b89340175..a89f22fb8c55 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataMaskingRulesOperations(AzureMgmtRecordedTestCase): +class TestSqlDataMaskingRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_data_masking_rules_list_by_database(self, resource_group): server_name="str", database_name="str", data_masking_policy_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -42,24 +41,26 @@ def test_data_masking_rules_create_or_update(self, resource_group): data_masking_policy_name="str", data_masking_rule_name="str", parameters={ - "aliasName": "str", - "columnName": "str", "id": "str", "kind": "str", "location": "str", - "maskingFunction": "str", "name": "str", - "numberFrom": "str", - "numberTo": "str", - "prefixSize": "str", - "replacementString": "str", - "ruleState": "str", - "schemaName": "str", - "suffixSize": "str", - "tableName": "str", + "properties": { + "columnName": "str", + "maskingFunction": "str", + "schemaName": "str", + "tableName": "str", + "aliasName": "str", + "id": "str", + "numberFrom": "str", + "numberTo": "str", + "prefixSize": "str", + "replacementString": "str", + "ruleState": "str", + "suffixSize": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations_async.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations_async.py index 972bb1724fa0..6a9c9e783225 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_masking_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_masking_rules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataMaskingRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDataMaskingRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_data_masking_rules_list_by_database(self, resource_group): server_name="str", database_name="str", data_masking_policy_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -43,24 +42,26 @@ async def test_data_masking_rules_create_or_update(self, resource_group): data_masking_policy_name="str", data_masking_rule_name="str", parameters={ - "aliasName": "str", - "columnName": "str", "id": "str", "kind": "str", "location": "str", - "maskingFunction": "str", "name": "str", - "numberFrom": "str", - "numberTo": "str", - "prefixSize": "str", - "replacementString": "str", - "ruleState": "str", - "schemaName": "str", - "suffixSize": "str", - "tableName": "str", + "properties": { + "columnName": "str", + "maskingFunction": "str", + "schemaName": "str", + "tableName": "str", + "aliasName": "str", + "id": "str", + "numberFrom": "str", + "numberTo": "str", + "prefixSize": "str", + "replacementString": "str", + "ruleState": "str", + "suffixSize": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations.py index b4027509dd7b..700fda80815a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,33 +14,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataWarehouseUserActivitiesOperations(AzureMgmtRecordedTestCase): +class TestSqlDataWarehouseUserActivitiesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_data_warehouse_user_activities_list_by_database(self, resource_group): - response = self.client.data_warehouse_user_activities.list_by_database( + def test_data_warehouse_user_activities_get(self, resource_group): + response = self.client.data_warehouse_user_activities.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + data_warehouse_user_activity_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_data_warehouse_user_activities_get(self, resource_group): - response = self.client.data_warehouse_user_activities.get( + def test_data_warehouse_user_activities_list_by_database(self, resource_group): + response = self.client.data_warehouse_user_activities.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - data_warehouse_user_activity_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations_async.py index a8c686cc5826..c5340b1445f4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_data_warehouse_user_activities_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_data_warehouse_user_activities_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,33 +15,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDataWarehouseUserActivitiesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDataWarehouseUserActivitiesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_data_warehouse_user_activities_list_by_database(self, resource_group): - response = self.client.data_warehouse_user_activities.list_by_database( + async def test_data_warehouse_user_activities_get(self, resource_group): + response = await self.client.data_warehouse_user_activities.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + data_warehouse_user_activity_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_data_warehouse_user_activities_get(self, resource_group): - response = await self.client.data_warehouse_user_activities.get( + async def test_data_warehouse_user_activities_list_by_database(self, resource_group): + response = self.client.data_warehouse_user_activities.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - data_warehouse_user_activity_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations.py index f52193841fd1..e899db63a4ae 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_advanced_threat_protection_settings_list_by_database(self, resource_group): - response = self.client.database_advanced_threat_protection_settings.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_database_advanced_threat_protection_settings_get(self, resource_group): server_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,10 +40,9 @@ def test_database_advanced_threat_protection_settings_create_or_update(self, res database_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,8 +53,19 @@ def test_database_advanced_threat_protection_settings_create_or_update(self, res }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_advanced_threat_protection_settings_list_by_database(self, resource_group): + response = self.client.database_advanced_threat_protection_settings.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations_async.py index 2f4931fe6ef6..3d8c6c2795a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advanced_threat_protection_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_advanced_threat_protection_settings_list_by_database(self, resource_group): - response = self.client.database_advanced_threat_protection_settings.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_database_advanced_threat_protection_settings_get(self, resource_g server_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,10 +41,9 @@ async def test_database_advanced_threat_protection_settings_create_or_update(sel database_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -69,8 +54,19 @@ async def test_database_advanced_threat_protection_settings_create_or_update(sel }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_advanced_threat_protection_settings_list_by_database(self, resource_group): + response = self.client.database_advanced_threat_protection_settings.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations.py new file mode 100644 index 000000000000..68eb5e95afd7 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations.py @@ -0,0 +1,149 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDatabaseAdvisorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_advisors_get(self, resource_group): + response = self.client.database_advisors.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_advisors_update(self, resource_group): + response = self.client.database_advisors.update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "autoExecuteStatus": "str", + "advisorStatus": "str", + "autoExecuteStatusInheritedFrom": "str", + "lastChecked": "2020-02-20 00:00:00", + "recommendationsStatus": "str", + "recommendedActions": [ + { + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": { + "currentValue": "str", + "actionInitiatedBy": "str", + "lastModified": "2020-02-20 00:00:00", + }, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_advisors_list_by_database(self, resource_group): + response = self.client.database_advisors.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations_async.py new file mode 100644 index 000000000000..f46a6959cb78 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_advisors_operations_async.py @@ -0,0 +1,150 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDatabaseAdvisorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_advisors_get(self, resource_group): + response = await self.client.database_advisors.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_advisors_update(self, resource_group): + response = await self.client.database_advisors.update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "autoExecuteStatus": "str", + "advisorStatus": "str", + "autoExecuteStatusInheritedFrom": "str", + "lastChecked": "2020-02-20 00:00:00", + "recommendationsStatus": "str", + "recommendedActions": [ + { + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": { + "currentValue": "str", + "actionInitiatedBy": "str", + "lastModified": "2020-02-20 00:00:00", + }, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_advisors_list_by_database(self, resource_group): + response = await self.client.database_advisors.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations.py index 516f81b39cca..dac4d4336892 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAutomaticTuningOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseAutomaticTuningOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_database_automatic_tuning_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -39,14 +38,25 @@ def test_database_automatic_tuning_update(self, resource_group): server_name="str", database_name="str", parameters={ - "actualState": "str", - "desiredState": "str", "id": "str", "name": "str", - "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, + "properties": { + "actualState": "str", + "desiredState": "str", + "options": { + "str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"} + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations_async.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations_async.py index 66109395e420..079307b72044 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_automatic_tuning_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_automatic_tuning_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAutomaticTuningOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseAutomaticTuningOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_database_automatic_tuning_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,14 +39,25 @@ async def test_database_automatic_tuning_update(self, resource_group): server_name="str", database_name="str", parameters={ - "actualState": "str", - "desiredState": "str", "id": "str", "name": "str", - "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, + "properties": { + "actualState": "str", + "desiredState": "str", + "options": { + "str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"} + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations.py index c0f53c9fd182..486f771a2c9a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_blob_auditing_policies_list_by_database(self, resource_group): - response = self.client.database_blob_auditing_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -38,8 +25,7 @@ def test_database_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -52,25 +38,46 @@ def test_database_blob_auditing_policies_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "kind": "str", "name": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_blob_auditing_policies_list_by_database(self, resource_group): + response = self.client.database_blob_auditing_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations_async.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations_async.py index dd7cf49c448f..36b436f905d5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_blob_auditing_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_blob_auditing_policies_list_by_database(self, resource_group): - response = self.client.database_blob_auditing_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -39,8 +26,7 @@ async def test_database_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -53,25 +39,46 @@ async def test_database_blob_auditing_policies_create_or_update(self, resource_g resource_group_name=resource_group.name, server_name="str", database_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "kind": "str", "name": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_blob_auditing_policies_list_by_database(self, resource_group): + response = self.client.database_blob_auditing_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations.py index fcc47b955da2..9a2dbdc22267 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,20 +14,22 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseColumnsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseColumnsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_columns_list_by_database(self, resource_group): - response = self.client.database_columns.list_by_database( + def test_database_columns_get(self, resource_group): + response = self.client.database_columns.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -40,7 +42,6 @@ def test_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -48,16 +49,12 @@ def test_database_columns_list_by_table(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_columns_get(self, resource_group): - response = self.client.database_columns.get( + def test_database_columns_list_by_database(self, resource_group): + response = self.client.database_columns.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations_async.py index 06e22f4c4476..1b423ea79faf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_columns_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_columns_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,20 +15,22 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseColumnsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseColumnsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_columns_list_by_database(self, resource_group): - response = self.client.database_columns.list_by_database( + async def test_database_columns_get(self, resource_group): + response = await self.client.database_columns.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -41,7 +43,6 @@ async def test_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -49,16 +50,12 @@ async def test_database_columns_list_by_table(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_columns_get(self, resource_group): - response = await self.client.database_columns.get( + async def test_database_columns_list_by_database(self, resource_group): + response = self.client.database_columns.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations.py index fd7221175062..a24b52d6e385 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_database_encryption_protectors_begin_revalidate(self, resource_group): server_name="str", database_name="str", encryption_protector_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -40,7 +39,6 @@ def test_database_encryption_protectors_begin_revert(self, resource_group): server_name="str", database_name="str", encryption_protector_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations_async.py index c2f17aa38a46..c4d8b5cc1041 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_encryption_protectors_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -28,7 +28,6 @@ async def test_database_encryption_protectors_begin_revalidate(self, resource_gr server_name="str", database_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -44,7 +43,6 @@ async def test_database_encryption_protectors_begin_revert(self, resource_group) server_name="str", database_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations.py index 5023ad28ee0b..e144bbcb06d2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseExtensionsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseExtensionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_extensions_list_by_database(self, resource_group): - response = self.client.database_extensions.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_database_extensions_get(self, resource_group): server_name="str", database_name="str", extension_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,23 +40,36 @@ def test_database_extensions_begin_create_or_update(self, resource_group): database_name="str", extension_name="str", parameters={ - "administratorLogin": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "databaseEdition": "str", "id": "str", - "maxSizeBytes": "str", "name": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - "operationMode": "str", - "serviceObjectiveName": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", + "properties": { + "operationMode": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLogin": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseEdition": "str", + "maxSizeBytes": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + "serviceObjectiveName": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_extensions_list_by_database(self, resource_group): + response = self.client.database_extensions.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations_async.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations_async.py index a6a2d44ffdf3..15cb0f9727ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_extensions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_extensions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseExtensionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseExtensionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_extensions_list_by_database(self, resource_group): - response = self.client.database_extensions.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_database_extensions_get(self, resource_group): server_name="str", database_name="str", extension_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,24 +42,37 @@ async def test_database_extensions_begin_create_or_update(self, resource_group): database_name="str", extension_name="str", parameters={ - "administratorLogin": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "databaseEdition": "str", "id": "str", - "maxSizeBytes": "str", "name": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - "operationMode": "str", - "serviceObjectiveName": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", + "properties": { + "operationMode": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLogin": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseEdition": "str", + "maxSizeBytes": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + "serviceObjectiveName": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_extensions_list_by_database(self, resource_group): + response = self.client.database_extensions.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations.py index c89a13bb52a4..8210ae504f7c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_database_operations_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +38,6 @@ def test_database_operations_cancel(self, resource_group): server_name="str", database_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations_async.py index 170a24144be6..9bff342112c8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_database_operations_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +39,6 @@ async def test_database_operations_cancel(self, resource_group): server_name="str", database_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations.py new file mode 100644 index 000000000000..aaee4c6450e0 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations.py @@ -0,0 +1,124 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDatabaseRecommendedActionsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_recommended_actions_get(self, resource_group): + response = self.client.database_recommended_actions.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + recommended_action_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_recommended_actions_update(self, resource_group): + response = self.client.database_recommended_actions.update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + recommended_action_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": {"currentValue": "str", "actionInitiatedBy": "str", "lastModified": "2020-02-20 00:00:00"}, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_recommended_actions_list_by_database_advisor(self, resource_group): + response = self.client.database_recommended_actions.list_by_database_advisor( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations_async.py new file mode 100644 index 000000000000..54a7e8729dde --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_recommended_actions_operations_async.py @@ -0,0 +1,125 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDatabaseRecommendedActionsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_recommended_actions_get(self, resource_group): + response = await self.client.database_recommended_actions.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + recommended_action_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_recommended_actions_update(self, resource_group): + response = await self.client.database_recommended_actions.update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + recommended_action_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": {"currentValue": "str", "actionInitiatedBy": "str", "lastModified": "2020-02-20 00:00:00"}, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_recommended_actions_list_by_database_advisor(self, resource_group): + response = await self.client.database_recommended_actions.list_by_database_advisor( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations.py index ab4b76d06952..f53b0f091904 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,33 +14,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSchemasOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSchemasOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_schemas_list_by_database(self, resource_group): - response = self.client.database_schemas.list_by_database( + def test_database_schemas_get(self, resource_group): + response = self.client.database_schemas.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_schemas_get(self, resource_group): - response = self.client.database_schemas.get( + def test_database_schemas_list_by_database(self, resource_group): + response = self.client.database_schemas.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - schema_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations_async.py index b0bb0a224bd6..6ddc95a756b4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_schemas_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_schemas_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,33 +15,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSchemasOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSchemasOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_schemas_list_by_database(self, resource_group): - response = self.client.database_schemas.list_by_database( + async def test_database_schemas_get(self, resource_group): + response = await self.client.database_schemas.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_schemas_get(self, resource_group): - response = await self.client.database_schemas.get( + async def test_database_schemas_list_by_database(self, resource_group): + response = self.client.database_schemas.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - schema_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations.py index c27d1855adac..74c5c1870c0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_database_security_alert_policies_get(self, resource_group): server_name="str", database_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,16 +40,18 @@ def test_database_security_alert_policies_create_or_update(self, resource_group) database_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,8 +62,19 @@ def test_database_security_alert_policies_create_or_update(self, resource_group) }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations_async.py index b8303ee792be..f46d75d0f732 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_security_alert_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_database_security_alert_policies_get(self, resource_group): server_name="str", database_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,16 +41,18 @@ async def test_database_security_alert_policies_create_or_update(self, resource_ database_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,8 +63,19 @@ async def test_database_security_alert_policies_create_or_update(self, resource_ }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations.py index 915ae422c5ae..8c8b356acd87 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,23 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - vulnerability_assessment_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -41,7 +27,6 @@ def test_database_sql_vulnerability_assessment_baselines_get(self, resource_grou database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,9 +43,8 @@ def test_database_sql_vulnerability_assessment_baselines_create_or_update(self, baseline_name="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": {"str": [["str"]]}, + "properties": {"latestScan": bool, "results": {"str": [["str"]]}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,8 +55,20 @@ def test_database_sql_vulnerability_assessment_baselines_create_or_update(self, }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + vulnerability_assessment_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations_async.py index 79d7efe68221..3507ce577b04 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,25 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment( - self, resource_group - ): - response = self.client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - vulnerability_assessment_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -44,7 +28,6 @@ async def test_database_sql_vulnerability_assessment_baselines_get(self, resourc database_name="str", vulnerability_assessment_name="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,9 +44,8 @@ async def test_database_sql_vulnerability_assessment_baselines_create_or_update( baseline_name="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": {"str": [["str"]]}, + "properties": {"latestScan": bool, "results": {"str": [["str"]]}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,8 +56,22 @@ async def test_database_sql_vulnerability_assessment_baselines_create_or_update( }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_sql_vulnerability_assessment_baselines_list_by_sql_vulnerability_assessment( + self, resource_group + ): + response = self.client.database_sql_vulnerability_assessment_baselines.list_by_sql_vulnerability_assessment( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + vulnerability_assessment_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations.py index 056165839df3..be2d88d88bf2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentExecuteScanOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentExecuteScanOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_database_sql_vulnerability_assessment_execute_scan_begin_execute(self, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations_async.py index 027f4cd978ea..704f342a1a8f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_execute_scan_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_execute_scan_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentExecuteScanOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentExecuteScanOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -28,7 +28,6 @@ async def test_database_sql_vulnerability_assessment_execute_scan_begin_execute( server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations.py index 6e25bb0096b9..02c8acef4e6d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,24 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - vulnerability_assessment_name="str", - baseline_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -43,7 +28,6 @@ def test_database_sql_vulnerability_assessment_rule_baselines_get(self, resource vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,9 +45,8 @@ def test_database_sql_vulnerability_assessment_rule_baselines_create_or_update(s rule_id="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": [["str"]], + "properties": {"latestScan": bool, "results": [["str"]]}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,7 +57,6 @@ def test_database_sql_vulnerability_assessment_rule_baselines_create_or_update(s }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -90,8 +72,21 @@ def test_database_sql_vulnerability_assessment_rule_baselines_delete(self, resou vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + vulnerability_assessment_name="str", + baseline_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations_async.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations_async.py index e73a6250db52..310122a0642b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_rule_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,24 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - vulnerability_assessment_name="str", - baseline_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -44,7 +29,6 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_get(self, re vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,9 +46,8 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_create_or_up rule_id="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": [["str"]], + "properties": {"latestScan": bool, "results": [["str"]]}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -75,7 +58,6 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_create_or_up }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -91,8 +73,21 @@ async def test_database_sql_vulnerability_assessment_rule_baselines_delete(self, vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_sql_vulnerability_assessment_rule_baselines_list_by_baseline(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_rule_baselines.list_by_baseline( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + vulnerability_assessment_name="str", + baseline_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations.py index eb74cbf1bf26..52422404cefa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,37 +14,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentScanResultOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentScanResultOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_scan_result.list_by_scan( + def test_database_sql_vulnerability_assessment_scan_result_get(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_scan_result.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", + scan_result_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessment_scan_result_get(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_scan_result.get( + def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_scan_result.list_by_scan( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - scan_result_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations_async.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations_async.py index 862041ed5f87..65905fa53df2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scan_result_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scan_result_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,37 +15,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentScanResultOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentScanResultOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_scan_result.list_by_scan( + async def test_database_sql_vulnerability_assessment_scan_result_get(self, resource_group): + response = await self.client.database_sql_vulnerability_assessment_scan_result.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", + scan_result_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_scan_result_get(self, resource_group): - response = await self.client.database_sql_vulnerability_assessment_scan_result.get( + async def test_database_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_scan_result.list_by_scan( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", scan_id="str", - scan_result_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations.py index 64c04b595154..bb6d79f065cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + def test_database_sql_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.database_sql_vulnerability_assessment_scans.get( + def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): + response = self.client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations_async.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations_async.py index 8fdcf64102a0..f20749d168d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessment_scans_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,37 +15,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments( - self, resource_group - ): - response = self.client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + async def test_database_sql_vulnerability_assessment_scans_get(self, resource_group): + response = await self.client.database_sql_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessment_scans_get(self, resource_group): - response = await self.client.database_sql_vulnerability_assessment_scans.get( + async def test_database_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments( + self, resource_group + ): + response = self.client.database_sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations.py index 81526b236ac7..637dba256521 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,33 +14,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentsSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentsSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessments_settings_list_by_database(self, resource_group): - response = self.client.database_sql_vulnerability_assessments_settings.list_by_database( + def test_database_sql_vulnerability_assessments_settings_get(self, resource_group): + response = self.client.database_sql_vulnerability_assessments_settings.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + vulnerability_assessment_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_sql_vulnerability_assessments_settings_get(self, resource_group): - response = self.client.database_sql_vulnerability_assessments_settings.get( + def test_database_sql_vulnerability_assessments_settings_list_by_database(self, resource_group): + response = self.client.database_sql_vulnerability_assessments_settings.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - vulnerability_assessment_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations_async.py index 242a7d5f92d7..09963a00004d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_sql_vulnerability_assessments_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_sql_vulnerability_assessments_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,33 +15,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseSqlVulnerabilityAssessmentsSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseSqlVulnerabilityAssessmentsSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessments_settings_list_by_database(self, resource_group): - response = self.client.database_sql_vulnerability_assessments_settings.list_by_database( + async def test_database_sql_vulnerability_assessments_settings_get(self, resource_group): + response = await self.client.database_sql_vulnerability_assessments_settings.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + vulnerability_assessment_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_sql_vulnerability_assessments_settings_get(self, resource_group): - response = await self.client.database_sql_vulnerability_assessments_settings.get( + async def test_database_sql_vulnerability_assessments_settings_list_by_database(self, resource_group): + response = self.client.database_sql_vulnerability_assessments_settings.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - vulnerability_assessment_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations.py index a26a4c23fa1c..dce94cbb74f8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseTablesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseTablesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_tables_list_by_schema(self, resource_group): - response = self.client.database_tables.list_by_schema( + def test_database_tables_get(self, resource_group): + response = self.client.database_tables.get( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", - api_version="2025-01-01", + table_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_tables_get(self, resource_group): - response = self.client.database_tables.get( + def test_database_tables_list_by_schema(self, resource_group): + response = self.client.database_tables.list_by_schema( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", - table_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations_async.py index e5946841be80..6b7fa9b42bd3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_tables_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_tables_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,35 +15,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseTablesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseTablesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_tables_list_by_schema(self, resource_group): - response = self.client.database_tables.list_by_schema( + async def test_database_tables_get(self, resource_group): + response = await self.client.database_tables.get( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", - api_version="2025-01-01", + table_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_tables_get(self, resource_group): - response = await self.client.database_tables.get( + async def test_database_tables_list_by_schema(self, resource_group): + response = self.client.database_tables.list_by_schema( resource_group_name=resource_group.name, server_name="str", database_name="str", schema_name="str", - table_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations.py index 2e1b2d1e86d6..2da24762216e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseUsagesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseUsagesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_database_usages_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations_async.py index a3c28274d356..7273560637cb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_usages_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseUsagesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseUsagesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_database_usages_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations.py index fb183e31d79a..f19b3a9753e4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -28,7 +28,6 @@ def test_database_vulnerability_assessment_rule_baselines_get(self, resource_gro vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -44,8 +43,20 @@ def test_database_vulnerability_assessment_rule_baselines_create_or_update(self, vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"baselineResults": [{"result": ["str"]}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -61,7 +72,6 @@ def test_database_vulnerability_assessment_rule_baselines_delete(self, resource_ vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations_async.py index f0d1bf5249be..e3ee73196abf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_rule_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -29,7 +29,6 @@ async def test_database_vulnerability_assessment_rule_baselines_get(self, resour vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,8 +44,20 @@ async def test_database_vulnerability_assessment_rule_baselines_create_or_update vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"baselineResults": [{"result": ["str"]}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -62,7 +73,6 @@ async def test_database_vulnerability_assessment_rule_baselines_delete(self, res vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations.py index d7f795f0d947..656717892140 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,36 +14,34 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.list_by_database( + def test_database_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_database_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.get( + def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -56,7 +54,6 @@ def test_database_vulnerability_assessment_scans_export(self, resource_group): database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,7 +68,6 @@ def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, resou database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations_async.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations_async.py index 107e0382fedf..07adb35d45b2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessment_scans_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,36 +15,34 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessment_scans.list_by_database( + async def test_database_vulnerability_assessment_scans_get(self, resource_group): + response = await self.client.database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_database_vulnerability_assessment_scans_get(self, resource_group): - response = await self.client.database_vulnerability_assessment_scans.get( + async def test_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -57,7 +55,6 @@ async def test_database_vulnerability_assessment_scans_export(self, resource_gro database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -73,7 +70,6 @@ async def test_database_vulnerability_assessment_scans_begin_initiate_scan(self, database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations.py index ca3946ad9a74..21c4486ba00e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_database_vulnerability_assessments_get(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,13 +42,22 @@ def test_database_vulnerability_assessments_create_or_update(self, resource_grou parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerPath": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,8 +71,19 @@ def test_database_vulnerability_assessments_delete(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations_async.py index 48fa8ea31cdf..f2208760dc1c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_database_vulnerability_assessments_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabaseVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_database_vulnerability_assessments_get(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,13 +43,22 @@ async def test_database_vulnerability_assessments_create_or_update(self, resourc parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerPath": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -77,8 +72,19 @@ async def test_database_vulnerability_assessments_delete(self, resource_group): server_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations.py similarity index 60% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations.py index 870cd15853a8..46e6ea63c8eb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations.py @@ -2,58 +2,53 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql import SqlClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy AZURE_LOCATION = "eastus" @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_list_by_server(self, resource_group): - response = self.client.databases.list_by_server( + @recorded_by_proxy + def test_databases_get(self, resource_group): + response = self.client.databases.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_get(self, resource_group): - response = await self.client.databases.get( + @recorded_by_proxy + def test_databases_begin_create_or_update(self, resource_group): + response = self.client.databases.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_create_or_update(self, resource_group): - response = await ( - await self.client.databases.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "location": "str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "kind": "str", + "managedBy": "str", + "name": "str", + "properties": { "autoPauseDelay": 0, "availabilityZone": "str", "catalogCollation": "str", @@ -73,12 +68,6 @@ async def test_databases_begin_create_or_update(self, resource_group): "federatedClientId": "str", "freeLimitExhaustionBehavior": "str", "highAvailabilityReplicaCount": 0, - "id": "str", - "identity": { - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "isInfraEncryptionEnabled": bool, "isLedgerOn": bool, "keys": { @@ -90,19 +79,17 @@ async def test_databases_begin_create_or_update(self, resource_group): "type": "str", } }, - "kind": "str", "licenseType": "str", "longTermRetentionBackupResourceId": "str", "maintenanceConfigurationId": "str", - "managedBy": "str", "manualCutover": bool, "maxLogSizeBytes": 0, "maxSizeBytes": 0, "minCapacity": 0.0, - "name": "str", "pausedDate": "2020-02-20 00:00:00", "performCutover": bool, "preferredEnclaveType": "str", + "provisioningState": "str", "readScale": "str", "recoverableDatabaseId": "str", "recoveryServicesRecoveryPointId": "str", @@ -113,47 +100,44 @@ async def test_databases_begin_create_or_update(self, resource_group): "resumedDate": "2020-02-20 00:00:00", "sampleName": "str", "secondaryType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", "sourceDatabaseId": "str", "sourceResourceId": "str", "status": "str", - "tags": {"str": "str"}, - "type": "str", "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_delete(self, resource_group): - response = await ( - await self.client.databases.begin_delete( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_update(self, resource_group): - response = await ( - await self.client.databases.begin_update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ + @recorded_by_proxy + def test_databases_begin_update(self, resource_group): + response = self.client.databases.begin_update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "identity": { + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { "autoPauseDelay": 0, "catalogCollation": "str", "collation": "str", @@ -172,11 +156,6 @@ async def test_databases_begin_update(self, resource_group): "federatedClientId": "str", "freeLimitExhaustionBehavior": "str", "highAvailabilityReplicaCount": 0, - "identity": { - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "isInfraEncryptionEnabled": bool, "isLedgerOn": bool, "keys": { @@ -198,6 +177,7 @@ async def test_databases_begin_update(self, resource_group): "pausedDate": "2020-02-20 00:00:00", "performCutover": bool, "preferredEnclaveType": "str", + "provisioningState": "str", "readScale": "str", "recoverableDatabaseId": "str", "recoveryServicesRecoveryPointId": "str", @@ -208,164 +188,165 @@ async def test_databases_begin_update(self, resource_group): "resumedDate": "2020-02-20 00:00:00", "sampleName": "str", "secondaryType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", "sourceDatabaseId": "str", "status": "str", - "tags": {"str": "str"}, "useFreeLimit": bool, "zoneRedundant": bool, }, - api_version="2025-01-01", - ) + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_export(self, resource_group): - response = await ( - await self.client.databases.begin_export( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - }, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_begin_delete(self, resource_group): + response = self.client.databases.begin_delete( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_failover(self, resource_group): - response = await ( - await self.client.databases.begin_failover( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_list_by_server(self, resource_group): + response = self.client.databases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_databases_begin_export(self, resource_group): + response = self.client.databases.begin_export( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_import_method(self, resource_group): - response = await ( - await self.client.databases.begin_import_method( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - }, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_begin_failover(self, resource_group): + response = self.client.databases.begin_failover( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_databases_begin_import_method(self, resource_group): + response = self.client.databases.begin_import_method( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_rename(self, resource_group): - response = await self.client.databases.rename( + @recorded_by_proxy + def test_databases_rename(self, resource_group): + response = self.client.databases.rename( resource_group_name=resource_group.name, server_name="str", database_name="str", parameters={"id": "str"}, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_pause(self, resource_group): - response = await ( - await self.client.databases.begin_pause( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_begin_pause(self, resource_group): + response = self.client.databases.begin_pause( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_resume(self, resource_group): - response = await ( - await self.client.databases.begin_resume( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_begin_resume(self, resource_group): + response = self.client.databases.begin_resume( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_begin_upgrade_data_warehouse(self, resource_group): - response = await ( - await self.client.databases.begin_upgrade_data_warehouse( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_databases_begin_upgrade_data_warehouse(self, resource_group): + response = self.client.databases.begin_upgrade_data_warehouse( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_list_by_elastic_pool(self, resource_group): - response = self.client.databases.list_by_elastic_pool( + @recorded_by_proxy + def test_databases_list_inaccessible_by_server(self, resource_group): + response = self.client.databases.list_inaccessible_by_server( resource_group_name=resource_group.name, server_name="str", - elastic_pool_name="str", - api_version="2025-01-01", ) - result = [r async for r in response] + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_databases_list_inaccessible_by_server(self, resource_group): - response = self.client.databases.list_inaccessible_by_server( + @recorded_by_proxy + def test_databases_list_by_elastic_pool(self, resource_group): + response = self.client.databases.list_by_elastic_pool( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + elastic_pool_name="str", ) - result = [r async for r in response] + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations_async.py new file mode 100644 index 000000000000..5fcc5aa1a8fb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_databases_operations_async.py @@ -0,0 +1,371 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDatabasesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_get(self, resource_group): + response = await self.client.databases.get( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_create_or_update(self, resource_group): + response = await ( + await self.client.databases.begin_create_or_update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "kind": "str", + "managedBy": "str", + "name": "str", + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "currentBackupStorageRedundancy": "str", + "currentServiceObjectiveName": "str", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "databaseId": "str", + "defaultSecondaryLocation": "str", + "earliestRestoreDate": "2020-02-20 00:00:00", + "elasticPoolId": "str", + "encryptionProtector": "str", + "encryptionProtectorAutoRotation": bool, + "failoverGroupId": "str", + "federatedClientId": "str", + "freeLimitExhaustionBehavior": "str", + "highAvailabilityReplicaCount": 0, + "isInfraEncryptionEnabled": bool, + "isLedgerOn": bool, + "keys": { + "str": { + "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", + "subregion": "str", + "thumbprint": "str", + "type": "str", + } + }, + "licenseType": "str", + "longTermRetentionBackupResourceId": "str", + "maintenanceConfigurationId": "str", + "manualCutover": bool, + "maxLogSizeBytes": 0, + "maxSizeBytes": 0, + "minCapacity": 0.0, + "pausedDate": "2020-02-20 00:00:00", + "performCutover": bool, + "preferredEnclaveType": "str", + "provisioningState": "str", + "readScale": "str", + "recoverableDatabaseId": "str", + "recoveryServicesRecoveryPointId": "str", + "requestedBackupStorageRedundancy": "str", + "requestedServiceObjectiveName": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "resumedDate": "2020-02-20 00:00:00", + "sampleName": "str", + "secondaryType": "str", + "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "sourceResourceId": "str", + "status": "str", + "useFreeLimit": bool, + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_update(self, resource_group): + response = await ( + await self.client.databases.begin_update( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "identity": { + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "autoPauseDelay": 0, + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "currentBackupStorageRedundancy": "str", + "currentServiceObjectiveName": "str", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "databaseId": "str", + "defaultSecondaryLocation": "str", + "earliestRestoreDate": "2020-02-20 00:00:00", + "elasticPoolId": "str", + "encryptionProtector": "str", + "encryptionProtectorAutoRotation": bool, + "failoverGroupId": "str", + "federatedClientId": "str", + "freeLimitExhaustionBehavior": "str", + "highAvailabilityReplicaCount": 0, + "isInfraEncryptionEnabled": bool, + "isLedgerOn": bool, + "keys": { + "str": { + "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", + "subregion": "str", + "thumbprint": "str", + "type": "str", + } + }, + "licenseType": "str", + "longTermRetentionBackupResourceId": "str", + "maintenanceConfigurationId": "str", + "manualCutover": bool, + "maxLogSizeBytes": 0, + "maxSizeBytes": 0, + "minCapacity": 0.0, + "pausedDate": "2020-02-20 00:00:00", + "performCutover": bool, + "preferredEnclaveType": "str", + "provisioningState": "str", + "readScale": "str", + "recoverableDatabaseId": "str", + "recoveryServicesRecoveryPointId": "str", + "requestedBackupStorageRedundancy": "str", + "requestedServiceObjectiveName": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "resumedDate": "2020-02-20 00:00:00", + "sampleName": "str", + "secondaryType": "str", + "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "status": "str", + "useFreeLimit": bool, + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_delete(self, resource_group): + response = await ( + await self.client.databases.begin_delete( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_list_by_server(self, resource_group): + response = self.client.databases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_export(self, resource_group): + response = await ( + await self.client.databases.begin_export( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_failover(self, resource_group): + response = await ( + await self.client.databases.begin_failover( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_import_method(self, resource_group): + response = await ( + await self.client.databases.begin_import_method( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_rename(self, resource_group): + response = await self.client.databases.rename( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={"id": "str"}, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_pause(self, resource_group): + response = await ( + await self.client.databases.begin_pause( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_resume(self, resource_group): + response = await ( + await self.client.databases.begin_resume( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_begin_upgrade_data_warehouse(self, resource_group): + response = await ( + await self.client.databases.begin_upgrade_data_warehouse( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_list_inaccessible_by_server(self, resource_group): + response = self.client.databases.list_inaccessible_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_databases_list_by_elastic_pool(self, resource_group): + response = self.client.databases.list_by_elastic_pool( + resource_group_name=resource_group.name, + server_name="str", + elastic_pool_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations.py index 39e02c8eb8d6..ed74473ab84c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,17 +14,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDeletedServersOperations(AzureMgmtRecordedTestCase): +class TestSqlDeletedServersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deleted_servers_list(self, resource_group): - response = self.client.deleted_servers.list( - api_version="2025-01-01", + def test_deleted_servers_get(self, resource_group): + response = self.client.deleted_servers.get( + location_name="str", + deleted_server_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -33,7 +34,6 @@ def test_deleted_servers_list(self, resource_group): def test_deleted_servers_list_by_location(self, resource_group): response = self.client.deleted_servers.list_by_location( location_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,24 +41,19 @@ def test_deleted_servers_list_by_location(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deleted_servers_get(self, resource_group): - response = self.client.deleted_servers.get( + def test_deleted_servers_begin_recover(self, resource_group): + response = self.client.deleted_servers.begin_recover( location_name="str", deleted_server_name="str", - api_version="2025-01-01", - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_deleted_servers_begin_recover(self, resource_group): - response = self.client.deleted_servers.begin_recover( - location_name="str", - deleted_server_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + def test_deleted_servers_list(self, resource_group): + response = self.client.deleted_servers.list() + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations_async.py index ae80c389a9d8..d0185d124f0e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_deleted_servers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_deleted_servers_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,17 +15,18 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDeletedServersOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDeletedServersOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_deleted_servers_list(self, resource_group): - response = self.client.deleted_servers.list( - api_version="2025-01-01", + async def test_deleted_servers_get(self, resource_group): + response = await self.client.deleted_servers.get( + location_name="str", + deleted_server_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -34,24 +35,11 @@ async def test_deleted_servers_list(self, resource_group): async def test_deleted_servers_list_by_location(self, resource_group): response = self.client.deleted_servers.list_by_location( location_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_deleted_servers_get(self, resource_group): - response = await self.client.deleted_servers.get( - location_name="str", - deleted_server_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_deleted_servers_begin_recover(self, resource_group): @@ -59,9 +47,16 @@ async def test_deleted_servers_begin_recover(self, resource_group): await self.client.deleted_servers.begin_recover( location_name="str", deleted_server_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_deleted_servers_list(self, resource_group): + response = self.client.deleted_servers.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations.py index e3cc5648c690..7d4a6489ce0a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations.py @@ -2,57 +2,45 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql import SqlClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy AZURE_LOCATION = "eastus" @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDistributedAvailabilityGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlDistributedAvailabilityGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_list_by_instance(self, resource_group): - response = self.client.distributed_availability_groups.list_by_instance( + @recorded_by_proxy + def test_distributed_availability_groups_get(self, resource_group): + response = self.client.distributed_availability_groups.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + distributed_availability_group_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_get(self, resource_group): - response = await self.client.distributed_availability_groups.get( + @recorded_by_proxy + def test_distributed_availability_groups_begin_create_or_update(self, resource_group): + response = self.client.distributed_availability_groups.begin_create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", distributed_availability_group_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_begin_create_or_update(self, resource_group): - response = await ( - await self.client.distributed_availability_groups.begin_create_or_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={ + parameters={ + "id": "str", + "name": "str", + "properties": { "databases": [ { "connectedState": "str", @@ -81,48 +69,40 @@ async def test_distributed_availability_groups_begin_create_or_update(self, reso "distributedAvailabilityGroupId": "str", "distributedAvailabilityGroupName": "str", "failoverMode": "str", - "id": "str", "instanceAvailabilityGroupName": "str", "instanceLinkRole": "str", - "name": "str", "partnerAvailabilityGroupName": "str", "partnerEndpoint": "str", "partnerLinkRole": "str", "replicationMode": "str", "seedingMode": "str", - "type": "str", }, - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_begin_delete(self, resource_group): - response = await ( - await self.client.distributed_availability_groups.begin_delete( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - api_version="2025-01-01", - ) + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_begin_update(self, resource_group): - response = await ( - await self.client.distributed_availability_groups.begin_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={ + @recorded_by_proxy + def test_distributed_availability_groups_begin_update(self, resource_group): + response = self.client.distributed_availability_groups.begin_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={ + "id": "str", + "name": "str", + "properties": { "databases": [ { "connectedState": "str", @@ -151,51 +131,73 @@ async def test_distributed_availability_groups_begin_update(self, resource_group "distributedAvailabilityGroupId": "str", "distributedAvailabilityGroupName": "str", "failoverMode": "str", - "id": "str", "instanceAvailabilityGroupName": "str", "instanceLinkRole": "str", - "name": "str", "partnerAvailabilityGroupName": "str", "partnerEndpoint": "str", "partnerLinkRole": "str", "replicationMode": "str", "seedingMode": "str", - "type": "str", }, - api_version="2025-01-01", - ) + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_begin_failover(self, resource_group): - response = await ( - await self.client.distributed_availability_groups.begin_failover( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={"failoverType": "str"}, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_distributed_availability_groups_begin_delete(self, resource_group): + response = self.client.distributed_availability_groups.begin_delete( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_distributed_availability_groups_begin_set_role(self, resource_group): - response = await ( - await self.client.distributed_availability_groups.begin_set_role( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={"instanceRole": "str", "roleChangeType": "str"}, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_distributed_availability_groups_list_by_instance(self, resource_group): + response = self.client.distributed_availability_groups.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_distributed_availability_groups_begin_failover(self, resource_group): + response = self.client.distributed_availability_groups.begin_failover( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={"failoverType": "str"}, + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_distributed_availability_groups_begin_set_role(self, resource_group): + response = self.client.distributed_availability_groups.begin_set_role( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={"instanceRole": "str", "roleChangeType": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations_async.py new file mode 100644 index 000000000000..4888e62417af --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_distributed_availability_groups_operations_async.py @@ -0,0 +1,221 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlDistributedAvailabilityGroupsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_get(self, resource_group): + response = await self.client.distributed_availability_groups.get( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_begin_create_or_update(self, resource_group): + response = await ( + await self.client.distributed_availability_groups.begin_create_or_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={ + "id": "str", + "name": "str", + "properties": { + "databases": [ + { + "connectedState": "str", + "databaseName": "str", + "instanceRedoReplicationLagSeconds": 0, + "instanceReplicaId": "str", + "instanceSendReplicationLagSeconds": 0, + "lastBackupLsn": "str", + "lastBackupTime": "2020-02-20 00:00:00", + "lastCommitLsn": "str", + "lastCommitTime": "2020-02-20 00:00:00", + "lastHardenedLsn": "str", + "lastHardenedTime": "2020-02-20 00:00:00", + "lastReceivedLsn": "str", + "lastReceivedTime": "2020-02-20 00:00:00", + "lastSentLsn": "str", + "lastSentTime": "2020-02-20 00:00:00", + "mostRecentLinkError": "str", + "partnerAuthCertValidity": { + "certificateName": "str", + "expiryDate": "2020-02-20 00:00:00", + }, + "partnerReplicaId": "str", + "replicaState": "str", + "seedingProgress": "str", + "synchronizationHealth": "str", + } + ], + "distributedAvailabilityGroupId": "str", + "distributedAvailabilityGroupName": "str", + "failoverMode": "str", + "instanceAvailabilityGroupName": "str", + "instanceLinkRole": "str", + "partnerAvailabilityGroupName": "str", + "partnerEndpoint": "str", + "partnerLinkRole": "str", + "replicationMode": "str", + "seedingMode": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_begin_update(self, resource_group): + response = await ( + await self.client.distributed_availability_groups.begin_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={ + "id": "str", + "name": "str", + "properties": { + "databases": [ + { + "connectedState": "str", + "databaseName": "str", + "instanceRedoReplicationLagSeconds": 0, + "instanceReplicaId": "str", + "instanceSendReplicationLagSeconds": 0, + "lastBackupLsn": "str", + "lastBackupTime": "2020-02-20 00:00:00", + "lastCommitLsn": "str", + "lastCommitTime": "2020-02-20 00:00:00", + "lastHardenedLsn": "str", + "lastHardenedTime": "2020-02-20 00:00:00", + "lastReceivedLsn": "str", + "lastReceivedTime": "2020-02-20 00:00:00", + "lastSentLsn": "str", + "lastSentTime": "2020-02-20 00:00:00", + "mostRecentLinkError": "str", + "partnerAuthCertValidity": { + "certificateName": "str", + "expiryDate": "2020-02-20 00:00:00", + }, + "partnerReplicaId": "str", + "replicaState": "str", + "seedingProgress": "str", + "synchronizationHealth": "str", + } + ], + "distributedAvailabilityGroupId": "str", + "distributedAvailabilityGroupName": "str", + "failoverMode": "str", + "instanceAvailabilityGroupName": "str", + "instanceLinkRole": "str", + "partnerAvailabilityGroupName": "str", + "partnerEndpoint": "str", + "partnerLinkRole": "str", + "replicationMode": "str", + "seedingMode": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_begin_delete(self, resource_group): + response = await ( + await self.client.distributed_availability_groups.begin_delete( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_list_by_instance(self, resource_group): + response = self.client.distributed_availability_groups.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_begin_failover(self, resource_group): + response = await ( + await self.client.distributed_availability_groups.begin_failover( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={"failoverType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_distributed_availability_groups_begin_set_role(self, resource_group): + response = await ( + await self.client.distributed_availability_groups.begin_set_role( + resource_group_name=resource_group.name, + managed_instance_name="str", + distributed_availability_group_name="str", + parameters={"instanceRole": "str", "roleChangeType": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations.py index b2d7ff66dce3..cbae32eaa5d9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlElasticPoolOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +38,6 @@ def test_elastic_pool_operations_cancel(self, resource_group): server_name="str", elastic_pool_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations_async.py index bf0c7d3aef66..b856f20b9c45 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pool_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlElasticPoolOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_elastic_pool_operations_list_by_elastic_pool(self, resource_group resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +39,6 @@ async def test_elastic_pool_operations_cancel(self, resource_group): server_name="str", elastic_pool_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations.py index 4009558c5141..e2315cb919fd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolsOperations(AzureMgmtRecordedTestCase): +class TestSqlElasticPoolsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_pools_list_by_server(self, resource_group): - response = self.client.elastic_pools.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_elastic_pools_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,26 +39,36 @@ def test_elastic_pools_begin_create_or_update(self, resource_group): elastic_pool_name="str", parameters={ "location": "str", - "autoPauseDelay": 0, - "availabilityZone": "str", - "creationDate": "2020-02-20 00:00:00", - "highAvailabilityReplicaCount": 0, "id": "str", "kind": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "maxSizeBytes": 0, - "minCapacity": 0.0, "name": "str", - "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, - "preferredEnclaveType": "str", + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "creationDate": "2020-02-20 00:00:00", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "state": "str", + "zoneRedundant": bool, + }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "state": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "zoneRedundant": bool, }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -79,12 +76,28 @@ def test_elastic_pools_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_elastic_pools_begin_delete(self, resource_group): - response = self.client.elastic_pools.begin_delete( + def test_elastic_pools_begin_update(self, resource_group): + response = self.client.elastic_pools.begin_update( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,31 +105,27 @@ def test_elastic_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_elastic_pools_begin_update(self, resource_group): - response = self.client.elastic_pools.begin_update( + def test_elastic_pools_begin_delete(self, resource_group): + response = self.client.elastic_pools.begin_delete( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - parameters={ - "autoPauseDelay": 0, - "availabilityZone": "str", - "highAvailabilityReplicaCount": 0, - "licenseType": "str", - "maintenanceConfigurationId": "str", - "maxSizeBytes": 0, - "minCapacity": 0.0, - "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, - "preferredEnclaveType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "tags": {"str": "str"}, - "zoneRedundant": bool, - }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_elastic_pools_list_by_server(self, resource_group): + response = self.client.elastic_pools.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_elastic_pools_begin_failover(self, resource_group): @@ -124,7 +133,6 @@ def test_elastic_pools_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations_async.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations_async.py index 37077ea6effa..69dd1733f28e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pools_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_elastic_pools_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlElasticPoolsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_pools_list_by_server(self, resource_group): - response = self.client.elastic_pools.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_elastic_pools_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,26 +41,36 @@ async def test_elastic_pools_begin_create_or_update(self, resource_group): elastic_pool_name="str", parameters={ "location": "str", - "autoPauseDelay": 0, - "availabilityZone": "str", - "creationDate": "2020-02-20 00:00:00", - "highAvailabilityReplicaCount": 0, "id": "str", "kind": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "maxSizeBytes": 0, - "minCapacity": 0.0, "name": "str", - "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, - "preferredEnclaveType": "str", + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "creationDate": "2020-02-20 00:00:00", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "state": "str", + "zoneRedundant": bool, + }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "state": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "zoneRedundant": bool, }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -82,13 +79,29 @@ async def test_elastic_pools_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_elastic_pools_begin_delete(self, resource_group): + async def test_elastic_pools_begin_update(self, resource_group): response = await ( - await self.client.elastic_pools.begin_delete( + await self.client.elastic_pools.begin_update( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "autoPauseDelay": 0, + "availabilityZone": "str", + "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "highAvailabilityReplicaCount": 0, + "licenseType": "str", + "maintenanceConfigurationId": "str", + "maxSizeBytes": 0, + "minCapacity": 0.0, + "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, + "preferredEnclaveType": "str", + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -97,33 +110,29 @@ async def test_elastic_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_elastic_pools_begin_update(self, resource_group): + async def test_elastic_pools_begin_delete(self, resource_group): response = await ( - await self.client.elastic_pools.begin_update( + await self.client.elastic_pools.begin_delete( resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - parameters={ - "autoPauseDelay": 0, - "availabilityZone": "str", - "highAvailabilityReplicaCount": 0, - "licenseType": "str", - "maintenanceConfigurationId": "str", - "maxSizeBytes": 0, - "minCapacity": 0.0, - "perDatabaseSettings": {"autoPauseDelay": 0, "maxCapacity": 0.0, "minCapacity": 0.0}, - "preferredEnclaveType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "tags": {"str": "str"}, - "zoneRedundant": bool, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_elastic_pools_list_by_server(self, resource_group): + response = self.client.elastic_pools.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_elastic_pools_begin_failover(self, resource_group): @@ -132,7 +141,6 @@ async def test_elastic_pools_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", elastic_pool_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations.py index 92562b373f8f..5bb934c4ff0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): +class TestSqlEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_encryption_protectors_list_by_server(self, resource_group): - response = self.client.encryption_protectors.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,25 +38,45 @@ def test_encryption_protectors_begin_create_or_update(self, resource_group): server_name="str", encryption_protector_name="str", parameters={ - "autoRotationEnabled": bool, "id": "str", - "keyVersion": "str", "kind": "str", "location": "str", "name": "str", - "serverKeyName": "str", - "serverKeyType": "str", - "subregion": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "keyVersion": "str", + "serverKeyName": "str", + "subregion": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_encryption_protectors_list_by_server(self, resource_group): + response = self.client.encryption_protectors.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_encryption_protectors_begin_revalidate(self, resource_group): @@ -77,7 +84,6 @@ def test_encryption_protectors_begin_revalidate(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations_async.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations_async.py index 8d29a7bdd5a7..7af79ab27fe7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_encryption_protectors_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_encryption_protectors_list_by_server(self, resource_group): - response = self.client.encryption_protectors.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,26 +40,46 @@ async def test_encryption_protectors_begin_create_or_update(self, resource_group server_name="str", encryption_protector_name="str", parameters={ - "autoRotationEnabled": bool, "id": "str", - "keyVersion": "str", "kind": "str", "location": "str", "name": "str", - "serverKeyName": "str", - "serverKeyType": "str", - "subregion": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "keyVersion": "str", + "serverKeyName": "str", + "subregion": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_encryption_protectors_list_by_server(self, resource_group): + response = self.client.encryption_protectors.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_encryption_protectors_begin_revalidate(self, resource_group): @@ -81,7 +88,6 @@ async def test_encryption_protectors_begin_revalidate(self, resource_group): resource_group_name=resource_group.name, server_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations.py index a07e320e6fd7..2d4eab361196 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementEndpointCertificatesOperations(AzureMgmtRecordedTestCase): +class TestSqlEndpointCertificatesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_endpoint_certificates_list_by_instance(self, resource_group): - response = self.client.endpoint_certificates.list_by_instance( + def test_endpoint_certificates_get(self, resource_group): + response = self.client.endpoint_certificates.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + endpoint_type="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_endpoint_certificates_get(self, resource_group): - response = self.client.endpoint_certificates.get( + def test_endpoint_certificates_list_by_instance(self, resource_group): + response = self.client.endpoint_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - endpoint_type="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations_async.py index 78eae88b8150..351a0a63956a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_endpoint_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_endpoint_certificates_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementEndpointCertificatesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlEndpointCertificatesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_endpoint_certificates_list_by_instance(self, resource_group): - response = self.client.endpoint_certificates.list_by_instance( + async def test_endpoint_certificates_get(self, resource_group): + response = await self.client.endpoint_certificates.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + endpoint_type="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_endpoint_certificates_get(self, resource_group): - response = await self.client.endpoint_certificates.get( + async def test_endpoint_certificates_list_by_instance(self, resource_group): + response = self.client.endpoint_certificates.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - endpoint_type="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations.py similarity index 63% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations.py index 41fc99f2b7a4..4fb231b9d4e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementExtendedDatabaseBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlExtendedDatabaseBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_extended_database_blob_auditing_policies_list_by_database(self, resource_group): - response = self.client.extended_database_blob_auditing_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -38,8 +25,7 @@ def test_extended_database_blob_auditing_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -52,25 +38,46 @@ def test_extended_database_blob_auditing_policies_create_or_update(self, resourc resource_group_name=resource_group.name, server_name="str", database_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "predicateExpression": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "predicateExpression": "str", + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extended_database_blob_auditing_policies_list_by_database(self, resource_group): + response = self.client.extended_database_blob_auditing_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations_async.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations_async.py index 3445a7cb0f35..24354c05b39e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_database_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_database_blob_auditing_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementExtendedDatabaseBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlExtendedDatabaseBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_extended_database_blob_auditing_policies_list_by_database(self, resource_group): - response = self.client.extended_database_blob_auditing_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -39,8 +26,7 @@ async def test_extended_database_blob_auditing_policies_get(self, resource_group resource_group_name=resource_group.name, server_name="str", database_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -53,25 +39,46 @@ async def test_extended_database_blob_auditing_policies_create_or_update(self, r resource_group_name=resource_group.name, server_name="str", database_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "predicateExpression": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "predicateExpression": "str", + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extended_database_blob_auditing_policies_list_by_database(self, resource_group): + response = self.client.extended_database_blob_auditing_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations.py similarity index 62% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations.py index 86c62de45260..f2a3f8456f76 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementExtendedServerBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlExtendedServerBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_extended_server_blob_auditing_policies_list_by_server(self, resource_group): - response = self.client.extended_server_blob_auditing_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -36,8 +24,7 @@ def test_extended_server_blob_auditing_policies_get(self, resource_group): response = self.client.extended_server_blob_auditing_policies.get( resource_group_name=resource_group.name, server_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -49,26 +36,46 @@ def test_extended_server_blob_auditing_policies_begin_create_or_update(self, res response = self.client.extended_server_blob_auditing_policies.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isDevopsAuditEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "predicateExpression": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isDevopsAuditEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "predicateExpression": "str", + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_extended_server_blob_auditing_policies_list_by_server(self, resource_group): + response = self.client.extended_server_blob_auditing_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations_async.py similarity index 62% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations_async.py index ae7bbdff3bb5..e0c72f1349dc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_extended_server_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_extended_server_blob_auditing_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementExtendedServerBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlExtendedServerBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_extended_server_blob_auditing_policies_list_by_server(self, resource_group): - response = self.client.extended_server_blob_auditing_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -37,8 +25,7 @@ async def test_extended_server_blob_auditing_policies_get(self, resource_group): response = await self.client.extended_server_blob_auditing_policies.get( resource_group_name=resource_group.name, server_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -51,27 +38,47 @@ async def test_extended_server_blob_auditing_policies_begin_create_or_update(sel await self.client.extended_server_blob_auditing_policies.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isDevopsAuditEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "predicateExpression": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isDevopsAuditEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "predicateExpression": "str", + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_extended_server_blob_auditing_policies_list_by_server(self, resource_group): + response = self.client.extended_server_blob_auditing_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations.py index f35b5e5fb76d..e48f041e8c80 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementFailoverGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlFailoverGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_failover_groups_list_by_server(self, resource_group): - response = self.client.failover_groups.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,20 +38,29 @@ def test_failover_groups_begin_create_or_update(self, resource_group): server_name="str", failover_group_name="str", parameters={ - "databases": ["str"], "id": "str", "location": "str", "name": "str", - "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "replicationRole": "str", - "replicationState": "str", - "secondaryType": "str", + "properties": { + "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "databases": ["str"], + "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, + "replicationRole": "str", + "replicationState": "str", + "secondaryType": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,12 +68,21 @@ def test_failover_groups_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_failover_groups_begin_delete(self, resource_group): - response = self.client.failover_groups.begin_delete( + def test_failover_groups_begin_update(self, resource_group): + response = self.client.failover_groups.begin_update( resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "databases": ["str"], + "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], + "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "secondaryType": "str", + }, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -85,25 +90,27 @@ def test_failover_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_failover_groups_begin_update(self, resource_group): - response = self.client.failover_groups.begin_update( + def test_failover_groups_begin_delete(self, resource_group): + response = self.client.failover_groups.begin_delete( resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - parameters={ - "databases": ["str"], - "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "secondaryType": "str", - "tags": {"str": "str"}, - }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_failover_groups_list_by_server(self, resource_group): + response = self.client.failover_groups.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_failover_groups_begin_failover(self, resource_group): @@ -111,7 +118,6 @@ def test_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,7 +130,6 @@ def test_failover_groups_begin_force_failover_allow_data_loss(self, resource_gro resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -137,7 +142,6 @@ def test_failover_groups_begin_try_planned_before_forced_failover(self, resource resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations_async.py index 4c932fec7bf3..d5591ccba49c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_failover_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_failover_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementFailoverGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlFailoverGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_failover_groups_list_by_server(self, resource_group): - response = self.client.failover_groups.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,20 +40,29 @@ async def test_failover_groups_begin_create_or_update(self, resource_group): server_name="str", failover_group_name="str", parameters={ - "databases": ["str"], "id": "str", "location": "str", "name": "str", - "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "replicationRole": "str", - "replicationState": "str", - "secondaryType": "str", + "properties": { + "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "databases": ["str"], + "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, + "replicationRole": "str", + "replicationState": "str", + "secondaryType": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,13 +71,22 @@ async def test_failover_groups_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_failover_groups_begin_delete(self, resource_group): + async def test_failover_groups_begin_update(self, resource_group): response = await ( - await self.client.failover_groups.begin_delete( + await self.client.failover_groups.begin_update( resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "databases": ["str"], + "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], + "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "secondaryType": "str", + }, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -90,27 +95,29 @@ async def test_failover_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_failover_groups_begin_update(self, resource_group): + async def test_failover_groups_begin_delete(self, resource_group): response = await ( - await self.client.failover_groups.begin_update( + await self.client.failover_groups.begin_delete( resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - parameters={ - "databases": ["str"], - "partnerServers": [{"id": "str", "location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str", "targetServer": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "secondaryType": "str", - "tags": {"str": "str"}, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_failover_groups_list_by_server(self, resource_group): + response = self.client.failover_groups.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_failover_groups_begin_failover(self, resource_group): @@ -119,7 +126,6 @@ async def test_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -134,7 +140,6 @@ async def test_failover_groups_begin_force_failover_allow_data_loss(self, resour resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -149,7 +154,6 @@ async def test_failover_groups_begin_try_planned_before_forced_failover(self, re resource_group_name=resource_group.name, server_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations.py index 1e93cff2c54e..081769cab8a5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,32 +14,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementFirewallRulesOperations(AzureMgmtRecordedTestCase): +class TestSqlFirewallRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_list_by_server(self, resource_group): - response = self.client.firewall_rules.list_by_server( + def test_firewall_rules_get(self, resource_group): + response = self.client.firewall_rules.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + firewall_rule_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_replace(self, resource_group): - response = self.client.firewall_rules.replace( + def test_firewall_rules_create_or_update(self, resource_group): + response = self.client.firewall_rules.create_or_update( resource_group_name=resource_group.name, server_name="str", + firewall_rule_name="str", parameters={ - "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] + "id": "str", + "name": "str", + "properties": {"endIpAddress": "str", "startIpAddress": "str"}, + "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -47,12 +50,11 @@ def test_firewall_rules_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_get(self, resource_group): - response = self.client.firewall_rules.get( + def test_firewall_rules_delete(self, resource_group): + response = self.client.firewall_rules.delete( resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -60,26 +62,31 @@ def test_firewall_rules_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_create_or_update(self, resource_group): - response = self.client.firewall_rules.create_or_update( + def test_firewall_rules_list_by_server(self, resource_group): + response = self.client.firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_firewall_rules_delete(self, resource_group): - response = self.client.firewall_rules.delete( + def test_firewall_rules_replace(self, resource_group): + response = self.client.firewall_rules.replace( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - api_version="2025-01-01", + parameters={ + "values": [ + { + "id": "str", + "name": "str", + "properties": {"endIpAddress": "str", "startIpAddress": "str"}, + "type": "str", + } + ] + }, ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations_async.py index 079423ed4cdb..cf75cf0c7cbe 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_firewall_rules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,32 +15,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_list_by_server(self, resource_group): - response = self.client.firewall_rules.list_by_server( + async def test_firewall_rules_get(self, resource_group): + response = await self.client.firewall_rules.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + firewall_rule_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_replace(self, resource_group): - response = await self.client.firewall_rules.replace( + async def test_firewall_rules_create_or_update(self, resource_group): + response = await self.client.firewall_rules.create_or_update( resource_group_name=resource_group.name, server_name="str", + firewall_rule_name="str", parameters={ - "values": [{"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}] + "id": "str", + "name": "str", + "properties": {"endIpAddress": "str", "startIpAddress": "str"}, + "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -48,12 +51,11 @@ async def test_firewall_rules_replace(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_get(self, resource_group): - response = await self.client.firewall_rules.get( + async def test_firewall_rules_delete(self, resource_group): + response = await self.client.firewall_rules.delete( resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,26 +63,31 @@ async def test_firewall_rules_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_create_or_update(self, resource_group): - response = await self.client.firewall_rules.create_or_update( + async def test_firewall_rules_list_by_server(self, resource_group): + response = self.client.firewall_rules.list_by_server( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - parameters={"endIpAddress": "str", "id": "str", "name": "str", "startIpAddress": "str", "type": "str"}, - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_firewall_rules_delete(self, resource_group): - response = await self.client.firewall_rules.delete( + async def test_firewall_rules_replace(self, resource_group): + response = await self.client.firewall_rules.replace( resource_group_name=resource_group.name, server_name="str", - firewall_rule_name="str", - api_version="2025-01-01", + parameters={ + "values": [ + { + "id": "str", + "name": "str", + "properties": {"endIpAddress": "str", "startIpAddress": "str"}, + "type": "str", + } + ] + }, ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations.py index 8fe8d492078e..12da4151a29f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementGeoBackupPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlGeoBackupPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_geo_backup_policies_list(self, resource_group): - response = self.client.geo_backup_policies.list( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_geo_backup_policies_get(self, resource_group): server_name="str", database_name="str", geo_backup_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,12 +44,30 @@ def test_geo_backup_policies_create_or_update(self, resource_group): "kind": "str", "location": "str", "name": "str", - "state": "str", - "storageType": "str", + "properties": {"state": "str", "storageType": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_geo_backup_policies_list(self, resource_group): + response = self.client.geo_backup_policies.list( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations_async.py index f468cdb4eb0b..a577e5436973 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_geo_backup_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_geo_backup_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementGeoBackupPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlGeoBackupPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_geo_backup_policies_list(self, resource_group): - response = self.client.geo_backup_policies.list( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_geo_backup_policies_get(self, resource_group): server_name="str", database_name="str", geo_backup_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,12 +45,30 @@ async def test_geo_backup_policies_create_or_update(self, resource_group): "kind": "str", "location": "str", "name": "str", - "state": "str", - "storageType": "str", + "properties": {"state": "str", "storageType": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_geo_backup_policies_list(self, resource_group): + response = self.client.geo_backup_policies.list( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations.py index d3ffc0918007..beb9224682b0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstanceFailoverGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlInstanceFailoverGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_instance_failover_groups_list_by_location(self, resource_group): - response = self.client.instance_failover_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_instance_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,17 +39,26 @@ def test_instance_failover_groups_begin_create_or_update(self, resource_group): failover_group_name="str", parameters={ "id": "str", - "managedInstancePairs": [{"partnerManagedInstanceId": "str", "primaryManagedInstanceId": "str"}], "name": "str", - "partnerRegions": [{"location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "replicationRole": "str", - "replicationState": "str", - "secondaryType": "str", + "properties": { + "managedInstancePairs": [{"partnerManagedInstanceId": "str", "primaryManagedInstanceId": "str"}], + "partnerRegions": [{"location": "str", "replicationRole": "str"}], + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "readOnlyEndpoint": {"failoverPolicy": "str"}, + "replicationRole": "str", + "replicationState": "str", + "secondaryType": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,12 +71,22 @@ def test_instance_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_instance_failover_groups_list_by_location(self, resource_group): + response = self.client.instance_failover_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_instance_failover_groups_begin_failover(self, resource_group): @@ -88,7 +94,6 @@ def test_instance_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -101,7 +106,6 @@ def test_instance_failover_groups_begin_force_failover_allow_data_loss(self, res resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations_async.py index f398fd71f2fb..22e1bb6f1d1d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_failover_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_failover_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstanceFailoverGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlInstanceFailoverGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_instance_failover_groups_list_by_location(self, resource_group): - response = self.client.instance_failover_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_instance_failover_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,17 +41,28 @@ async def test_instance_failover_groups_begin_create_or_update(self, resource_gr failover_group_name="str", parameters={ "id": "str", - "managedInstancePairs": [{"partnerManagedInstanceId": "str", "primaryManagedInstanceId": "str"}], "name": "str", - "partnerRegions": [{"location": "str", "replicationRole": "str"}], - "readOnlyEndpoint": {"failoverPolicy": "str"}, - "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, - "replicationRole": "str", - "replicationState": "str", - "secondaryType": "str", + "properties": { + "managedInstancePairs": [ + {"partnerManagedInstanceId": "str", "primaryManagedInstanceId": "str"} + ], + "partnerRegions": [{"location": "str", "replicationRole": "str"}], + "readWriteEndpoint": {"failoverPolicy": "str", "failoverWithDataLossGracePeriodMinutes": 0}, + "readOnlyEndpoint": {"failoverPolicy": "str"}, + "replicationRole": "str", + "replicationState": "str", + "secondaryType": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -79,13 +77,23 @@ async def test_instance_failover_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_instance_failover_groups_list_by_location(self, resource_group): + response = self.client.instance_failover_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_instance_failover_groups_begin_failover(self, resource_group): @@ -94,7 +102,6 @@ async def test_instance_failover_groups_begin_failover(self, resource_group): resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -109,7 +116,6 @@ async def test_instance_failover_groups_begin_force_failover_allow_data_loss(sel resource_group_name=resource_group.name, location_name="str", failover_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations.py index 357be7edfe2d..cedc9f80dd18 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstancePoolOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlInstancePoolOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_instance_pool_operations_list_by_instance_pool(self, resource_group): - response = self.client.instance_pool_operations.list_by_instance_pool( + def test_instance_pool_operations_get(self, resource_group): + response = self.client.instance_pool_operations.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_instance_pool_operations_get(self, resource_group): - response = self.client.instance_pool_operations.get( + def test_instance_pool_operations_list_by_instance_pool(self, resource_group): + response = self.client.instance_pool_operations.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations_async.py index 5d7127f2b81a..5de5a8fb7fd7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pool_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pool_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstancePoolOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlInstancePoolOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_instance_pool_operations_list_by_instance_pool(self, resource_group): - response = self.client.instance_pool_operations.list_by_instance_pool( + async def test_instance_pool_operations_get(self, resource_group): + response = await self.client.instance_pool_operations.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_instance_pool_operations_get(self, resource_group): - response = await self.client.instance_pool_operations.get( + async def test_instance_pool_operations_list_by_instance_pool(self, resource_group): + response = self.client.instance_pool_operations.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations.py index 0ed96de8cf5f..c6558b10eb45 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,30 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstancePoolsOperations(AzureMgmtRecordedTestCase): +class TestSqlInstancePoolsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_instance_pools_list(self, resource_group): - response = self.client.instance_pools.list( - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_instance_pools_list_by_resource_group(self, resource_group): - response = self.client.instance_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -45,7 +24,6 @@ def test_instance_pools_get(self, resource_group): response = self.client.instance_pools.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,18 +37,27 @@ def test_instance_pools_begin_create_or_update(self, resource_group): instance_pool_name="str", parameters={ "location": "str", - "dnsZone": "str", "id": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", "name": "str", + "properties": { + "licenseType": "str", + "subnetId": "str", + "vCores": 0, + "dnsZone": "str", + "maintenanceConfigurationId": "str", + }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "subnetId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "vCores": 0, }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,11 +65,21 @@ def test_instance_pools_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_instance_pools_begin_delete(self, resource_group): - response = self.client.instance_pools.begin_delete( + def test_instance_pools_begin_update(self, resource_group): + response = self.client.instance_pools.begin_update( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "licenseType": "str", + "subnetId": "str", + "vCores": 0, + "dnsZone": "str", + "maintenanceConfigurationId": "str", + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -90,21 +87,29 @@ def test_instance_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_instance_pools_begin_update(self, resource_group): - response = self.client.instance_pools.begin_update( + def test_instance_pools_begin_delete(self, resource_group): + response = self.client.instance_pools.begin_delete( resource_group_name=resource_group.name, instance_pool_name="str", - parameters={ - "dnsZone": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "subnetId": "str", - "tags": {"str": "str"}, - "vCores": 0, - }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_instance_pools_list_by_resource_group(self, resource_group): + response = self.client.instance_pools.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_instance_pools_list(self, resource_group): + response = self.client.instance_pools.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations_async.py index 62a045a1286c..2aa8e4fb35aa 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_instance_pools_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_instance_pools_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,30 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementInstancePoolsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlInstancePoolsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_instance_pools_list(self, resource_group): - response = self.client.instance_pools.list( - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_instance_pools_list_by_resource_group(self, resource_group): - response = self.client.instance_pools.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -46,7 +25,6 @@ async def test_instance_pools_get(self, resource_group): response = await self.client.instance_pools.get( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,18 +39,27 @@ async def test_instance_pools_begin_create_or_update(self, resource_group): instance_pool_name="str", parameters={ "location": "str", - "dnsZone": "str", "id": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", "name": "str", + "properties": { + "licenseType": "str", + "subnetId": "str", + "vCores": 0, + "dnsZone": "str", + "maintenanceConfigurationId": "str", + }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "subnetId": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "vCores": 0, }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -81,12 +68,22 @@ async def test_instance_pools_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_instance_pools_begin_delete(self, resource_group): + async def test_instance_pools_begin_update(self, resource_group): response = await ( - await self.client.instance_pools.begin_delete( + await self.client.instance_pools.begin_update( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "licenseType": "str", + "subnetId": "str", + "vCores": 0, + "dnsZone": "str", + "maintenanceConfigurationId": "str", + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -95,23 +92,31 @@ async def test_instance_pools_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_instance_pools_begin_update(self, resource_group): + async def test_instance_pools_begin_delete(self, resource_group): response = await ( - await self.client.instance_pools.begin_update( + await self.client.instance_pools.begin_delete( resource_group_name=resource_group.name, instance_pool_name="str", - parameters={ - "dnsZone": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "subnetId": "str", - "tags": {"str": "str"}, - "vCores": 0, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_instance_pools_list_by_resource_group(self, resource_group): + response = self.client.instance_pools.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_instance_pools_list(self, resource_group): + response = self.client.instance_pools.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations.py index 77cc0cb88bcc..4f58d375b6f9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementIPv6FirewallRulesOperations(AzureMgmtRecordedTestCase): +class TestSqlIPv6FirewallRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_ipv6_firewall_rules_list_by_server(self, resource_group): - response = self.client.ipv6_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_ipv6_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,8 +37,12 @@ def test_ipv6_firewall_rules_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - parameters={"endIPv6Address": "str", "id": "str", "name": "str", "startIPv6Address": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"endIPv6Address": "str", "startIPv6Address": "str"}, + "type": "str", + }, ) # please add some check logic here by yourself @@ -64,8 +55,18 @@ def test_ipv6_firewall_rules_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_ipv6_firewall_rules_list_by_server(self, resource_group): + response = self.client.ipv6_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations_async.py index 181479dd7928..b8867b91a122 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ipv6_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ipv6_firewall_rules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementIPv6FirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlIPv6FirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_ipv6_firewall_rules_list_by_server(self, resource_group): - response = self.client.ipv6_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_ipv6_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,8 +38,12 @@ async def test_ipv6_firewall_rules_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - parameters={"endIPv6Address": "str", "id": "str", "name": "str", "startIPv6Address": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"endIPv6Address": "str", "startIPv6Address": "str"}, + "type": "str", + }, ) # please add some check logic here by yourself @@ -65,8 +56,18 @@ async def test_ipv6_firewall_rules_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", firewall_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ipv6_firewall_rules_list_by_server(self, resource_group): + response = self.client.ipv6_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations.py index bcbe9fbf5ac2..e5e309d01bc9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobAgentsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobAgentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_agents_list_by_server(self, resource_group): - response = self.client.job_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_job_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +39,6 @@ def test_job_agents_begin_create_or_update(self, resource_group): job_agent_name="str", parameters={ "location": "str", - "databaseId": "str", "id": "str", "identity": { "type": "str", @@ -60,25 +46,19 @@ def test_job_agents_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "name": "str", + "properties": {"databaseId": "str", "state": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "state": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_agents_begin_delete(self, resource_group): - response = self.client.job_agents.begin_delete( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -100,8 +80,30 @@ def test_job_agents_begin_update(self, resource_group): "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "tags": {"str": "str"}, }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_agents_begin_delete(self, resource_group): + response = self.client.job_agents.begin_delete( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_agents_list_by_server(self, resource_group): + response = self.client.job_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations_async.py index 90af19174c12..3ce6d928971e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_agents_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_agents_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobAgentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobAgentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_agents_list_by_server(self, resource_group): - response = self.client.job_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_job_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +41,6 @@ async def test_job_agents_begin_create_or_update(self, resource_group): job_agent_name="str", parameters={ "location": "str", - "databaseId": "str", "id": "str", "identity": { "type": "str", @@ -62,12 +48,19 @@ async def test_job_agents_begin_create_or_update(self, resource_group): "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, }, "name": "str", + "properties": {"databaseId": "str", "state": "str"}, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "state": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -76,13 +69,21 @@ async def test_job_agents_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_agents_begin_delete(self, resource_group): + async def test_job_agents_begin_update(self, resource_group): response = await ( - await self.client.job_agents.begin_delete( + await self.client.job_agents.begin_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", + parameters={ + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -91,24 +92,25 @@ async def test_job_agents_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_agents_begin_update(self, resource_group): + async def test_job_agents_begin_delete(self, resource_group): response = await ( - await self.client.job_agents.begin_update( + await self.client.job_agents.begin_delete( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - parameters={ - "identity": { - "type": "str", - "tenantId": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "tags": {"str": "str"}, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_agents_list_by_server(self, resource_group): + response = self.client.job_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations.py index b3ffec41a4ab..4950c6c2533d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,32 +14,45 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobCredentialsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobCredentialsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_credentials_list_by_agent(self, resource_group): - response = self.client.job_credentials.list_by_agent( + def test_job_credentials_get(self, resource_group): + response = self.client.job_credentials.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", + credential_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_credentials_get(self, resource_group): - response = self.client.job_credentials.get( + def test_job_credentials_create_or_update(self, resource_group): + response = self.client.job_credentials.create_or_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", credential_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"password": "str", "username": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -47,14 +60,12 @@ def test_job_credentials_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_credentials_create_or_update(self, resource_group): - response = self.client.job_credentials.create_or_update( + def test_job_credentials_delete(self, resource_group): + response = self.client.job_credentials.delete( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", credential_name="str", - parameters={"id": "str", "name": "str", "password": "str", "type": "str", "username": "str"}, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,14 +73,12 @@ def test_job_credentials_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_credentials_delete(self, resource_group): - response = self.client.job_credentials.delete( + def test_job_credentials_list_by_agent(self, resource_group): + response = self.client.job_credentials.list_by_agent( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - credential_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations_async.py index 9ca0f9af9e85..b14c3e9bc829 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_credentials_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_credentials_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,32 +15,45 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobCredentialsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobCredentialsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_credentials_list_by_agent(self, resource_group): - response = self.client.job_credentials.list_by_agent( + async def test_job_credentials_get(self, resource_group): + response = await self.client.job_credentials.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", + credential_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_credentials_get(self, resource_group): - response = await self.client.job_credentials.get( + async def test_job_credentials_create_or_update(self, resource_group): + response = await self.client.job_credentials.create_or_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", credential_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"password": "str", "username": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -48,14 +61,12 @@ async def test_job_credentials_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_credentials_create_or_update(self, resource_group): - response = await self.client.job_credentials.create_or_update( + async def test_job_credentials_delete(self, resource_group): + response = await self.client.job_credentials.delete( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", credential_name="str", - parameters={"id": "str", "name": "str", "password": "str", "type": "str", "username": "str"}, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -63,14 +74,12 @@ async def test_job_credentials_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_credentials_delete(self, resource_group): - response = await self.client.job_credentials.delete( + async def test_job_credentials_list_by_agent(self, resource_group): + response = self.client.job_credentials.list_by_agent( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - credential_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations.py similarity index 88% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations.py index aa8e8bb52a9c..44b0974edfea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,47 +14,47 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobExecutionsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobExecutionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_list_by_agent(self, resource_group): - response = self.client.job_executions.list_by_agent( + def test_job_executions_get(self, resource_group): + response = self.client.job_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - api_version="2025-01-01", + job_name="str", + job_execution_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_list_by_job(self, resource_group): - response = self.client.job_executions.list_by_job( + def test_job_executions_begin_create_or_update(self, resource_group): + response = self.client.job_executions.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] + job_execution_id="str", + ).result() # call '.result()' to poll until service return final result + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_get(self, resource_group): - response = self.client.job_executions.get( + def test_job_executions_cancel(self, resource_group): + response = self.client.job_executions.cancel( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,31 +62,26 @@ def test_job_executions_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_begin_create_or_update(self, resource_group): - response = self.client.job_executions.begin_create_or_update( + def test_job_executions_list_by_job(self, resource_group): + response = self.client.job_executions.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_execution_id="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_executions_cancel(self, resource_group): - response = self.client.job_executions.cancel( + def test_job_executions_list_by_agent(self, resource_group): + response = self.client.job_executions.list_by_agent( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", - job_name="str", - job_execution_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -98,7 +93,6 @@ def test_job_executions_begin_create(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations_async.py similarity index 88% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations_async.py index ab14deb148dc..003f197ce304 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_executions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,36 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobExecutionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobExecutionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_executions_list_by_agent(self, resource_group): - response = self.client.job_executions.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_executions_list_by_job(self, resource_group): - response = self.client.job_executions.list_by_job( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -55,7 +28,6 @@ async def test_job_executions_get(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,7 +43,6 @@ async def test_job_executions_begin_create_or_update(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -87,12 +58,36 @@ async def test_job_executions_cancel(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_executions_list_by_job(self, resource_group): + response = self.client.job_executions.list_by_job( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_executions_list_by_agent(self, resource_group): + response = self.client.job_executions.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_job_executions_begin_create(self, resource_group): @@ -102,7 +97,6 @@ async def test_job_executions_begin_create(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations.py index f2eba0db6430..1c3e22035b7c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobPrivateEndpointsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobPrivateEndpointsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_private_endpoints_list_by_agent(self, resource_group): - response = self.client.job_private_endpoints.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_job_private_endpoints_get(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,11 +42,17 @@ def test_job_private_endpoints_begin_create_or_update(self, resource_group): parameters={ "id": "str", "name": "str", - "privateEndpointId": "str", - "targetServerAzureResourceId": "str", + "properties": {"targetServerAzureResourceId": "str", "privateEndpointId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,8 +66,19 @@ def test_job_private_endpoints_begin_delete(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_private_endpoints_list_by_agent(self, resource_group): + response = self.client.job_private_endpoints.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations_async.py index aed89ef15c84..bcb473a77647 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_private_endpoints_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_private_endpoints_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobPrivateEndpointsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobPrivateEndpointsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_private_endpoints_list_by_agent(self, resource_group): - response = self.client.job_private_endpoints.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_job_private_endpoints_get(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,11 +44,17 @@ async def test_job_private_endpoints_begin_create_or_update(self, resource_group parameters={ "id": "str", "name": "str", - "privateEndpointId": "str", - "targetServerAzureResourceId": "str", + "properties": {"targetServerAzureResourceId": "str", "privateEndpointId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,9 +70,20 @@ async def test_job_private_endpoints_begin_delete(self, resource_group): server_name="str", job_agent_name="str", private_endpoint_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_private_endpoints_list_by_agent(self, resource_group): + response = self.client.job_private_endpoints.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations.py index 554d3f1c46dc..3b8902791221 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,37 +14,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobStepExecutionsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobStepExecutionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_step_executions_list_by_job_execution(self, resource_group): - response = self.client.job_step_executions.list_by_job_execution( + def test_job_step_executions_get(self, resource_group): + response = self.client.job_step_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", + step_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_step_executions_get(self, resource_group): - response = self.client.job_step_executions.get( + def test_job_step_executions_list_by_job_execution(self, resource_group): + response = self.client.job_step_executions.list_by_job_execution( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - step_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations_async.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations_async.py index c99a378945b8..69c3d2292768 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_step_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_step_executions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,37 +15,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobStepExecutionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobStepExecutionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_step_executions_list_by_job_execution(self, resource_group): - response = self.client.job_step_executions.list_by_job_execution( + async def test_job_step_executions_get(self, resource_group): + response = await self.client.job_step_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", + step_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_step_executions_get(self, resource_group): - response = await self.client.job_step_executions.get( + async def test_job_step_executions_list_by_job_execution(self, resource_group): + response = self.client.job_step_executions.list_by_job_execution( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", - step_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations.py index eb887005dac0..78f56ed5fdee 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,23 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobStepsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobStepsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_steps_list_by_job(self, resource_group): - response = self.client.job_steps.list_by_job( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -41,7 +27,6 @@ def test_job_steps_get(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,32 +42,41 @@ def test_job_steps_create_or_update(self, resource_group): job_name="str", step_name="str", parameters={ - "action": {"value": "str", "source": "Inline", "type": "TSql"}, - "credential": "str", - "executionOptions": { - "initialRetryIntervalSeconds": 1, - "maximumRetryIntervalSeconds": 120, - "retryAttempts": 10, - "retryIntervalBackoffMultiplier": 2, - "timeoutSeconds": 43200, - }, "id": "str", "name": "str", - "output": { - "databaseName": "str", - "serverName": "str", - "tableName": "str", + "properties": { + "action": {"value": "str", "source": "str", "type": "str"}, + "targetGroup": "str", "credential": "str", - "resourceGroupName": "str", - "schemaName": "dbo", - "subscriptionId": "str", - "type": "SqlDatabase", + "executionOptions": { + "initialRetryIntervalSeconds": 0, + "maximumRetryIntervalSeconds": 0, + "retryAttempts": 0, + "retryIntervalBackoffMultiplier": 0.0, + "timeoutSeconds": 0, + }, + "output": { + "databaseName": "str", + "serverName": "str", + "tableName": "str", + "credential": "str", + "resourceGroupName": "str", + "schemaName": "str", + "subscriptionId": "str", + "type": "str", + }, + "stepId": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "stepId": 0, - "targetGroup": "str", "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -97,7 +91,6 @@ def test_job_steps_delete(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,14 +98,12 @@ def test_job_steps_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_steps_list_by_version(self, resource_group): - response = self.client.job_steps.list_by_version( + def test_job_steps_list_by_job(self, resource_group): + response = self.client.job_steps.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_version=0, - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -128,8 +119,21 @@ def test_job_steps_get_by_version(self, resource_group): job_name="str", job_version=0, step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_steps_list_by_version(self, resource_group): + response = self.client.job_steps.list_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations_async.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations_async.py index c44c0bf28037..785441cb5061 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_steps_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_steps_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,23 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobStepsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobStepsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_steps_list_by_job(self, resource_group): - response = self.client.job_steps.list_by_job( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - job_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -42,7 +28,6 @@ async def test_job_steps_get(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -58,32 +43,41 @@ async def test_job_steps_create_or_update(self, resource_group): job_name="str", step_name="str", parameters={ - "action": {"value": "str", "source": "Inline", "type": "TSql"}, - "credential": "str", - "executionOptions": { - "initialRetryIntervalSeconds": 1, - "maximumRetryIntervalSeconds": 120, - "retryAttempts": 10, - "retryIntervalBackoffMultiplier": 2, - "timeoutSeconds": 43200, - }, "id": "str", "name": "str", - "output": { - "databaseName": "str", - "serverName": "str", - "tableName": "str", + "properties": { + "action": {"value": "str", "source": "str", "type": "str"}, + "targetGroup": "str", "credential": "str", - "resourceGroupName": "str", - "schemaName": "dbo", - "subscriptionId": "str", - "type": "SqlDatabase", + "executionOptions": { + "initialRetryIntervalSeconds": 0, + "maximumRetryIntervalSeconds": 0, + "retryAttempts": 0, + "retryIntervalBackoffMultiplier": 0.0, + "timeoutSeconds": 0, + }, + "output": { + "databaseName": "str", + "serverName": "str", + "tableName": "str", + "credential": "str", + "resourceGroupName": "str", + "schemaName": "str", + "subscriptionId": "str", + "type": "str", + }, + "stepId": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "stepId": 0, - "targetGroup": "str", "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -98,7 +92,6 @@ async def test_job_steps_delete(self, resource_group): job_agent_name="str", job_name="str", step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -106,14 +99,12 @@ async def test_job_steps_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_steps_list_by_version(self, resource_group): - response = self.client.job_steps.list_by_version( + async def test_job_steps_list_by_job(self, resource_group): + response = self.client.job_steps.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_version=0, - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -129,8 +120,21 @@ async def test_job_steps_get_by_version(self, resource_group): job_name="str", job_version=0, step_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_steps_list_by_version(self, resource_group): + response = self.client.job_steps.list_by_version( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + job_name="str", + job_version=0, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations.py index b195eeb9aa90..d2cd9185d2d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,40 +14,38 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobTargetExecutionsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobTargetExecutionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_target_executions_list_by_step(self, resource_group): - response = self.client.job_target_executions.list_by_step( + def test_job_target_executions_get(self, resource_group): + response = self.client.job_target_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - api_version="2025-01-01", + target_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_target_executions_get(self, resource_group): - response = self.client.job_target_executions.get( + def test_job_target_executions_list_by_step(self, resource_group): + response = self.client.job_target_executions.list_by_step( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - target_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -60,7 +58,6 @@ def test_job_target_executions_list_by_job_execution(self, resource_group): job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations_async.py index c1d5a62d0579..21b838e25688 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_executions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_executions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,40 +15,38 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobTargetExecutionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobTargetExecutionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_target_executions_list_by_step(self, resource_group): - response = self.client.job_target_executions.list_by_step( + async def test_job_target_executions_get(self, resource_group): + response = await self.client.job_target_executions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - api_version="2025-01-01", + target_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_target_executions_get(self, resource_group): - response = await self.client.job_target_executions.get( + async def test_job_target_executions_list_by_step(self, resource_group): + response = self.client.job_target_executions.list_by_step( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", job_execution_id="str", step_name="str", - target_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -61,7 +59,6 @@ async def test_job_target_executions_list_by_job_execution(self, resource_group) job_agent_name="str", job_name="str", job_execution_id="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations.py similarity index 70% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations.py index 54cd9dda8d00..512cdd03c197 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobTargetGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobTargetGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_job_target_groups_list_by_agent(self, resource_group): - response = self.client.job_target_groups.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_job_target_groups_get(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,21 +41,30 @@ def test_job_target_groups_create_or_update(self, resource_group): target_group_name="str", parameters={ "id": "str", - "members": [ - { - "type": "str", - "databaseName": "str", - "elasticPoolName": "str", - "membershipType": "Include", - "refreshCredential": "str", - "serverName": "str", - "shardMapName": "str", - } - ], "name": "str", + "properties": { + "members": [ + { + "type": "str", + "databaseName": "str", + "elasticPoolName": "str", + "membershipType": "str", + "refreshCredential": "str", + "serverName": "str", + "shardMapName": "str", + } + ] + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -83,8 +78,19 @@ def test_job_target_groups_delete(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_job_target_groups_list_by_agent(self, resource_group): + response = self.client.job_target_groups.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations_async.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations_async.py index 6250e925b256..d670c446f7fb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_target_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_target_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobTargetGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobTargetGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_job_target_groups_list_by_agent(self, resource_group): - response = self.client.job_target_groups.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_job_target_groups_get(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,21 +42,30 @@ async def test_job_target_groups_create_or_update(self, resource_group): target_group_name="str", parameters={ "id": "str", - "members": [ - { - "type": "str", - "databaseName": "str", - "elasticPoolName": "str", - "membershipType": "Include", - "refreshCredential": "str", - "serverName": "str", - "shardMapName": "str", - } - ], "name": "str", + "properties": { + "members": [ + { + "type": "str", + "databaseName": "str", + "elasticPoolName": "str", + "membershipType": "str", + "refreshCredential": "str", + "serverName": "str", + "shardMapName": "str", + } + ] + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -84,8 +79,19 @@ async def test_job_target_groups_delete(self, resource_group): server_name="str", job_agent_name="str", target_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_job_target_groups_list_by_agent(self, resource_group): + response = self.client.job_target_groups.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations.py index 687e69019231..57964c60e314 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobVersionsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobVersionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_versions_list_by_job(self, resource_group): - response = self.client.job_versions.list_by_job( + def test_job_versions_get(self, resource_group): + response = self.client.job_versions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", + job_version=0, ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_job_versions_get(self, resource_group): - response = self.client.job_versions.get( + def test_job_versions_list_by_job(self, resource_group): + response = self.client.job_versions.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_version=0, - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations_async.py index fe769d9ba337..ff00cd580078 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_job_versions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_job_versions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,35 +15,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobVersionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobVersionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_versions_list_by_job(self, resource_group): - response = self.client.job_versions.list_by_job( + async def test_job_versions_get(self, resource_group): + response = await self.client.job_versions.get( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", + job_version=0, ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_job_versions_get(self, resource_group): - response = await self.client.job_versions.get( + async def test_job_versions_list_by_job(self, resource_group): + response = self.client.job_versions.list_by_job( resource_group_name=resource_group.name, server_name="str", job_agent_name="str", job_name="str", - job_version=0, - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations.py index 029818e3b17a..e7fb7fba78a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobsOperations(AzureMgmtRecordedTestCase): +class TestSqlJobsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_jobs_list_by_agent(self, resource_group): - response = self.client.jobs.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_jobs_get(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,20 +40,29 @@ def test_jobs_create_or_update(self, resource_group): job_agent_name="str", job_name="str", parameters={ - "description": "", "id": "str", "name": "str", - "schedule": { - "enabled": bool, - "endTime": "9999-12-31T03:59:59-08:00", - "interval": "str", - "startTime": "0001-01-01T16:00:00-08:00", - "type": "Once", + "properties": { + "description": "str", + "schedule": { + "enabled": bool, + "endTime": "2020-02-20 00:00:00", + "interval": "str", + "startTime": "2020-02-20 00:00:00", + "type": "str", + }, + "version": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", - "version": 0, }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,8 +76,19 @@ def test_jobs_delete(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_jobs_list_by_agent(self, resource_group): + response = self.client.jobs.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations_async.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations_async.py index 92b4bdd5c228..74bc6e6f7904 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_jobs_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_jobs_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementJobsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlJobsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_jobs_list_by_agent(self, resource_group): - response = self.client.jobs.list_by_agent( - resource_group_name=resource_group.name, - server_name="str", - job_agent_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_jobs_get(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,20 +41,29 @@ async def test_jobs_create_or_update(self, resource_group): job_agent_name="str", job_name="str", parameters={ - "description": "", "id": "str", "name": "str", - "schedule": { - "enabled": bool, - "endTime": "9999-12-31T03:59:59-08:00", - "interval": "str", - "startTime": "0001-01-01T16:00:00-08:00", - "type": "Once", + "properties": { + "description": "str", + "schedule": { + "enabled": bool, + "endTime": "2020-02-20 00:00:00", + "interval": "str", + "startTime": "2020-02-20 00:00:00", + "type": "str", + }, + "version": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", - "version": 0, }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,8 +77,19 @@ async def test_jobs_delete(self, resource_group): server_name="str", job_agent_name="str", job_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_jobs_list_by_agent(self, resource_group): + response = self.client.jobs.list_by_agent( + resource_group_name=resource_group.name, + server_name="str", + job_agent_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations.py index a5ad781bf108..ac1c5a08b231 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,49 +14,59 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLedgerDigestUploadsOperations(AzureMgmtRecordedTestCase): +class TestSqlLedgerDigestUploadsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.ledger_digest_uploads.list_by_database( + def test_ledger_digest_uploads_get(self, resource_group): + response = self.client.ledger_digest_uploads.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + ledger_digest_uploads="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_get(self, resource_group): - response = self.client.ledger_digest_uploads.get( + def test_ledger_digest_uploads_begin_create_or_update(self, resource_group): + response = self.client.ledger_digest_uploads.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", - ) + parameters={ + "id": "str", + "name": "str", + "properties": {"digestStorageEndpoint": "str", "state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_ledger_digest_uploads_begin_create_or_update(self, resource_group): - response = self.client.ledger_digest_uploads.begin_create_or_update( + def test_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.ledger_digest_uploads.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - ledger_digest_uploads="str", - parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -68,7 +78,6 @@ def test_ledger_digest_uploads_begin_disable(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations_async.py index fbe2dd49f958..db21ca74cbb1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_ledger_digest_uploads_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_ledger_digest_uploads_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLedgerDigestUploadsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlLedgerDigestUploadsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.ledger_digest_uploads.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_ledger_digest_uploads_get(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,14 +41,38 @@ async def test_ledger_digest_uploads_begin_create_or_update(self, resource_group server_name="str", database_name="str", ledger_digest_uploads="str", - parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"digestStorageEndpoint": "str", "state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.ledger_digest_uploads.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_ledger_digest_uploads_begin_disable(self, resource_group): @@ -72,7 +82,6 @@ async def test_ledger_digest_uploads_begin_disable(self, resource_group): server_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations.py similarity index 88% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations.py index 7f2a8d1266a3..d4f479716de6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,71 +14,45 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionBackupsOperations(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionBackupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_backups.list_by_location( - location_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_backups_list_by_server(self, resource_group): - response = self.client.long_term_retention_backups.list_by_server( - location_name="str", - long_term_retention_server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_backups.list_by_database( + def test_long_term_retention_backups_get(self, resource_group): + response = self.client.long_term_retention_backups.get( location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2025-01-01", + backup_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_get(self, resource_group): - response = self.client.long_term_retention_backups.get( + def test_long_term_retention_backups_begin_delete(self, resource_group): + response = self.client.long_term_retention_backups.begin_delete( location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_begin_delete(self, resource_group): - response = self.client.long_term_retention_backups.begin_delete( + def test_long_term_retention_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_backups.list_by_database( location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - backup_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -91,7 +65,6 @@ def test_long_term_retention_backups_begin_change_access_tier(self, resource_gro long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -106,14 +79,15 @@ def test_long_term_retention_backups_begin_copy(self, resource_group): long_term_retention_database_name="str", backup_name="str", parameters={ - "targetBackupStorageRedundancy": "str", - "targetDatabaseName": "str", - "targetResourceGroup": "str", - "targetServerFullyQualifiedDomainName": "str", - "targetServerResourceId": "str", - "targetSubscriptionId": "str", + "properties": { + "targetBackupStorageRedundancy": "str", + "targetDatabaseName": "str", + "targetResourceGroup": "str", + "targetServerFullyQualifiedDomainName": "str", + "targetServerResourceId": "str", + "targetSubscriptionId": "str", + } }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -127,7 +101,6 @@ def test_long_term_retention_backups_begin_lock_time_based_immutability(self, re long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -141,7 +114,6 @@ def test_long_term_retention_backups_begin_remove_legal_hold_immutability(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -155,7 +127,6 @@ def test_long_term_retention_backups_begin_remove_time_based_immutability(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -169,7 +140,6 @@ def test_long_term_retention_backups_begin_set_legal_hold_immutability(self, res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -183,8 +153,7 @@ def test_long_term_retention_backups_begin_update(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2025-01-01", + parameters={"properties": {"requestedBackupStorageRedundancy": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -192,70 +161,42 @@ def test_long_term_retention_backups_begin_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_backups_list_by_resource_group_server(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_server( - resource_group_name=resource_group.name, - location_name="str", - long_term_retention_server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_database( + def test_long_term_retention_backups_get_by_resource_group(self, resource_group): + response = self.client.long_term_retention_backups.get_by_resource_group( resource_group_name=resource_group.name, location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - api_version="2025-01-01", + backup_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_get_by_resource_group(self, resource_group): - response = self.client.long_term_retention_backups.get_by_resource_group( + def test_long_term_retention_backups_begin_delete_by_resource_group(self, resource_group): + response = self.client.long_term_retention_backups.begin_delete_by_resource_group( resource_group_name=resource_group.name, location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", - ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_backups_begin_delete_by_resource_group(self, resource_group): - response = self.client.long_term_retention_backups.begin_delete_by_resource_group( + def test_long_term_retention_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_database( resource_group_name=resource_group.name, location_name="str", long_term_retention_server_name="str", long_term_retention_database_name="str", - backup_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -269,7 +210,6 @@ def test_long_term_retention_backups_begin_change_access_tier_by_resource_group( long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -285,14 +225,15 @@ def test_long_term_retention_backups_begin_copy_by_resource_group(self, resource long_term_retention_database_name="str", backup_name="str", parameters={ - "targetBackupStorageRedundancy": "str", - "targetDatabaseName": "str", - "targetResourceGroup": "str", - "targetServerFullyQualifiedDomainName": "str", - "targetServerResourceId": "str", - "targetSubscriptionId": "str", + "properties": { + "targetBackupStorageRedundancy": "str", + "targetDatabaseName": "str", + "targetResourceGroup": "str", + "targetServerFullyQualifiedDomainName": "str", + "targetServerResourceId": "str", + "targetSubscriptionId": "str", + } }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -307,7 +248,6 @@ def test_long_term_retention_backups_begin_lock_time_based_immutability_by_resou long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -322,7 +262,6 @@ def test_long_term_retention_backups_begin_remove_legal_hold_immutability_by_res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -337,7 +276,6 @@ def test_long_term_retention_backups_begin_remove_time_based_immutability_by_res long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -352,7 +290,6 @@ def test_long_term_retention_backups_begin_set_legal_hold_immutability_by_resour long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -367,9 +304,52 @@ def test_long_term_retention_backups_begin_update_by_resource_group(self, resour long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2025-01-01", + parameters={"properties": {"requestedBackupStorageRedundancy": "str"}}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_backups.list_by_location( + location_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_backups_list_by_server(self, resource_group): + response = self.client.long_term_retention_backups.list_by_server( + location_name="str", + long_term_retention_server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_backups_list_by_resource_group_server(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_server( + resource_group_name=resource_group.name, + location_name="str", + long_term_retention_server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations_async.py similarity index 88% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations_async.py index 11720e8f8996..92217e4b0fcc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_backups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_backups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,45 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionBackupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionBackupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_backups.list_by_location( - location_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_server(self, resource_group): - response = self.client.long_term_retention_backups.list_by_server( - location_name="str", - long_term_retention_server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_backups.list_by_database( - location_name="str", - long_term_retention_server_name="str", - long_term_retention_database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -63,7 +27,6 @@ async def test_long_term_retention_backups_get(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -78,13 +41,24 @@ async def test_long_term_retention_backups_begin_delete(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_backups.list_by_database( + location_name="str", + long_term_retention_server_name="str", + long_term_retention_database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_long_term_retention_backups_begin_change_access_tier(self, resource_group): @@ -95,7 +69,6 @@ async def test_long_term_retention_backups_begin_change_access_tier(self, resour long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -112,14 +85,15 @@ async def test_long_term_retention_backups_begin_copy(self, resource_group): long_term_retention_database_name="str", backup_name="str", parameters={ - "targetBackupStorageRedundancy": "str", - "targetDatabaseName": "str", - "targetResourceGroup": "str", - "targetServerFullyQualifiedDomainName": "str", - "targetServerResourceId": "str", - "targetSubscriptionId": "str", + "properties": { + "targetBackupStorageRedundancy": "str", + "targetDatabaseName": "str", + "targetResourceGroup": "str", + "targetServerFullyQualifiedDomainName": "str", + "targetServerResourceId": "str", + "targetSubscriptionId": "str", + } }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -135,7 +109,6 @@ async def test_long_term_retention_backups_begin_lock_time_based_immutability(se long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -151,7 +124,6 @@ async def test_long_term_retention_backups_begin_remove_legal_hold_immutability( long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -167,7 +139,6 @@ async def test_long_term_retention_backups_begin_remove_time_based_immutability( long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -183,7 +154,6 @@ async def test_long_term_retention_backups_begin_set_legal_hold_immutability(sel long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -199,53 +169,13 @@ async def test_long_term_retention_backups_begin_update(self, resource_group): long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2025-01-01", + parameters={"properties": {"requestedBackupStorageRedundancy": "str"}}, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_resource_group_server(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_server( - resource_group_name=resource_group.name, - location_name="str", - long_term_retention_server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_backups.list_by_resource_group_database( - resource_group_name=resource_group.name, - location_name="str", - long_term_retention_server_name="str", - long_term_retention_database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_long_term_retention_backups_get_by_resource_group(self, resource_group): @@ -255,7 +185,6 @@ async def test_long_term_retention_backups_get_by_resource_group(self, resource_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -271,13 +200,25 @@ async def test_long_term_retention_backups_begin_delete_by_resource_group(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_database( + resource_group_name=resource_group.name, + location_name="str", + long_term_retention_server_name="str", + long_term_retention_database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_long_term_retention_backups_begin_change_access_tier_by_resource_group(self, resource_group): @@ -289,7 +230,6 @@ async def test_long_term_retention_backups_begin_change_access_tier_by_resource_ long_term_retention_database_name="str", backup_name="str", parameters={"backupStorageAccessTier": "str", "operationMode": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -307,14 +247,15 @@ async def test_long_term_retention_backups_begin_copy_by_resource_group(self, re long_term_retention_database_name="str", backup_name="str", parameters={ - "targetBackupStorageRedundancy": "str", - "targetDatabaseName": "str", - "targetResourceGroup": "str", - "targetServerFullyQualifiedDomainName": "str", - "targetServerResourceId": "str", - "targetSubscriptionId": "str", + "properties": { + "targetBackupStorageRedundancy": "str", + "targetDatabaseName": "str", + "targetResourceGroup": "str", + "targetServerFullyQualifiedDomainName": "str", + "targetServerResourceId": "str", + "targetSubscriptionId": "str", + } }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -333,7 +274,6 @@ async def test_long_term_retention_backups_begin_lock_time_based_immutability_by long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -352,7 +292,6 @@ async def test_long_term_retention_backups_begin_remove_legal_hold_immutability_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -371,7 +310,6 @@ async def test_long_term_retention_backups_begin_remove_time_based_immutability_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -390,7 +328,6 @@ async def test_long_term_retention_backups_begin_set_legal_hold_immutability_by_ long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -407,10 +344,53 @@ async def test_long_term_retention_backups_begin_update_by_resource_group(self, long_term_retention_server_name="str", long_term_retention_database_name="str", backup_name="str", - parameters={"requestedBackupStorageRedundancy": "str"}, - api_version="2025-01-01", + parameters={"properties": {"requestedBackupStorageRedundancy": "str"}}, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_backups.list_by_location( + location_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_server(self, resource_group): + response = self.client.long_term_retention_backups.list_by_server( + location_name="str", + long_term_retention_server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_backups_list_by_resource_group_server(self, resource_group): + response = self.client.long_term_retention_backups.list_by_resource_group_server( + resource_group_name=resource_group.name, + location_name="str", + long_term_retention_server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations.py similarity index 90% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations.py index 742068cffcb7..8be5e0dfaf94 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,29 +14,46 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionManagedInstanceBackupsOperations(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionManagedInstanceBackupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_location( + def test_long_term_retention_managed_instance_backups_get_by_resource_group(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.get_by_resource_group( + resource_group_name=resource_group.name, location_name="str", - api_version="2025-01-01", + managed_instance_name="str", + database_name="str", + backup_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_database( + def test_long_term_retention_managed_instance_backups_begin_delete_by_resource_group(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( + resource_group_name=resource_group.name, + location_name="str", + managed_instance_name="str", + database_name="str", + backup_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -50,7 +67,6 @@ def test_long_term_retention_managed_instance_backups_get(self, resource_group): managed_instance_name="str", database_name="str", backup_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,7 +80,6 @@ def test_long_term_retention_managed_instance_backups_begin_delete(self, resourc managed_instance_name="str", database_name="str", backup_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,11 +87,11 @@ def test_long_term_retention_managed_instance_backups_begin_delete(self, resourc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_instance( + def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_database( location_name="str", managed_instance_name="str", - api_version="2025-01-01", + database_name="str", ) result = [r for r in response] # please add some check logic here by yourself @@ -84,11 +99,9 @@ def test_long_term_retention_managed_instance_backups_list_by_instance(self, res @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, + def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_location( location_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -96,13 +109,10 @@ def test_long_term_retention_managed_instance_backups_list_by_resource_group_loc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( - resource_group_name=resource_group.name, + def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_instance( location_name="str", managed_instance_name="str", - database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -110,31 +120,12 @@ def test_long_term_retention_managed_instance_backups_list_by_resource_group_dat @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_get_by_resource_group(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.get_by_resource_group( + def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( resource_group_name=resource_group.name, location_name="str", - managed_instance_name="str", - database_name="str", - backup_name="str", - api_version="2025-01-01", ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_managed_instance_backups_begin_delete_by_resource_group(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( - resource_group_name=resource_group.name, - location_name="str", - managed_instance_name="str", - database_name="str", - backup_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -145,7 +136,6 @@ def test_long_term_retention_managed_instance_backups_list_by_resource_group_ins resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations_async.py similarity index 90% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations_async.py index 7f33f7f3668a..f9e8a58ebe0c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_managed_instance_backups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_managed_instance_backups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,29 +15,48 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionManagedInstanceBackupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionManagedInstanceBackupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_location( + async def test_long_term_retention_managed_instance_backups_get_by_resource_group(self, resource_group): + response = await self.client.long_term_retention_managed_instance_backups.get_by_resource_group( + resource_group_name=resource_group.name, location_name="str", - api_version="2025-01-01", + managed_instance_name="str", + database_name="str", + backup_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_database( + async def test_long_term_retention_managed_instance_backups_begin_delete_by_resource_group(self, resource_group): + response = await ( + await self.client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( + resource_group_name=resource_group.name, + location_name="str", + managed_instance_name="str", + database_name="str", + backup_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( + resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -51,7 +70,6 @@ async def test_long_term_retention_managed_instance_backups_get(self, resource_g managed_instance_name="str", database_name="str", backup_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -66,7 +84,6 @@ async def test_long_term_retention_managed_instance_backups_begin_delete(self, r managed_instance_name="str", database_name="str", backup_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,11 +92,11 @@ async def test_long_term_retention_managed_instance_backups_begin_delete(self, r @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_instance( + async def test_long_term_retention_managed_instance_backups_list_by_database(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_database( location_name="str", managed_instance_name="str", - api_version="2025-01-01", + database_name="str", ) result = [r async for r in response] # please add some check logic here by yourself @@ -87,11 +104,9 @@ async def test_long_term_retention_managed_instance_backups_list_by_instance(sel @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( - resource_group_name=resource_group.name, + async def test_long_term_retention_managed_instance_backups_list_by_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_location( location_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -99,13 +114,10 @@ async def test_long_term_retention_managed_instance_backups_list_by_resource_gro @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_list_by_resource_group_database(self, resource_group): - response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_database( - resource_group_name=resource_group.name, + async def test_long_term_retention_managed_instance_backups_list_by_instance(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_instance( location_name="str", managed_instance_name="str", - database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -113,33 +125,12 @@ async def test_long_term_retention_managed_instance_backups_list_by_resource_gro @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_get_by_resource_group(self, resource_group): - response = await self.client.long_term_retention_managed_instance_backups.get_by_resource_group( + async def test_long_term_retention_managed_instance_backups_list_by_resource_group_location(self, resource_group): + response = self.client.long_term_retention_managed_instance_backups.list_by_resource_group_location( resource_group_name=resource_group.name, location_name="str", - managed_instance_name="str", - database_name="str", - backup_name="str", - api_version="2025-01-01", ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_managed_instance_backups_begin_delete_by_resource_group(self, resource_group): - response = await ( - await self.client.long_term_retention_managed_instance_backups.begin_delete_by_resource_group( - resource_group_name=resource_group.name, - location_name="str", - managed_instance_name="str", - database_name="str", - backup_name="str", - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -150,7 +141,6 @@ async def test_long_term_retention_managed_instance_backups_list_by_resource_gro resource_group_name=resource_group.name, location_name="str", managed_instance_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations.py index cecf09bbe399..64d830a326e2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.long_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_long_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,17 +41,38 @@ def test_long_term_retention_policies_begin_create_or_update(self, resource_grou policy_name="str", parameters={ "id": "str", - "monthlyRetention": "str", "name": "str", - "timeBasedImmutability": "str", - "timeBasedImmutabilityMode": "str", + "properties": { + "monthlyRetention": "str", + "timeBasedImmutability": "str", + "timeBasedImmutabilityMode": "str", + "weekOfYear": 0, + "weeklyRetention": "str", + "yearlyRetention": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "weekOfYear": 0, - "weeklyRetention": "str", - "yearlyRetention": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations_async.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations_async.py index 6a209f788279..bde655b1c691 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_long_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_long_term_retention_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementLongTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlLongTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.long_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_long_term_retention_policies_get(self, resource_group): server_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,18 +43,39 @@ async def test_long_term_retention_policies_begin_create_or_update(self, resourc policy_name="str", parameters={ "id": "str", - "monthlyRetention": "str", "name": "str", - "timeBasedImmutability": "str", - "timeBasedImmutabilityMode": "str", + "properties": { + "monthlyRetention": "str", + "timeBasedImmutability": "str", + "timeBasedImmutabilityMode": "str", + "weekOfYear": 0, + "weeklyRetention": "str", + "yearlyRetention": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "weekOfYear": 0, - "weeklyRetention": "str", - "yearlyRetention": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations.py index b57ea52c6184..2f3346bd4cac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementMaintenanceWindowOptionsOperations(AzureMgmtRecordedTestCase): +class TestSqlMaintenanceWindowOptionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_maintenance_window_options_get(self, resource_group): server_name="str", database_name="str", maintenance_window_options_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations_async.py index e006129ca3d1..c2d1914a028a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_window_options_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_window_options_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementMaintenanceWindowOptionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlMaintenanceWindowOptionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_maintenance_window_options_get(self, resource_group): server_name="str", database_name="str", maintenance_window_options_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations.py similarity index 71% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations.py index ab29810069d9..e77161fa93b9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementMaintenanceWindowsOperations(AzureMgmtRecordedTestCase): +class TestSqlMaintenanceWindowsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_maintenance_windows_get(self, resource_group): server_name="str", database_name="str", maintenance_window_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -39,14 +38,21 @@ def test_maintenance_windows_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - maintenance_window_name="str", parameters={ "id": "str", "name": "str", - "timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}], + "properties": {"timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", + maintenance_window_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations_async.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations_async.py index 85c9eb23212d..7ee0671916d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_maintenance_windows_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_maintenance_windows_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementMaintenanceWindowsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlMaintenanceWindowsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_maintenance_windows_get(self, resource_group): server_name="str", database_name="str", maintenance_window_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,14 +39,21 @@ async def test_maintenance_windows_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - maintenance_window_name="str", parameters={ "id": "str", "name": "str", - "timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}], + "properties": {"timeRanges": [{"dayOfWeek": "str", "duration": "str", "startTime": "str"}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", + maintenance_window_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations.py similarity index 68% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations.py index 3540f8daf795..649dbdb28b04 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedBackupShortTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedBackupShortTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_managed_backup_short_term_retention_policies_get(self, resource_group): managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,8 +39,20 @@ def test_managed_backup_short_term_retention_policies_begin_create_or_update(sel managed_instance_name="str", database_name="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -68,9 +66,33 @@ def test_managed_backup_short_term_retention_policies_begin_update(self, resourc managed_instance_name="str", database_name="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations_async.py similarity index 68% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations_async.py index cc87af6a551b..96ab973b99c4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_backup_short_term_retention_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_backup_short_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_backup_short_term_retention_policies_get(self, resource_g managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,8 +41,20 @@ async def test_managed_backup_short_term_retention_policies_begin_create_or_upda managed_instance_name="str", database_name="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -72,10 +70,34 @@ async def test_managed_backup_short_term_retention_policies_begin_update(self, r managed_instance_name="str", database_name="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_backup_short_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_backup_short_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations.py index 5f2b94e74974..6a6f256ba03d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_advanced_threat_protection_settings_list_by_database(self, resource_group): - response = self.client.managed_database_advanced_threat_protection_settings.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_managed_database_advanced_threat_protection_settings_get(self, resource managed_instance_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,10 +40,9 @@ def test_managed_database_advanced_threat_protection_settings_create_or_update(s database_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -68,8 +53,19 @@ def test_managed_database_advanced_threat_protection_settings_create_or_update(s }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_advanced_threat_protection_settings_list_by_database(self, resource_group): + response = self.client.managed_database_advanced_threat_protection_settings.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations_async.py index 06a50c7851fc..74fa5cb412be 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_advanced_threat_protection_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_advanced_threat_protection_settings_list_by_database(self, resource_group): - response = self.client.managed_database_advanced_threat_protection_settings.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_database_advanced_threat_protection_settings_get(self, re managed_instance_name="str", database_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,10 +41,9 @@ async def test_managed_database_advanced_threat_protection_settings_create_or_up database_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -69,8 +54,19 @@ async def test_managed_database_advanced_threat_protection_settings_create_or_up }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_advanced_threat_protection_settings_list_by_database(self, resource_group): + response = self.client.managed_database_advanced_threat_protection_settings.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations.py index 54bcc5341c9f..4cc35efb2440 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,20 +14,22 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseColumnsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseColumnsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_columns_list_by_database(self, resource_group): - response = self.client.managed_database_columns.list_by_database( + def test_managed_database_columns_get(self, resource_group): + response = self.client.managed_database_columns.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @@ -40,7 +42,6 @@ def test_managed_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -48,16 +49,12 @@ def test_managed_database_columns_list_by_table(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_columns_get(self, resource_group): - response = self.client.managed_database_columns.get( + def test_managed_database_columns_list_by_database(self, resource_group): + response = self.client.managed_database_columns.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations_async.py index 228a9c6b30c5..8efacb5ee764 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_columns_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_columns_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,20 +15,22 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseColumnsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseColumnsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_columns_list_by_database(self, resource_group): - response = self.client.managed_database_columns.list_by_database( + async def test_managed_database_columns_get(self, resource_group): + response = await self.client.managed_database_columns.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @@ -41,7 +43,6 @@ async def test_managed_database_columns_list_by_table(self, resource_group): database_name="str", schema_name="str", table_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -49,16 +50,12 @@ async def test_managed_database_columns_list_by_table(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_columns_get(self, resource_group): - response = await self.client.managed_database_columns.get( + async def test_managed_database_columns_list_by_database(self, resource_group): + response = self.client.managed_database_columns.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations.py index e74e4b3b100b..c4ab768bb799 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseMoveOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseMoveOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_move_operations_list_by_location(self, resource_group): - response = self.client.managed_database_move_operations.list_by_location( + def test_managed_database_move_operations_get(self, resource_group): + response = self.client.managed_database_move_operations.get( resource_group_name=resource_group.name, location_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_move_operations_get(self, resource_group): - response = self.client.managed_database_move_operations.get( + def test_managed_database_move_operations_list_by_location(self, resource_group): + response = self.client.managed_database_move_operations.list_by_location( resource_group_name=resource_group.name, location_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations_async.py index 2dd41a6bed40..1d6ad45d95cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_move_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_move_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseMoveOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseMoveOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_move_operations_list_by_location(self, resource_group): - response = self.client.managed_database_move_operations.list_by_location( + async def test_managed_database_move_operations_get(self, resource_group): + response = await self.client.managed_database_move_operations.get( resource_group_name=resource_group.name, location_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_move_operations_get(self, resource_group): - response = await self.client.managed_database_move_operations.get( + async def test_managed_database_move_operations_list_by_location(self, resource_group): + response = self.client.managed_database_move_operations.list_by_location( resource_group_name=resource_group.name, location_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations.py index 0af5dddf3e09..1d2a65b01b05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseQueriesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseQueriesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_managed_database_queries_get(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -40,7 +39,6 @@ def test_managed_database_queries_list_by_query(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations_async.py index 4740900f574a..b6eb70eecee2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_queries_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_queries_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseQueriesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseQueriesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_managed_database_queries_get(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -41,7 +40,6 @@ async def test_managed_database_queries_list_by_query(self, resource_group): managed_instance_name="str", database_name="str", query_id="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations.py index cb6d532307db..602271f57e3b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseRecommendedSensitivityLabelsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseRecommendedSensitivityLabelsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -28,17 +28,13 @@ def test_managed_database_recommended_sensitivity_labels_update(self, resource_g parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "table": "str", + "properties": {"column": "str", "op": "str", "schema": "str", "table": "str"}, "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations_async.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations_async.py index 1c37de1507ab..9d6f23cabdb4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_recommended_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_recommended_sensitivity_labels_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseRecommendedSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseRecommendedSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -29,17 +29,13 @@ async def test_managed_database_recommended_sensitivity_labels_update(self, reso parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "table": "str", + "properties": {"column": "str", "op": "str", "schema": "str", "table": "str"}, "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations.py index bd0907b34c0f..833c766ee2f1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseRestoreDetailsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseRestoreDetailsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -26,7 +26,6 @@ def test_managed_database_restore_details_get(self, resource_group): managed_instance_name="str", database_name="str", restore_details_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations_async.py index 756e96688243..b497ceafcf77 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_restore_details_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_restore_details_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseRestoreDetailsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseRestoreDetailsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,7 +27,6 @@ async def test_managed_database_restore_details_get(self, resource_group): managed_instance_name="str", database_name="str", restore_details_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations.py index 6c40f62b9822..90dc6f9e7f4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,33 +14,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSchemasOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSchemasOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_schemas_list_by_database(self, resource_group): - response = self.client.managed_database_schemas.list_by_database( + def test_managed_database_schemas_get(self, resource_group): + response = self.client.managed_database_schemas.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_schemas_get(self, resource_group): - response = self.client.managed_database_schemas.get( + def test_managed_database_schemas_list_by_database(self, resource_group): + response = self.client.managed_database_schemas.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations_async.py index 45d6ceebdd1a..0ccc85915930 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_schemas_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_schemas_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,33 +15,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSchemasOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSchemasOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_schemas_list_by_database(self, resource_group): - response = self.client.managed_database_schemas.list_by_database( + async def test_managed_database_schemas_get(self, resource_group): + response = await self.client.managed_database_schemas.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_schemas_get(self, resource_group): - response = await self.client.managed_database_schemas.get( + async def test_managed_database_schemas_list_by_database(self, resource_group): + response = self.client.managed_database_schemas.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations.py similarity index 69% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations.py index b58053ae58a2..c896e10458df 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.managed_database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_managed_database_security_alert_policies_get(self, resource_group): managed_instance_name="str", database_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,20 +40,41 @@ def test_managed_database_security_alert_policies_create_or_update(self, resourc database_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.managed_database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations_async.py similarity index 70% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations_async.py index 31e1cacd63be..6124851aec3d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_alert_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_security_alert_policies_list_by_database(self, resource_group): - response = self.client.managed_database_security_alert_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_database_security_alert_policies_get(self, resource_group managed_instance_name="str", database_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,20 +41,41 @@ async def test_managed_database_security_alert_policies_create_or_update(self, r database_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_security_alert_policies_list_by_database(self, resource_group): + response = self.client.managed_database_security_alert_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations.py index 6756e6d10150..94332cfbe49a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSecurityEventsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSecurityEventsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_managed_database_security_events_list_by_database(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations_async.py index df0b9d707b82..753876e4da89 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_security_events_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_security_events_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSecurityEventsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSecurityEventsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_managed_database_security_events_list_by_database(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations.py similarity index 67% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations.py index 1d42ea5c151c..3fc2511941cf 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,60 +14,63 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSensitivityLabelsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSensitivityLabelsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_current_by_database( + def test_managed_database_sensitivity_labels_get(self, resource_group): + response = self.client.managed_database_sensitivity_labels.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_update(self, resource_group): - response = self.client.managed_database_sensitivity_labels.update( + def test_managed_database_sensitivity_labels_create_or_update(self, resource_group): + response = self.client.managed_database_sensitivity_labels.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", parameters={ - "operations": [ - { - "column": "str", - "id": "str", - "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - "table": "str", - "type": "str", - } - ] + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -75,21 +78,24 @@ def test_managed_database_sensitivity_labels_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + def test_managed_database_sensitivity_labels_delete(self, resource_group): + response = self.client.managed_database_sensitivity_labels.delete( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_get(self, resource_group): - response = self.client.managed_database_sensitivity_labels.get( + def test_managed_database_sensitivity_labels_disable_recommendation(self, resource_group): + response = self.client.managed_database_sensitivity_labels.disable_recommendation( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", @@ -97,7 +103,6 @@ def test_managed_database_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,32 +110,15 @@ def test_managed_database_sensitivity_labels_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_create_or_update(self, resource_group): - response = self.client.managed_database_sensitivity_labels.create_or_update( + def test_managed_database_sensitivity_labels_enable_recommendation(self, resource_group): + response = self.client.managed_database_sensitivity_labels.enable_recommendation( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - parameters={ - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - sensitivity_label_source="current", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -138,33 +126,64 @@ def test_managed_database_sensitivity_labels_create_or_update(self, resource_gro @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_delete(self, resource_group): - response = self.client.managed_database_sensitivity_labels.delete( + def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_current_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="current", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_disable_recommendation(self, resource_group): - response = self.client.managed_database_sensitivity_labels.disable_recommendation( + def test_managed_database_sensitivity_labels_update(self, resource_group): + response = self.client.managed_database_sensitivity_labels.update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + parameters={ + "operations": [ + { + "id": "str", + "name": "str", + "properties": { + "column": "str", + "op": "str", + "schema": "str", + "table": "str", + "sensitivityLabel": { + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + }, + "type": "str", + } + ] + }, ) # please add some check logic here by yourself @@ -172,18 +191,13 @@ def test_managed_database_sensitivity_labels_disable_recommendation(self, resour @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_sensitivity_labels_enable_recommendation(self, resource_group): - response = self.client.managed_database_sensitivity_labels.enable_recommendation( + def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -194,7 +208,6 @@ def test_managed_database_sensitivity_labels_list_by_database(self, resource_gro resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations_async.py similarity index 68% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations_async.py index d41528504737..2a7c8bfe4778 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_sensitivity_labels_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,60 +15,63 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_current_by_database( + async def test_managed_database_sensitivity_labels_get(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_update(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.update( + async def test_managed_database_sensitivity_labels_create_or_update(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", parameters={ - "operations": [ - { - "column": "str", - "id": "str", - "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - "table": "str", - "type": "str", - } - ] + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,21 +79,24 @@ async def test_managed_database_sensitivity_labels_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): - response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( + async def test_managed_database_sensitivity_labels_delete(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.delete( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + schema_name="str", + table_name="str", + column_name="str", + sensitivity_label_source="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_get(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.get( + async def test_managed_database_sensitivity_labels_disable_recommendation(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.disable_recommendation( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", @@ -98,7 +104,6 @@ async def test_managed_database_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -106,32 +111,15 @@ async def test_managed_database_sensitivity_labels_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_create_or_update(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.create_or_update( + async def test_managed_database_sensitivity_labels_enable_recommendation(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.enable_recommendation( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", table_name="str", column_name="str", - parameters={ - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", - }, - sensitivity_label_source="current", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -139,33 +127,64 @@ async def test_managed_database_sensitivity_labels_create_or_update(self, resour @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_delete(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.delete( + async def test_managed_database_sensitivity_labels_list_current_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_current_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="current", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_disable_recommendation(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.disable_recommendation( + async def test_managed_database_sensitivity_labels_update(self, resource_group): + response = await self.client.managed_database_sensitivity_labels.update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + parameters={ + "operations": [ + { + "id": "str", + "name": "str", + "properties": { + "column": "str", + "op": "str", + "schema": "str", + "table": "str", + "sensitivityLabel": { + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + }, + "type": "str", + } + ] + }, ) # please add some check logic here by yourself @@ -173,18 +192,13 @@ async def test_managed_database_sensitivity_labels_disable_recommendation(self, @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_sensitivity_labels_enable_recommendation(self, resource_group): - response = await self.client.managed_database_sensitivity_labels.enable_recommendation( + async def test_managed_database_sensitivity_labels_list_recommended_by_database(self, resource_group): + response = self.client.managed_database_sensitivity_labels.list_recommended_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - schema_name="str", - table_name="str", - column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -195,7 +209,6 @@ async def test_managed_database_sensitivity_labels_list_by_database(self, resour resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations.py index 787e580c9882..6148c2ce347b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseTablesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseTablesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_tables_list_by_schema(self, resource_group): - response = self.client.managed_database_tables.list_by_schema( + def test_managed_database_tables_get(self, resource_group): + response = self.client.managed_database_tables.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", - api_version="2025-01-01", + table_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_tables_get(self, resource_group): - response = self.client.managed_database_tables.get( + def test_managed_database_tables_list_by_schema(self, resource_group): + response = self.client.managed_database_tables.list_by_schema( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", - table_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations_async.py similarity index 83% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations_async.py index b70d190aa2f2..5fdd3043a520 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_tables_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_tables_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,35 +15,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseTablesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseTablesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_tables_list_by_schema(self, resource_group): - response = self.client.managed_database_tables.list_by_schema( + async def test_managed_database_tables_get(self, resource_group): + response = await self.client.managed_database_tables.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", - api_version="2025-01-01", + table_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_tables_get(self, resource_group): - response = await self.client.managed_database_tables.get( + async def test_managed_database_tables_list_by_schema(self, resource_group): + response = self.client.managed_database_tables.list_by_schema( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", schema_name="str", - table_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations.py index cfe148a1d5f5..963a194cd467 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,32 +14,45 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseTransparentDataEncryptionOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseTransparentDataEncryptionOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.list_by_database( + def test_managed_database_transparent_data_encryption_get(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + tde_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_get(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.get( + def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -47,15 +60,12 @@ def test_managed_database_transparent_data_encryption_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.create_or_update( + def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations_async.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations_async.py index 93044236e3d7..564cc2001881 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_transparent_data_encryption_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_transparent_data_encryption_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,32 +15,45 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseTransparentDataEncryptionOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseTransparentDataEncryptionOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): - response = self.client.managed_database_transparent_data_encryption.list_by_database( + async def test_managed_database_transparent_data_encryption_get(self, resource_group): + response = await self.client.managed_database_transparent_data_encryption.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + tde_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_get(self, resource_group): - response = await self.client.managed_database_transparent_data_encryption.get( + async def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): + response = await self.client.managed_database_transparent_data_encryption.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -48,15 +61,12 @@ async def test_managed_database_transparent_data_encryption_get(self, resource_g @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_transparent_data_encryption_create_or_update(self, resource_group): - response = await self.client.managed_database_transparent_data_encryption.create_or_update( + async def test_managed_database_transparent_data_encryption_list_by_database(self, resource_group): + response = self.client.managed_database_transparent_data_encryption.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - tde_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations.py index 412ffad28b0c..37219d15de21 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -28,7 +28,6 @@ def test_managed_database_vulnerability_assessment_rule_baselines_get(self, reso vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -44,8 +43,20 @@ def test_managed_database_vulnerability_assessment_rule_baselines_create_or_upda vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"baselineResults": [{"result": ["str"]}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -61,7 +72,6 @@ def test_managed_database_vulnerability_assessment_rule_baselines_delete(self, r vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations_async.py index 191440b59171..e8fc28d41265 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_rule_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -29,7 +29,6 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_get(self vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -45,8 +44,20 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_create_o vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - parameters={"baselineResults": [{"result": ["str"]}], "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"baselineResults": [{"result": ["str"]}]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself @@ -62,7 +73,6 @@ async def test_managed_database_vulnerability_assessment_rule_baselines_delete(s vulnerability_assessment_name="str", rule_id="str", baseline_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations.py index bb55040ad192..75bc0f47c123 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,36 +14,34 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( + def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.get( + def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -56,7 +54,6 @@ def test_managed_database_vulnerability_assessment_scans_export(self, resource_g database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -71,7 +68,6 @@ def test_managed_database_vulnerability_assessment_scans_begin_initiate_scan(sel database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations_async.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations_async.py index b02c50aaeb96..e3133fd51012 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessment_scans_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,36 +15,34 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( + async def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): + response = await self.client.managed_database_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", + scan_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessment_scans_get(self, resource_group): - response = await self.client.managed_database_vulnerability_assessment_scans.get( + async def test_managed_database_vulnerability_assessment_scans_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessment_scans.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - scan_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -57,7 +55,6 @@ async def test_managed_database_vulnerability_assessment_scans_export(self, reso database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -73,7 +70,6 @@ async def test_managed_database_vulnerability_assessment_scans_begin_initiate_sc database_name="str", vulnerability_assessment_name="str", scan_id="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations.py index c3438f6141cf..499a913ef462 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_managed_database_vulnerability_assessments_get(self, resource_group): managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,13 +42,22 @@ def test_managed_database_vulnerability_assessments_create_or_update(self, resou parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerPath": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -76,8 +71,19 @@ def test_managed_database_vulnerability_assessments_delete(self, resource_group) managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations_async.py index b24358ecdd72..d7ee46951405 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_database_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_database_vulnerability_assessments_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabaseVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabaseVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): - response = self.client.managed_database_vulnerability_assessments.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_database_vulnerability_assessments_get(self, resource_gro managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,13 +43,22 @@ async def test_managed_database_vulnerability_assessments_create_or_update(self, parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerPath": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -77,8 +72,19 @@ async def test_managed_database_vulnerability_assessments_delete(self, resource_ managed_instance_name="str", database_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_database_vulnerability_assessments_list_by_database(self, resource_group): + response = self.client.managed_database_vulnerability_assessments.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations.py index 87cabee6752d..ed7b948c37bd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabasesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_databases_list_by_instance(self, resource_group): - response = self.client.managed_databases.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,40 +39,49 @@ def test_managed_databases_begin_create_or_update(self, resource_group): database_name="str", parameters={ "location": "str", - "autoCompleteRestore": bool, - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "crossSubscriptionRestorableDroppedDatabaseId": "str", - "crossSubscriptionSourceDatabaseId": "str", - "crossSubscriptionTargetManagedInstanceId": "str", - "defaultSecondaryLocation": "str", - "earliestRestorePoint": "2020-02-20 00:00:00", - "extendedAccessibilityInfo": { - "inaccessibilityReasonDescription": "str", - "inaccessibilityReasonErrorCode": "str", - "inaccessibilityReasonKind": "str", - "inaccessibilityReasonTdeKeyUri": "str", - }, - "failoverGroupId": "str", "id": "str", - "isLedgerOn": bool, - "lastBackupName": "str", - "longTermRetentionBackupResourceId": "str", "name": "str", - "recoverableDatabaseId": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "status": "str", - "storageContainerIdentity": "str", - "storageContainerSasToken": "str", - "storageContainerUri": "str", + "properties": { + "autoCompleteRestore": bool, + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "crossSubscriptionRestorableDroppedDatabaseId": "str", + "crossSubscriptionSourceDatabaseId": "str", + "crossSubscriptionTargetManagedInstanceId": "str", + "defaultSecondaryLocation": "str", + "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, + "failoverGroupId": "str", + "isLedgerOn": bool, + "lastBackupName": "str", + "longTermRetentionBackupResourceId": "str", + "recoverableDatabaseId": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "status": "str", + "storageContainerIdentity": "str", + "storageContainerSasToken": "str", + "storageContainerUri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -93,12 +89,44 @@ def test_managed_databases_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_databases_begin_delete(self, resource_group): - response = self.client.managed_databases.begin_delete( + def test_managed_databases_begin_update(self, resource_group): + response = self.client.managed_databases.begin_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "autoCompleteRestore": bool, + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "crossSubscriptionRestorableDroppedDatabaseId": "str", + "crossSubscriptionSourceDatabaseId": "str", + "crossSubscriptionTargetManagedInstanceId": "str", + "defaultSecondaryLocation": "str", + "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, + "failoverGroupId": "str", + "isLedgerOn": bool, + "lastBackupName": "str", + "longTermRetentionBackupResourceId": "str", + "recoverableDatabaseId": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "status": "str", + "storageContainerIdentity": "str", + "storageContainerSasToken": "str", + "storageContainerUri": "str", + }, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -106,48 +134,27 @@ def test_managed_databases_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_databases_begin_update(self, resource_group): - response = self.client.managed_databases.begin_update( + def test_managed_databases_begin_delete(self, resource_group): + response = self.client.managed_databases.begin_delete( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - parameters={ - "autoCompleteRestore": bool, - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "crossSubscriptionRestorableDroppedDatabaseId": "str", - "crossSubscriptionSourceDatabaseId": "str", - "crossSubscriptionTargetManagedInstanceId": "str", - "defaultSecondaryLocation": "str", - "earliestRestorePoint": "2020-02-20 00:00:00", - "extendedAccessibilityInfo": { - "inaccessibilityReasonDescription": "str", - "inaccessibilityReasonErrorCode": "str", - "inaccessibilityReasonKind": "str", - "inaccessibilityReasonTdeKeyUri": "str", - }, - "failoverGroupId": "str", - "isLedgerOn": bool, - "lastBackupName": "str", - "longTermRetentionBackupResourceId": "str", - "recoverableDatabaseId": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "status": "str", - "storageContainerIdentity": "str", - "storageContainerSasToken": "str", - "storageContainerUri": "str", - "tags": {"str": "str"}, - }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_databases_list_by_instance(self, resource_group): + response = self.client.managed_databases.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_databases_begin_cancel_move(self, resource_group): @@ -156,7 +163,6 @@ def test_managed_databases_begin_cancel_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -170,7 +176,6 @@ def test_managed_databases_begin_complete_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -184,7 +189,6 @@ def test_managed_databases_begin_complete_restore(self, resource_group): managed_instance_name="str", database_name="str", parameters={"lastBackupName": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -197,7 +201,6 @@ def test_managed_databases_begin_reevaluate_inaccessible_database_state(self, re resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -211,7 +214,6 @@ def test_managed_databases_begin_start_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str", "operationMode": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -223,7 +225,6 @@ def test_managed_databases_list_inaccessible_by_instance(self, resource_group): response = self.client.managed_databases.list_inaccessible_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations_async.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations_async.py index 71236e4a65de..a48fd05a2b34 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_databases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_databases_list_by_instance(self, resource_group): - response = self.client.managed_databases.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_databases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,40 +41,49 @@ async def test_managed_databases_begin_create_or_update(self, resource_group): database_name="str", parameters={ "location": "str", - "autoCompleteRestore": bool, - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "crossSubscriptionRestorableDroppedDatabaseId": "str", - "crossSubscriptionSourceDatabaseId": "str", - "crossSubscriptionTargetManagedInstanceId": "str", - "defaultSecondaryLocation": "str", - "earliestRestorePoint": "2020-02-20 00:00:00", - "extendedAccessibilityInfo": { - "inaccessibilityReasonDescription": "str", - "inaccessibilityReasonErrorCode": "str", - "inaccessibilityReasonKind": "str", - "inaccessibilityReasonTdeKeyUri": "str", - }, - "failoverGroupId": "str", "id": "str", - "isLedgerOn": bool, - "lastBackupName": "str", - "longTermRetentionBackupResourceId": "str", "name": "str", - "recoverableDatabaseId": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "status": "str", - "storageContainerIdentity": "str", - "storageContainerSasToken": "str", - "storageContainerUri": "str", + "properties": { + "autoCompleteRestore": bool, + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "crossSubscriptionRestorableDroppedDatabaseId": "str", + "crossSubscriptionSourceDatabaseId": "str", + "crossSubscriptionTargetManagedInstanceId": "str", + "defaultSecondaryLocation": "str", + "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, + "failoverGroupId": "str", + "isLedgerOn": bool, + "lastBackupName": "str", + "longTermRetentionBackupResourceId": "str", + "recoverableDatabaseId": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "status": "str", + "storageContainerIdentity": "str", + "storageContainerSasToken": "str", + "storageContainerUri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -96,13 +92,45 @@ async def test_managed_databases_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_databases_begin_delete(self, resource_group): + async def test_managed_databases_begin_update(self, resource_group): response = await ( - await self.client.managed_databases.begin_delete( + await self.client.managed_databases.begin_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + parameters={ + "properties": { + "autoCompleteRestore": bool, + "catalogCollation": "str", + "collation": "str", + "createMode": "str", + "creationDate": "2020-02-20 00:00:00", + "crossSubscriptionRestorableDroppedDatabaseId": "str", + "crossSubscriptionSourceDatabaseId": "str", + "crossSubscriptionTargetManagedInstanceId": "str", + "defaultSecondaryLocation": "str", + "earliestRestorePoint": "2020-02-20 00:00:00", + "extendedAccessibilityInfo": { + "inaccessibilityReasonDescription": "str", + "inaccessibilityReasonErrorCode": "str", + "inaccessibilityReasonKind": "str", + "inaccessibilityReasonTdeKeyUri": "str", + }, + "failoverGroupId": "str", + "isLedgerOn": bool, + "lastBackupName": "str", + "longTermRetentionBackupResourceId": "str", + "recoverableDatabaseId": "str", + "restorableDroppedDatabaseId": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "sourceDatabaseId": "str", + "status": "str", + "storageContainerIdentity": "str", + "storageContainerSasToken": "str", + "storageContainerUri": "str", + }, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -111,50 +139,29 @@ async def test_managed_databases_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_databases_begin_update(self, resource_group): + async def test_managed_databases_begin_delete(self, resource_group): response = await ( - await self.client.managed_databases.begin_update( + await self.client.managed_databases.begin_delete( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - parameters={ - "autoCompleteRestore": bool, - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "crossSubscriptionRestorableDroppedDatabaseId": "str", - "crossSubscriptionSourceDatabaseId": "str", - "crossSubscriptionTargetManagedInstanceId": "str", - "defaultSecondaryLocation": "str", - "earliestRestorePoint": "2020-02-20 00:00:00", - "extendedAccessibilityInfo": { - "inaccessibilityReasonDescription": "str", - "inaccessibilityReasonErrorCode": "str", - "inaccessibilityReasonKind": "str", - "inaccessibilityReasonTdeKeyUri": "str", - }, - "failoverGroupId": "str", - "isLedgerOn": bool, - "lastBackupName": "str", - "longTermRetentionBackupResourceId": "str", - "recoverableDatabaseId": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "status": "str", - "storageContainerIdentity": "str", - "storageContainerSasToken": "str", - "storageContainerUri": "str", - "tags": {"str": "str"}, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_databases_list_by_instance(self, resource_group): + response = self.client.managed_databases.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_databases_begin_cancel_move(self, resource_group): @@ -164,7 +171,6 @@ async def test_managed_databases_begin_cancel_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -180,7 +186,6 @@ async def test_managed_databases_begin_complete_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -196,7 +201,6 @@ async def test_managed_databases_begin_complete_restore(self, resource_group): managed_instance_name="str", database_name="str", parameters={"lastBackupName": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -211,7 +215,6 @@ async def test_managed_databases_begin_reevaluate_inaccessible_database_state(se resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -227,7 +230,6 @@ async def test_managed_databases_begin_start_move(self, resource_group): managed_instance_name="str", database_name="str", parameters={"destinationManagedDatabaseId": "str", "operationMode": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -240,7 +242,6 @@ async def test_managed_databases_list_inaccessible_by_instance(self, resource_gr response = self.client.managed_databases.list_inaccessible_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations.py index eff0cd579a25..575a1b9deb92 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAdministratorsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAdministratorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_administrators_list_by_instance(self, resource_group): - response = self.client.managed_instance_administrators.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_administrators_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,15 +38,19 @@ def test_managed_instance_administrators_begin_create_or_update(self, resource_g managed_instance_name="str", administrator_name="str", parameters={ - "administratorType": "str", "id": "str", - "login": "str", "name": "str", - "sid": "str", - "tenantId": "str", + "properties": {"administratorType": "str", "login": "str", "sid": "str", "tenantId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,8 +63,18 @@ def test_managed_instance_administrators_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_administrators_list_by_instance(self, resource_group): + response = self.client.managed_instance_administrators.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations_async.py index dfd16aa59ab8..4a06bf4e24a4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_administrators_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_administrators_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_administrators_list_by_instance(self, resource_group): - response = self.client.managed_instance_administrators.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_administrators_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,15 +40,19 @@ async def test_managed_instance_administrators_begin_create_or_update(self, reso managed_instance_name="str", administrator_name="str", parameters={ - "administratorType": "str", "id": "str", - "login": "str", "name": "str", - "sid": "str", - "tenantId": "str", + "properties": {"administratorType": "str", "login": "str", "sid": "str", "tenantId": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -76,9 +67,19 @@ async def test_managed_instance_administrators_begin_delete(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", administrator_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_administrators_list_by_instance(self, resource_group): + response = self.client.managed_instance_administrators.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations.py index 992c5f866859..c6cfb1299f99 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_advanced_threat_protection_settings_list_by_instance(self, resource_group): - response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_advanced_threat_protection_settings_get(self, resource resource_group_name=resource_group.name, managed_instance_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,10 +38,9 @@ def test_managed_instance_advanced_threat_protection_settings_begin_create_or_up managed_instance_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,8 +51,18 @@ def test_managed_instance_advanced_threat_protection_settings_begin_create_or_up }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_advanced_threat_protection_settings_list_by_instance(self, resource_group): + response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations_async.py index 433bb93a4d95..9d8a60cce5db 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_advanced_threat_protection_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_advanced_threat_protection_settings_list_by_instance(self, resource_group): - response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_advanced_threat_protection_settings_get(self, re resource_group_name=resource_group.name, managed_instance_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,10 +40,9 @@ async def test_managed_instance_advanced_threat_protection_settings_begin_create managed_instance_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -67,9 +53,19 @@ async def test_managed_instance_advanced_threat_protection_settings_begin_create }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_advanced_threat_protection_settings_list_by_instance(self, resource_group): + response = self.client.managed_instance_advanced_threat_protection_settings.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations.py index 3dbf3e6d925b..f62d8852de70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAzureADOnlyAuthenticationsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAzureADOnlyAuthenticationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): - response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_azure_ad_only_authentications_get(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,8 +37,20 @@ def test_managed_instance_azure_ad_only_authentications_begin_create_or_update(s resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"azureADOnlyAuthentication": bool}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,8 +63,18 @@ def test_managed_instance_azure_ad_only_authentications_begin_delete(self, resou resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): + response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations_async.py index 75d5dfdcc5d3..4a8888d14e4c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_azure_ad_only_authentications_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_azure_ad_only_authentications_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceAzureADOnlyAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceAzureADOnlyAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): - response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_azure_ad_only_authentications_get(self, resource resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,8 +39,20 @@ async def test_managed_instance_azure_ad_only_authentications_begin_create_or_up resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"azureADOnlyAuthentication": bool}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -68,9 +67,19 @@ async def test_managed_instance_azure_ad_only_authentications_begin_delete(self, resource_group_name=resource_group.name, managed_instance_name="str", authentication_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_azure_ad_only_authentications_list_by_instance(self, resource_group): + response = self.client.managed_instance_azure_ad_only_authentications.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations.py similarity index 61% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations.py index 0b9c83977ac9..2740ab7abe70 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceDtcsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceDtcsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_dtcs_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_dtcs.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_dtcs_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dtc_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,27 +38,48 @@ def test_managed_instance_dtcs_begin_create_or_update(self, resource_group): managed_instance_name="str", dtc_name="str", parameters={ - "dtcEnabled": bool, - "dtcHostNameDnsSuffix": "str", - "externalDnsSuffixSearchList": ["str"], "id": "str", "name": "str", - "provisioningState": "str", - "securitySettings": { - "snaLu6point2TransactionsEnabled": bool, - "transactionManagerCommunicationSettings": { - "allowInboundEnabled": bool, - "allowOutboundEnabled": bool, - "authentication": "str", + "properties": { + "dtcEnabled": bool, + "dtcHostNameDnsSuffix": "str", + "externalDnsSuffixSearchList": ["str"], + "fqdnEnabled": bool, + "provisioningState": "str", + "securitySettings": { + "snaLu6point2TransactionsEnabled": bool, + "transactionManagerCommunicationSettings": { + "allowInboundEnabled": bool, + "allowOutboundEnabled": bool, + "authentication": "str", + }, + "xaTransactionsDefaultTimeout": 0, + "xaTransactionsEnabled": bool, + "xaTransactionsMaximumTimeout": 0, }, - "xaTransactionsDefaultTimeout": 0, - "xaTransactionsEnabled": bool, - "xaTransactionsMaximumTimeout": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_dtcs_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_dtcs.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations_async.py similarity index 61% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations_async.py index b5c0544f3a8d..37c37ee9eb33 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_dtcs_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_dtcs_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceDtcsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceDtcsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_dtcs_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_dtcs.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_dtcs_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dtc_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,28 +40,49 @@ async def test_managed_instance_dtcs_begin_create_or_update(self, resource_group managed_instance_name="str", dtc_name="str", parameters={ - "dtcEnabled": bool, - "dtcHostNameDnsSuffix": "str", - "externalDnsSuffixSearchList": ["str"], "id": "str", "name": "str", - "provisioningState": "str", - "securitySettings": { - "snaLu6point2TransactionsEnabled": bool, - "transactionManagerCommunicationSettings": { - "allowInboundEnabled": bool, - "allowOutboundEnabled": bool, - "authentication": "str", + "properties": { + "dtcEnabled": bool, + "dtcHostNameDnsSuffix": "str", + "externalDnsSuffixSearchList": ["str"], + "fqdnEnabled": bool, + "provisioningState": "str", + "securitySettings": { + "snaLu6point2TransactionsEnabled": bool, + "transactionManagerCommunicationSettings": { + "allowInboundEnabled": bool, + "allowOutboundEnabled": bool, + "authentication": "str", + }, + "xaTransactionsDefaultTimeout": 0, + "xaTransactionsEnabled": bool, + "xaTransactionsMaximumTimeout": 0, }, - "xaTransactionsDefaultTimeout": 0, - "xaTransactionsEnabled": bool, - "xaTransactionsMaximumTimeout": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_dtcs_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_dtcs.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations.py index 5887aaff3f38..451a0a59e2a2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceEncryptionProtectorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): - response = self.client.managed_instance_encryption_protectors.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,22 +38,42 @@ def test_managed_instance_encryption_protectors_begin_create_or_update(self, res managed_instance_name="str", encryption_protector_name="str", parameters={ - "autoRotationEnabled": bool, "id": "str", "kind": "str", "name": "str", - "serverKeyName": "str", - "serverKeyType": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "serverKeyName": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): + response = self.client.managed_instance_encryption_protectors.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): @@ -74,7 +81,6 @@ def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations_async.py index 709584fb1bb6..6b07c6bca6dd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_encryption_protectors_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_encryption_protectors_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceEncryptionProtectorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): - response = self.client.managed_instance_encryption_protectors.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_encryption_protectors_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,23 +40,43 @@ async def test_managed_instance_encryption_protectors_begin_create_or_update(sel managed_instance_name="str", encryption_protector_name="str", parameters={ - "autoRotationEnabled": bool, "id": "str", "kind": "str", "name": "str", - "serverKeyName": "str", - "serverKeyType": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "serverKeyName": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_encryption_protectors_list_by_instance(self, resource_group): + response = self.client.managed_instance_encryption_protectors.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_instance_encryption_protectors_begin_revalidate(self, resource_group): @@ -78,7 +85,6 @@ async def test_managed_instance_encryption_protectors_begin_revalidate(self, res resource_group_name=resource_group.name, managed_instance_name="str", encryption_protector_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations.py index 0dfa46ceb1bd..10ddf7866cb0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceKeysOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceKeysOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_keys_list_by_instance(self, resource_group): - response = self.client.managed_instance_keys.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_keys_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,17 +38,26 @@ def test_managed_instance_keys_begin_create_or_update(self, resource_group): managed_instance_name="str", key_name="str", parameters={ - "autoRotationEnabled": bool, - "creationDate": "2020-02-20 00:00:00", "id": "str", "kind": "str", "name": "str", - "serverKeyType": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "creationDate": "2020-02-20 00:00:00", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,8 +70,18 @@ def test_managed_instance_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_keys_list_by_instance(self, resource_group): + response = self.client.managed_instance_keys.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations_async.py index 6cb2d5f0c9f2..20ca7b5c81d7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_keys_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_keys_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceKeysOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceKeysOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_keys_list_by_instance(self, resource_group): - response = self.client.managed_instance_keys.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_keys_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,17 +40,26 @@ async def test_managed_instance_keys_begin_create_or_update(self, resource_group managed_instance_name="str", key_name="str", parameters={ - "autoRotationEnabled": bool, - "creationDate": "2020-02-20 00:00:00", "id": "str", "kind": "str", "name": "str", - "serverKeyType": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "creationDate": "2020-02-20 00:00:00", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,9 +74,19 @@ async def test_managed_instance_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", key_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_keys_list_by_instance(self, resource_group): + response = self.client.managed_instance_keys.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations.py index fd4412a6203d..d3db68e53007 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceLongTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceLongTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_instance_long_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_managed_instance_long_term_retention_policies_get(self, resource_group) managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,16 +40,25 @@ def test_managed_instance_long_term_retention_policies_begin_create_or_update(se database_name="str", policy_name="str", parameters={ - "backupStorageAccessTier": "str", "id": "str", - "monthlyRetention": "str", "name": "str", + "properties": { + "backupStorageAccessTier": "str", + "monthlyRetention": "str", + "weekOfYear": 0, + "weeklyRetention": "str", + "yearlyRetention": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "weekOfYear": 0, - "weeklyRetention": "str", - "yearlyRetention": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,8 +72,19 @@ def test_managed_instance_long_term_retention_policies_begin_delete(self, resour managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_instance_long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations_async.py index 2a0cd3444bce..5037bfee1d46 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_long_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_long_term_retention_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceLongTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceLongTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): - response = self.client.managed_instance_long_term_retention_policies.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_instance_long_term_retention_policies_get(self, resource_ managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -56,16 +42,25 @@ async def test_managed_instance_long_term_retention_policies_begin_create_or_upd database_name="str", policy_name="str", parameters={ - "backupStorageAccessTier": "str", "id": "str", - "monthlyRetention": "str", "name": "str", + "properties": { + "backupStorageAccessTier": "str", + "monthlyRetention": "str", + "weekOfYear": 0, + "weeklyRetention": "str", + "yearlyRetention": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "weekOfYear": 0, - "weeklyRetention": "str", - "yearlyRetention": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -81,9 +76,20 @@ async def test_managed_instance_long_term_retention_policies_begin_delete(self, managed_instance_name="str", database_name="str", policy_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_long_term_retention_policies_list_by_database(self, resource_group): + response = self.client.managed_instance_long_term_retention_policies.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations.py index 480c2e20d5b1..d0d2c85a77e2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,32 +14,30 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_instance_operations_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_operations.list_by_managed_instance( + def test_managed_instance_operations_get(self, resource_group): + response = self.client.managed_instance_operations.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_instance_operations_get(self, resource_group): - response = self.client.managed_instance_operations.get( + def test_managed_instance_operations_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_operations.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -50,7 +48,6 @@ def test_managed_instance_operations_cancel(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations_async.py index 5faee62e6334..059e67f9cb18 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,32 +15,30 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_instance_operations_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_operations.list_by_managed_instance( + async def test_managed_instance_operations_get(self, resource_group): + response = await self.client.managed_instance_operations.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + operation_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_instance_operations_get(self, resource_group): - response = await self.client.managed_instance_operations.get( + async def test_managed_instance_operations_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_operations.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - operation_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -51,7 +49,6 @@ async def test_managed_instance_operations_cancel(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", operation_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations.py index 65f9ad65810e..a33cf84429c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancePrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstancePrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_private_endpoint_connections_get(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,12 +40,25 @@ def test_managed_instance_private_endpoint_connections_begin_create_or_update(se parameters={ "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": {"description": "str", "status": "str", "actionsRequired": "str"}, - "provisioningState": "str", + "properties": { + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,8 +71,18 @@ def test_managed_instance_private_endpoint_connections_begin_delete(self, resour resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations_async.py index 7ddedf4245e4..0d15ef079422 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_endpoint_connections_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_endpoint_connections_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancePrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstancePrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_private_endpoint_connections_get(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,16 +42,25 @@ async def test_managed_instance_private_endpoint_connections_begin_create_or_upd parameters={ "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", + "properties": { + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "provisioningState": "str", "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -79,9 +75,19 @@ async def test_managed_instance_private_endpoint_connections_begin_delete(self, resource_group_name=resource_group.name, managed_instance_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_private_endpoint_connections_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_endpoint_connections.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations.py index 3cb32934a9c5..c9407e4a4e09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancePrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstancePrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_instance_private_link_resources_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_link_resources.list_by_managed_instance( + def test_managed_instance_private_link_resources_get(self, resource_group): + response = self.client.managed_instance_private_link_resources.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + group_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_instance_private_link_resources_get(self, resource_group): - response = self.client.managed_instance_private_link_resources.get( + def test_managed_instance_private_link_resources_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_link_resources.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - group_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations_async.py index 7b9b4abaf4f2..b89747a977ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_private_link_resources_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_private_link_resources_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancePrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstancePrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_instance_private_link_resources_list_by_managed_instance(self, resource_group): - response = self.client.managed_instance_private_link_resources.list_by_managed_instance( + async def test_managed_instance_private_link_resources_get(self, resource_group): + response = await self.client.managed_instance_private_link_resources.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + group_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_managed_instance_private_link_resources_get(self, resource_group): - response = await self.client.managed_instance_private_link_resources.get( + async def test_managed_instance_private_link_resources_list_by_managed_instance(self, resource_group): + response = self.client.managed_instance_private_link_resources.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - group_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations.py index 164233ee5f5e..3eda34ab10c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceTdeCertificatesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceTdeCertificatesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,8 +24,12 @@ def test_managed_instance_tde_certificates_begin_create(self, resource_group): response = self.client.managed_instance_tde_certificates.begin_create( resource_group_name=resource_group.name, managed_instance_name="str", - parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"privateBlob": "str", "certPassword": "str"}, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations_async.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations_async.py index b46de20ad99b..f7b756dfdcb3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_tde_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_tde_certificates_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceTdeCertificatesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceTdeCertificatesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,8 +26,12 @@ async def test_managed_instance_tde_certificates_begin_create(self, resource_gro await self.client.managed_instance_tde_certificates.begin_create( resource_group_name=resource_group.name, managed_instance_name="str", - parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"privateBlob": "str", "certPassword": "str"}, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations.py index 36c6c2f980f7..e6196b83a043 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): - response = self.client.managed_instance_vulnerability_assessments.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_instance_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,13 +40,22 @@ def test_managed_instance_vulnerability_assessments_create_or_update(self, resou parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "storageContainerPath": "str", + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,8 +68,18 @@ def test_managed_instance_vulnerability_assessments_delete(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): + response = self.client.managed_instance_vulnerability_assessments.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations_async.py index da86f29a27ef..3e1919688452 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instance_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instance_vulnerability_assessments_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstanceVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstanceVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): - response = self.client.managed_instance_vulnerability_assessments.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_instance_vulnerability_assessments_get(self, resource_gro resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,13 +41,22 @@ async def test_managed_instance_vulnerability_assessments_create_or_update(self, parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "storageContainerPath": "str", + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -73,8 +69,18 @@ async def test_managed_instance_vulnerability_assessments_delete(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instance_vulnerability_assessments_list_by_instance(self, resource_group): + response = self.client.managed_instance_vulnerability_assessments.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations.py similarity index 63% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations.py index e3de9eefca57..3c65c0375ce1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations.py @@ -2,77 +2,50 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql import SqlClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy AZURE_LOCATION = "eastus" @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedInstancesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_list(self, resource_group): - response = self.client.managed_instances.list( - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_list_by_instance_pool(self, resource_group): - response = self.client.managed_instances.list_by_instance_pool( + @recorded_by_proxy + def test_managed_instances_get(self, resource_group): + response = self.client.managed_instances.get( resource_group_name=resource_group.name, - instance_pool_name="str", - api_version="2025-01-01", + managed_instance_name="str", ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_list_by_resource_group(self, resource_group): - response = self.client.managed_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_get(self, resource_group): - response = await self.client.managed_instances.get( + @recorded_by_proxy + def test_managed_instances_begin_create_or_update(self, resource_group): + response = self.client.managed_instances.begin_create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_create_or_update(self, resource_group): - response = await ( - await self.client.managed_instances.begin_create_or_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={ - "location": "str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", "administrators": { @@ -94,13 +67,6 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "fullyQualifiedDomainName": "str", "hybridSecondaryUsage": "str", "hybridSecondaryUsageDetected": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "instancePoolId": "str", "isGeneralPurposeV2": bool, "keyId": "str", @@ -109,7 +75,6 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "managedInstanceCreateMode": "str", "memorySizeInGB": 0, "minimalTlsVersion": "str", - "name": "str", "pricingModel": "str", "primaryUserAssignedIdentityId": "str", "privateEndpointConnections": [ @@ -133,49 +98,48 @@ async def test_managed_instances_begin_create_or_update(self, resource_group): "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "sourceManagedInstanceId": "str", "state": "str", "storageIOps": 0, "storageSizeInGB": 0, "storageThroughputMBps": 0, "subnetId": "str", - "tags": {"str": "str"}, "timezoneId": "str", - "type": "str", "vCores": 0, "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_delete(self, resource_group): - response = await ( - await self.client.managed_instances.begin_delete( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_update(self, resource_group): - response = await ( - await self.client.managed_instances.begin_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={ + @recorded_by_proxy + def test_managed_instances_begin_update(self, resource_group): + response = self.client.managed_instances.begin_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", "administrators": { @@ -197,12 +161,6 @@ async def test_managed_instances_begin_update(self, resource_group): "fullyQualifiedDomainName": "str", "hybridSecondaryUsage": "str", "hybridSecondaryUsageDetected": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "instancePoolId": "str", "isGeneralPurposeV2": bool, "keyId": "str", @@ -234,131 +192,150 @@ async def test_managed_instances_begin_update(self, resource_group): "requestedLogicalAvailabilityZone": "str", "restorePointInTime": "2020-02-20 00:00:00", "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, "sourceManagedInstanceId": "str", "state": "str", "storageIOps": 0, "storageSizeInGB": 0, "storageThroughputMBps": 0, "subnetId": "str", - "tags": {"str": "str"}, "timezoneId": "str", "vCores": 0, "virtualClusterId": "str", "zoneRedundant": bool, }, - api_version="2025-01-01", - ) + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_failover(self, resource_group): - response = await ( - await self.client.managed_instances.begin_failover( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_delete(self, resource_group): + response = self.client.managed_instances.begin_delete( + resource_group_name=resource_group.name, + managed_instance_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_list_by_resource_group(self, resource_group): + response = self.client.managed_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_list(self, resource_group): + response = self.client.managed_instances.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_begin_failover(self, resource_group): + response = self.client.managed_instances.begin_failover( + resource_group_name=resource_group.name, + managed_instance_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_list_outbound_network_dependencies_by_managed_instance(self, resource_group): + @recorded_by_proxy + def test_managed_instances_list_outbound_network_dependencies_by_managed_instance(self, resource_group): response = self.client.managed_instances.list_outbound_network_dependencies_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) - result = [r async for r in response] + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): - response = await ( - await self.client.managed_instances.begin_reevaluate_inaccessible_database_state( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = self.client.managed_instances.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_refresh_status(self, resource_group): - response = await ( - await self.client.managed_instances.begin_refresh_status( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_refresh_status(self, resource_group): + response = self.client.managed_instances.begin_refresh_status( + resource_group_name=resource_group.name, + managed_instance_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_start(self, resource_group): - response = await ( - await self.client.managed_instances.begin_start( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_start(self, resource_group): + response = self.client.managed_instances.begin_start( + resource_group_name=resource_group.name, + managed_instance_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_stop(self, resource_group): - response = await ( - await self.client.managed_instances.begin_stop( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_stop(self, resource_group): + response = self.client.managed_instances.begin_stop( + resource_group_name=resource_group.name, + managed_instance_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_list_by_managed_instance(self, resource_group): + @recorded_by_proxy + def test_managed_instances_list_by_managed_instance(self, resource_group): response = self.client.managed_instances.list_by_managed_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) - result = [r async for r in response] + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): - response = await ( - await self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={"tdeKeyUri": "str"}, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): + response = self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={"tdeKeyUri": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_instances_list_by_instance_pool(self, resource_group): + response = self.client.managed_instances.list_by_instance_pool( + resource_group_name=resource_group.name, + instance_pool_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations_async.py new file mode 100644 index 000000000000..e8b490480a35 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_instances_operations_async.py @@ -0,0 +1,360 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlManagedInstancesOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_get(self, resource_group): + response = await self.client.managed_instances.get( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_create_or_update(self, resource_group): + response = await ( + await self.client.managed_instances.begin_create_or_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "administratorLogin": "str", + "administratorLoginPassword": "str", + "administrators": { + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "login": "str", + "principalType": "str", + "sid": "str", + "tenantId": "str", + }, + "authenticationMetadata": "str", + "collation": "str", + "createTime": "2020-02-20 00:00:00", + "currentBackupStorageRedundancy": "str", + "databaseFormat": "str", + "dnsZone": "str", + "dnsZonePartner": "str", + "externalGovernanceStatus": "str", + "fullyQualifiedDomainName": "str", + "hybridSecondaryUsage": "str", + "hybridSecondaryUsageDetected": "str", + "instancePoolId": "str", + "isGeneralPurposeV2": bool, + "keyId": "str", + "licenseType": "str", + "maintenanceConfigurationId": "str", + "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, + "minimalTlsVersion": "str", + "pricingModel": "str", + "primaryUserAssignedIdentityId": "str", + "privateEndpointConnections": [ + { + "id": "str", + "properties": { + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + } + ], + "provisioningState": "str", + "proxyOverride": "str", + "publicDataEndpointEnabled": bool, + "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, + "sourceManagedInstanceId": "str", + "state": "str", + "storageIOps": 0, + "storageSizeInGB": 0, + "storageThroughputMBps": 0, + "subnetId": "str", + "timezoneId": "str", + "vCores": 0, + "virtualClusterId": "str", + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_update(self, resource_group): + response = await ( + await self.client.managed_instances.begin_update( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "administratorLogin": "str", + "administratorLoginPassword": "str", + "administrators": { + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "login": "str", + "principalType": "str", + "sid": "str", + "tenantId": "str", + }, + "authenticationMetadata": "str", + "collation": "str", + "createTime": "2020-02-20 00:00:00", + "currentBackupStorageRedundancy": "str", + "databaseFormat": "str", + "dnsZone": "str", + "dnsZonePartner": "str", + "externalGovernanceStatus": "str", + "fullyQualifiedDomainName": "str", + "hybridSecondaryUsage": "str", + "hybridSecondaryUsageDetected": "str", + "instancePoolId": "str", + "isGeneralPurposeV2": bool, + "keyId": "str", + "licenseType": "str", + "maintenanceConfigurationId": "str", + "managedInstanceCreateMode": "str", + "memorySizeInGB": 0, + "minimalTlsVersion": "str", + "pricingModel": "str", + "primaryUserAssignedIdentityId": "str", + "privateEndpointConnections": [ + { + "id": "str", + "properties": { + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + } + ], + "provisioningState": "str", + "proxyOverride": "str", + "publicDataEndpointEnabled": bool, + "requestedBackupStorageRedundancy": "str", + "requestedLogicalAvailabilityZone": "str", + "restorePointInTime": "2020-02-20 00:00:00", + "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, + "sourceManagedInstanceId": "str", + "state": "str", + "storageIOps": 0, + "storageSizeInGB": 0, + "storageThroughputMBps": 0, + "subnetId": "str", + "timezoneId": "str", + "vCores": 0, + "virtualClusterId": "str", + "zoneRedundant": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_delete(self, resource_group): + response = await ( + await self.client.managed_instances.begin_delete( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_list_by_resource_group(self, resource_group): + response = self.client.managed_instances.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_list(self, resource_group): + response = self.client.managed_instances.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_failover(self, resource_group): + response = await ( + await self.client.managed_instances.begin_failover( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_list_outbound_network_dependencies_by_managed_instance(self, resource_group): + response = self.client.managed_instances.list_outbound_network_dependencies_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): + response = await ( + await self.client.managed_instances.begin_reevaluate_inaccessible_database_state( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_refresh_status(self, resource_group): + response = await ( + await self.client.managed_instances.begin_refresh_status( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_start(self, resource_group): + response = await ( + await self.client.managed_instances.begin_start( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_stop(self, resource_group): + response = await ( + await self.client.managed_instances.begin_stop( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_list_by_managed_instance(self, resource_group): + response = self.client.managed_instances.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): + response = await ( + await self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( + resource_group_name=resource_group.name, + managed_instance_name="str", + parameters={"tdeKeyUri": "str"}, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_instances_list_by_instance_pool(self, resource_group): + response = self.client.managed_instances.list_by_instance_pool( + resource_group_name=resource_group.name, + instance_pool_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations.py index 09f303236bc3..dd1352a01a15 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,49 +14,59 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedLedgerDigestUploadsOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedLedgerDigestUploadsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.managed_ledger_digest_uploads.list_by_database( + def test_managed_ledger_digest_uploads_get(self, resource_group): + response = self.client.managed_ledger_digest_uploads.get( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - api_version="2025-01-01", + ledger_digest_uploads="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_ledger_digest_uploads_get(self, resource_group): - response = self.client.managed_ledger_digest_uploads.get( + def test_managed_ledger_digest_uploads_begin_create_or_update(self, resource_group): + response = self.client.managed_ledger_digest_uploads.begin_create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", - ) + parameters={ + "id": "str", + "name": "str", + "properties": {"digestStorageEndpoint": "str", "state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_managed_ledger_digest_uploads_begin_create_or_update(self, resource_group): - response = self.client.managed_ledger_digest_uploads.begin_create_or_update( + def test_managed_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.managed_ledger_digest_uploads.list_by_database( resource_group_name=resource_group.name, managed_instance_name="str", database_name="str", - ledger_digest_uploads="str", - parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -68,7 +78,6 @@ def test_managed_ledger_digest_uploads_begin_disable(self, resource_group): managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations_async.py index 0e8f3b214a8f..5a86f5c5b9ea 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_ledger_digest_uploads_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_ledger_digest_uploads_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedLedgerDigestUploadsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedLedgerDigestUploadsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_ledger_digest_uploads_list_by_database(self, resource_group): - response = self.client.managed_ledger_digest_uploads.list_by_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_managed_ledger_digest_uploads_get(self, resource_group): managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,14 +41,38 @@ async def test_managed_ledger_digest_uploads_begin_create_or_update(self, resour managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - parameters={"digestStorageEndpoint": "str", "id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"digestStorageEndpoint": "str", "state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_ledger_digest_uploads_list_by_database(self, resource_group): + response = self.client.managed_ledger_digest_uploads.list_by_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_ledger_digest_uploads_begin_disable(self, resource_group): @@ -72,7 +82,6 @@ async def test_managed_ledger_digest_uploads_begin_disable(self, resource_group) managed_instance_name="str", database_name="str", ledger_digest_uploads="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py similarity index 70% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 58c0765388bc..99ca73ff1b01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -3,11 +3,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -15,26 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( - AzureMgmtRecordedTestCase -): +class TestSqlManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( - self, resource_group - ): - response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -44,7 +27,6 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,8 +43,20 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() ) # call '.result()' to poll until service return final result @@ -79,9 +73,35 @@ def test_managed_restorable_dropped_database_backup_short_term_retention_policie managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( + self, resource_group + ): + response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + restorable_dropped_database_id="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py similarity index 70% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py index 6a9e94a15828..01eda417a927 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_restorable_dropped_database_backup_short_term_retention_policies_operations_async.py @@ -3,11 +3,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -16,26 +16,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperationsAsync( - AzureMgmtRecordedTestCase -): +class TestSqlManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( - self, resource_group - ): - response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( - resource_group_name=resource_group.name, - managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -45,7 +28,6 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -62,8 +44,20 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -81,10 +75,36 @@ async def test_managed_restorable_dropped_database_backup_short_term_retention_p managed_instance_name="str", restorable_dropped_database_id="str", policy_name="str", - parameters={"id": "str", "name": "str", "retentionDays": 0, "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"retentionDays": 0}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_restorable_dropped_database_backup_short_term_retention_policies_list_by_restorable_dropped_database( + self, resource_group + ): + response = self.client.managed_restorable_dropped_database_backup_short_term_retention_policies.list_by_restorable_dropped_database( + resource_group_name=resource_group.name, + managed_instance_name="str", + restorable_dropped_database_id="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations.py index 1d4795bd4037..9e0701db5a81 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedServerDnsAliasesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedServerDnsAliasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_server_dns_aliases_list_by_managed_instance(self, resource_group): - response = self.client.managed_server_dns_aliases.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,8 +37,7 @@ def test_managed_server_dns_aliases_begin_create_or_update(self, resource_group) resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - parameters={"createDnsRecord": True}, - api_version="2025-01-01", + parameters={"createDnsRecord": bool}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,12 +50,22 @@ def test_managed_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_server_dns_aliases_list_by_managed_instance(self, resource_group): + response = self.client.managed_server_dns_aliases.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_managed_server_dns_aliases_begin_acquire(self, resource_group): @@ -78,7 +74,6 @@ def test_managed_server_dns_aliases_begin_acquire(self, resource_group): managed_instance_name="str", dns_alias_name="str", parameters={"oldManagedServerDnsAliasResourceId": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations_async.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations_async.py index abb3d6208d0b..cf421e0f2dac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_dns_aliases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_dns_aliases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedServerDnsAliasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedServerDnsAliasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_server_dns_aliases_list_by_managed_instance(self, resource_group): - response = self.client.managed_server_dns_aliases.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,8 +39,7 @@ async def test_managed_server_dns_aliases_begin_create_or_update(self, resource_ resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - parameters={"createDnsRecord": True}, - api_version="2025-01-01", + parameters={"createDnsRecord": bool}, ) ).result() # call '.result()' to poll until service return final result @@ -68,13 +54,23 @@ async def test_managed_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", dns_alias_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_server_dns_aliases_list_by_managed_instance(self, resource_group): + response = self.client.managed_server_dns_aliases.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_managed_server_dns_aliases_begin_acquire(self, resource_group): @@ -84,7 +80,6 @@ async def test_managed_server_dns_aliases_begin_acquire(self, resource_group): managed_instance_name="str", dns_alias_name="str", parameters={"oldManagedServerDnsAliasResourceId": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations.py index e3ac72789b23..f23f8b013189 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedServerSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlManagedServerSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): - response = self.client.managed_server_security_alert_policies.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_managed_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,16 +38,18 @@ def test_managed_server_security_alert_policies_begin_create_or_update(self, res managed_instance_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,8 +60,18 @@ def test_managed_server_security_alert_policies_begin_create_or_update(self, res }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): + response = self.client.managed_server_security_alert_policies.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations_async.py index 764a95d7020c..f2fc13e773b6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_server_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_managed_server_security_alert_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedServerSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlManagedServerSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): - response = self.client.managed_server_security_alert_policies.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_managed_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,16 +40,18 @@ async def test_managed_server_security_alert_policies_begin_create_or_update(sel managed_instance_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -73,9 +62,19 @@ async def test_managed_server_security_alert_policies_begin_create_or_update(sel }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_managed_server_security_alert_policies_list_by_instance(self, resource_group): + response = self.client.managed_server_security_alert_policies.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py deleted file mode 100644 index 60100bb3d52c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations.py +++ /dev/null @@ -1,132 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAdvisorsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_advisors_list_by_database(self, resource_group): - response = self.client.database_advisors.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_advisors_get(self, resource_group): - response = self.client.database_advisors.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_advisors_update(self, resource_group): - response = self.client.database_advisors.update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - parameters={ - "advisorStatus": "str", - "autoExecuteStatus": "str", - "autoExecuteStatusInheritedFrom": "str", - "id": "str", - "kind": "str", - "lastChecked": "2020-02-20 00:00:00", - "location": "str", - "name": "str", - "recommendationsStatus": "str", - "recommendedActions": [ - { - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": { - "currentValue": "str", - "actionInitiatedBy": "str", - "lastModified": "2020-02-20 00:00:00", - }, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - } - ], - "type": "str", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py deleted file mode 100644 index db9aa80388d5..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_advisors_operations_async.py +++ /dev/null @@ -1,133 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseAdvisorsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_advisors_list_by_database(self, resource_group): - response = await self.client.database_advisors.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_advisors_get(self, resource_group): - response = await self.client.database_advisors.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_advisors_update(self, resource_group): - response = await self.client.database_advisors.update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - parameters={ - "advisorStatus": "str", - "autoExecuteStatus": "str", - "autoExecuteStatusInheritedFrom": "str", - "id": "str", - "kind": "str", - "lastChecked": "2020-02-20 00:00:00", - "location": "str", - "name": "str", - "recommendationsStatus": "str", - "recommendedActions": [ - { - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": { - "currentValue": "str", - "actionInitiatedBy": "str", - "lastModified": "2020-02-20 00:00:00", - }, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - } - ], - "type": "str", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py deleted file mode 100644 index 294d114e3354..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations.py +++ /dev/null @@ -1,117 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseRecommendedActionsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_recommended_actions_list_by_database_advisor(self, resource_group): - response = self.client.database_recommended_actions.list_by_database_advisor( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_recommended_actions_get(self, resource_group): - response = self.client.database_recommended_actions.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - recommended_action_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_database_recommended_actions_update(self, resource_group): - response = self.client.database_recommended_actions.update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - recommended_action_name="str", - parameters={ - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": {"currentValue": "str", "actionInitiatedBy": "str", "lastModified": "2020-02-20 00:00:00"}, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py deleted file mode 100644 index 4857d94fd480..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_database_recommended_actions_operations_async.py +++ /dev/null @@ -1,118 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabaseRecommendedActionsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_recommended_actions_list_by_database_advisor(self, resource_group): - response = await self.client.database_recommended_actions.list_by_database_advisor( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_recommended_actions_get(self, resource_group): - response = await self.client.database_recommended_actions.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - recommended_action_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_database_recommended_actions_update(self, resource_group): - response = await self.client.database_recommended_actions.update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - advisor_name="str", - recommended_action_name="str", - parameters={ - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": {"currentValue": "str", "actionInitiatedBy": "str", "lastModified": "2020-02-20 00:00:00"}, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py deleted file mode 100644 index 3c5f860c8fa6..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_databases_operations.py +++ /dev/null @@ -1,352 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDatabasesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_list_by_server(self, resource_group): - response = self.client.databases.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_get(self, resource_group): - response = self.client.databases.get( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_create_or_update(self, resource_group): - response = self.client.databases.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "location": "str", - "autoPauseDelay": 0, - "availabilityZone": "str", - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "currentBackupStorageRedundancy": "str", - "currentServiceObjectiveName": "str", - "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "databaseId": "str", - "defaultSecondaryLocation": "str", - "earliestRestoreDate": "2020-02-20 00:00:00", - "elasticPoolId": "str", - "encryptionProtector": "str", - "encryptionProtectorAutoRotation": bool, - "failoverGroupId": "str", - "federatedClientId": "str", - "freeLimitExhaustionBehavior": "str", - "highAvailabilityReplicaCount": 0, - "id": "str", - "identity": { - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "isInfraEncryptionEnabled": bool, - "isLedgerOn": bool, - "keys": { - "str": { - "creationDate": "2020-02-20 00:00:00", - "keyVersion": "str", - "subregion": "str", - "thumbprint": "str", - "type": "str", - } - }, - "kind": "str", - "licenseType": "str", - "longTermRetentionBackupResourceId": "str", - "maintenanceConfigurationId": "str", - "managedBy": "str", - "manualCutover": bool, - "maxLogSizeBytes": 0, - "maxSizeBytes": 0, - "minCapacity": 0.0, - "name": "str", - "pausedDate": "2020-02-20 00:00:00", - "performCutover": bool, - "preferredEnclaveType": "str", - "readScale": "str", - "recoverableDatabaseId": "str", - "recoveryServicesRecoveryPointId": "str", - "requestedBackupStorageRedundancy": "str", - "requestedServiceObjectiveName": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "resumedDate": "2020-02-20 00:00:00", - "sampleName": "str", - "secondaryType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "sourceResourceId": "str", - "status": "str", - "tags": {"str": "str"}, - "type": "str", - "useFreeLimit": bool, - "zoneRedundant": bool, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_delete(self, resource_group): - response = self.client.databases.begin_delete( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_update(self, resource_group): - response = self.client.databases.begin_update( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "autoPauseDelay": 0, - "catalogCollation": "str", - "collation": "str", - "createMode": "str", - "creationDate": "2020-02-20 00:00:00", - "currentBackupStorageRedundancy": "str", - "currentServiceObjectiveName": "str", - "currentSku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "databaseId": "str", - "defaultSecondaryLocation": "str", - "earliestRestoreDate": "2020-02-20 00:00:00", - "elasticPoolId": "str", - "encryptionProtector": "str", - "encryptionProtectorAutoRotation": bool, - "failoverGroupId": "str", - "federatedClientId": "str", - "freeLimitExhaustionBehavior": "str", - "highAvailabilityReplicaCount": 0, - "identity": { - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "isInfraEncryptionEnabled": bool, - "isLedgerOn": bool, - "keys": { - "str": { - "creationDate": "2020-02-20 00:00:00", - "keyVersion": "str", - "subregion": "str", - "thumbprint": "str", - "type": "str", - } - }, - "licenseType": "str", - "longTermRetentionBackupResourceId": "str", - "maintenanceConfigurationId": "str", - "manualCutover": bool, - "maxLogSizeBytes": 0, - "maxSizeBytes": 0, - "minCapacity": 0.0, - "pausedDate": "2020-02-20 00:00:00", - "performCutover": bool, - "preferredEnclaveType": "str", - "readScale": "str", - "recoverableDatabaseId": "str", - "recoveryServicesRecoveryPointId": "str", - "requestedBackupStorageRedundancy": "str", - "requestedServiceObjectiveName": "str", - "restorableDroppedDatabaseId": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "resumedDate": "2020-02-20 00:00:00", - "sampleName": "str", - "secondaryType": "str", - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "sourceDatabaseDeletionDate": "2020-02-20 00:00:00", - "sourceDatabaseId": "str", - "status": "str", - "tags": {"str": "str"}, - "useFreeLimit": bool, - "zoneRedundant": bool, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_export(self, resource_group): - response = self.client.databases.begin_export( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_failover(self, resource_group): - response = self.client.databases.begin_failover( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_import_method(self, resource_group): - response = self.client.databases.begin_import_method( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_rename(self, resource_group): - response = self.client.databases.rename( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={"id": "str"}, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_pause(self, resource_group): - response = self.client.databases.begin_pause( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_resume(self, resource_group): - response = self.client.databases.begin_resume( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_begin_upgrade_data_warehouse(self, resource_group): - response = self.client.databases.begin_upgrade_data_warehouse( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_list_by_elastic_pool(self, resource_group): - response = self.client.databases.list_by_elastic_pool( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_databases_list_inaccessible_by_server(self, resource_group): - response = self.client.databases.list_inaccessible_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py deleted file mode 100644 index 15e58f1cf72c..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_distributed_availability_groups_operations.py +++ /dev/null @@ -1,191 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementDistributedAvailabilityGroupsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_list_by_instance(self, resource_group): - response = self.client.distributed_availability_groups.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_get(self, resource_group): - response = self.client.distributed_availability_groups.get( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_begin_create_or_update(self, resource_group): - response = self.client.distributed_availability_groups.begin_create_or_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={ - "databases": [ - { - "connectedState": "str", - "databaseName": "str", - "instanceRedoReplicationLagSeconds": 0, - "instanceReplicaId": "str", - "instanceSendReplicationLagSeconds": 0, - "lastBackupLsn": "str", - "lastBackupTime": "2020-02-20 00:00:00", - "lastCommitLsn": "str", - "lastCommitTime": "2020-02-20 00:00:00", - "lastHardenedLsn": "str", - "lastHardenedTime": "2020-02-20 00:00:00", - "lastReceivedLsn": "str", - "lastReceivedTime": "2020-02-20 00:00:00", - "lastSentLsn": "str", - "lastSentTime": "2020-02-20 00:00:00", - "mostRecentLinkError": "str", - "partnerAuthCertValidity": {"certificateName": "str", "expiryDate": "2020-02-20 00:00:00"}, - "partnerReplicaId": "str", - "replicaState": "str", - "seedingProgress": "str", - "synchronizationHealth": "str", - } - ], - "distributedAvailabilityGroupId": "str", - "distributedAvailabilityGroupName": "str", - "failoverMode": "str", - "id": "str", - "instanceAvailabilityGroupName": "str", - "instanceLinkRole": "str", - "name": "str", - "partnerAvailabilityGroupName": "str", - "partnerEndpoint": "str", - "partnerLinkRole": "str", - "replicationMode": "str", - "seedingMode": "str", - "type": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_begin_delete(self, resource_group): - response = self.client.distributed_availability_groups.begin_delete( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_begin_update(self, resource_group): - response = self.client.distributed_availability_groups.begin_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={ - "databases": [ - { - "connectedState": "str", - "databaseName": "str", - "instanceRedoReplicationLagSeconds": 0, - "instanceReplicaId": "str", - "instanceSendReplicationLagSeconds": 0, - "lastBackupLsn": "str", - "lastBackupTime": "2020-02-20 00:00:00", - "lastCommitLsn": "str", - "lastCommitTime": "2020-02-20 00:00:00", - "lastHardenedLsn": "str", - "lastHardenedTime": "2020-02-20 00:00:00", - "lastReceivedLsn": "str", - "lastReceivedTime": "2020-02-20 00:00:00", - "lastSentLsn": "str", - "lastSentTime": "2020-02-20 00:00:00", - "mostRecentLinkError": "str", - "partnerAuthCertValidity": {"certificateName": "str", "expiryDate": "2020-02-20 00:00:00"}, - "partnerReplicaId": "str", - "replicaState": "str", - "seedingProgress": "str", - "synchronizationHealth": "str", - } - ], - "distributedAvailabilityGroupId": "str", - "distributedAvailabilityGroupName": "str", - "failoverMode": "str", - "id": "str", - "instanceAvailabilityGroupName": "str", - "instanceLinkRole": "str", - "name": "str", - "partnerAvailabilityGroupName": "str", - "partnerEndpoint": "str", - "partnerLinkRole": "str", - "replicationMode": "str", - "seedingMode": "str", - "type": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_begin_failover(self, resource_group): - response = self.client.distributed_availability_groups.begin_failover( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={"failoverType": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_distributed_availability_groups_begin_set_role(self, resource_group): - response = self.client.distributed_availability_groups.begin_set_role( - resource_group_name=resource_group.name, - managed_instance_name="str", - distributed_availability_group_name="str", - parameters={"instanceRole": "str", "roleChangeType": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations.py deleted file mode 100644 index e6b1c483a9ef..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations.py +++ /dev/null @@ -1,32 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolActivitiesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_pool_activities_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_activities.list_by_elastic_pool( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations_async.py deleted file mode 100644 index 8988ca16ad72..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_activities_operations_async.py +++ /dev/null @@ -1,33 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolActivitiesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_pool_activities_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_activities.list_by_elastic_pool( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations.py deleted file mode 100644 index 53f70bfa1873..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations.py +++ /dev/null @@ -1,32 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolDatabaseActivitiesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_elastic_pool_database_activities_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_database_activities.list_by_elastic_pool( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations_async.py deleted file mode 100644 index 8a0ab117d50d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_elastic_pool_database_activities_operations_async.py +++ /dev/null @@ -1,33 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementElasticPoolDatabaseActivitiesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_elastic_pool_database_activities_list_by_elastic_pool(self, resource_group): - response = self.client.elastic_pool_database_activities.list_by_elastic_pool( - resource_group_name=resource_group.name, - server_name="str", - elastic_pool_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py deleted file mode 100644 index 51ab6fc9dc44..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_managed_instances_operations.py +++ /dev/null @@ -1,345 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementManagedInstancesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_list(self, resource_group): - response = self.client.managed_instances.list( - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_list_by_instance_pool(self, resource_group): - response = self.client.managed_instances.list_by_instance_pool( - resource_group_name=resource_group.name, - instance_pool_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_list_by_resource_group(self, resource_group): - response = self.client.managed_instances.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_get(self, resource_group): - response = self.client.managed_instances.get( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_create_or_update(self, resource_group): - response = self.client.managed_instances.begin_create_or_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={ - "location": "str", - "administratorLogin": "str", - "administratorLoginPassword": "str", - "administrators": { - "administratorType": "str", - "azureADOnlyAuthentication": bool, - "login": "str", - "principalType": "str", - "sid": "str", - "tenantId": "str", - }, - "authenticationMetadata": "str", - "collation": "str", - "createTime": "2020-02-20 00:00:00", - "currentBackupStorageRedundancy": "str", - "databaseFormat": "str", - "dnsZone": "str", - "dnsZonePartner": "str", - "externalGovernanceStatus": "str", - "fullyQualifiedDomainName": "str", - "hybridSecondaryUsage": "str", - "hybridSecondaryUsageDetected": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "instancePoolId": "str", - "isGeneralPurposeV2": bool, - "keyId": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "managedInstanceCreateMode": "str", - "memorySizeInGB": 0, - "minimalTlsVersion": "str", - "name": "str", - "pricingModel": "str", - "primaryUserAssignedIdentityId": "str", - "privateEndpointConnections": [ - { - "id": "str", - "properties": { - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", - }, - "provisioningState": "str", - }, - } - ], - "provisioningState": "str", - "proxyOverride": "str", - "publicDataEndpointEnabled": bool, - "requestedBackupStorageRedundancy": "str", - "requestedLogicalAvailabilityZone": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "sourceManagedInstanceId": "str", - "state": "str", - "storageIOps": 0, - "storageSizeInGB": 0, - "storageThroughputMBps": 0, - "subnetId": "str", - "tags": {"str": "str"}, - "timezoneId": "str", - "type": "str", - "vCores": 0, - "virtualClusterId": "str", - "zoneRedundant": bool, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_delete(self, resource_group): - response = self.client.managed_instances.begin_delete( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_update(self, resource_group): - response = self.client.managed_instances.begin_update( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={ - "administratorLogin": "str", - "administratorLoginPassword": "str", - "administrators": { - "administratorType": "str", - "azureADOnlyAuthentication": bool, - "login": "str", - "principalType": "str", - "sid": "str", - "tenantId": "str", - }, - "authenticationMetadata": "str", - "collation": "str", - "createTime": "2020-02-20 00:00:00", - "currentBackupStorageRedundancy": "str", - "databaseFormat": "str", - "dnsZone": "str", - "dnsZonePartner": "str", - "externalGovernanceStatus": "str", - "fullyQualifiedDomainName": "str", - "hybridSecondaryUsage": "str", - "hybridSecondaryUsageDetected": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "instancePoolId": "str", - "isGeneralPurposeV2": bool, - "keyId": "str", - "licenseType": "str", - "maintenanceConfigurationId": "str", - "managedInstanceCreateMode": "str", - "memorySizeInGB": 0, - "minimalTlsVersion": "str", - "pricingModel": "str", - "primaryUserAssignedIdentityId": "str", - "privateEndpointConnections": [ - { - "id": "str", - "properties": { - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", - }, - "provisioningState": "str", - }, - } - ], - "provisioningState": "str", - "proxyOverride": "str", - "publicDataEndpointEnabled": bool, - "requestedBackupStorageRedundancy": "str", - "requestedLogicalAvailabilityZone": "str", - "restorePointInTime": "2020-02-20 00:00:00", - "servicePrincipal": {"clientId": "str", "principalId": "str", "tenantId": "str", "type": "str"}, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "sourceManagedInstanceId": "str", - "state": "str", - "storageIOps": 0, - "storageSizeInGB": 0, - "storageThroughputMBps": 0, - "subnetId": "str", - "tags": {"str": "str"}, - "timezoneId": "str", - "vCores": 0, - "virtualClusterId": "str", - "zoneRedundant": bool, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_failover(self, resource_group): - response = self.client.managed_instances.begin_failover( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_list_outbound_network_dependencies_by_managed_instance(self, resource_group): - response = self.client.managed_instances.list_outbound_network_dependencies_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_reevaluate_inaccessible_database_state(self, resource_group): - response = self.client.managed_instances.begin_reevaluate_inaccessible_database_state( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_refresh_status(self, resource_group): - response = self.client.managed_instances.begin_refresh_status( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_start(self, resource_group): - response = self.client.managed_instances.begin_start( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_stop(self, resource_group): - response = self.client.managed_instances.begin_stop( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_list_by_managed_instance(self, resource_group): - response = self.client.managed_instances.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_managed_instances_begin_validate_azure_key_vault_encryption_key(self, resource_group): - response = self.client.managed_instances.begin_validate_azure_key_vault_encryption_key( - resource_group_name=resource_group.name, - managed_instance_name="str", - parameters={"tdeKeyUri": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py deleted file mode 100644 index 7bbb0d57b06f..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations.py +++ /dev/null @@ -1,129 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAdvisorsOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_advisors_list_by_server(self, resource_group): - response = self.client.server_advisors.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_advisors_get(self, resource_group): - response = self.client.server_advisors.get( - resource_group_name=resource_group.name, - server_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_advisors_update(self, resource_group): - response = self.client.server_advisors.update( - resource_group_name=resource_group.name, - server_name="str", - advisor_name="str", - parameters={ - "advisorStatus": "str", - "autoExecuteStatus": "str", - "autoExecuteStatusInheritedFrom": "str", - "id": "str", - "kind": "str", - "lastChecked": "2020-02-20 00:00:00", - "location": "str", - "name": "str", - "recommendationsStatus": "str", - "recommendedActions": [ - { - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": { - "currentValue": "str", - "actionInitiatedBy": "str", - "lastModified": "2020-02-20 00:00:00", - }, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - } - ], - "type": "str", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py deleted file mode 100644 index cbfed1432d14..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advisors_operations_async.py +++ /dev/null @@ -1,130 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAdvisorsOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_advisors_list_by_server(self, resource_group): - response = await self.client.server_advisors.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_advisors_get(self, resource_group): - response = await self.client.server_advisors.get( - resource_group_name=resource_group.name, - server_name="str", - advisor_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_advisors_update(self, resource_group): - response = await self.client.server_advisors.update( - resource_group_name=resource_group.name, - server_name="str", - advisor_name="str", - parameters={ - "advisorStatus": "str", - "autoExecuteStatus": "str", - "autoExecuteStatusInheritedFrom": "str", - "id": "str", - "kind": "str", - "lastChecked": "2020-02-20 00:00:00", - "location": "str", - "name": "str", - "recommendationsStatus": "str", - "recommendedActions": [ - { - "details": {"str": "str"}, - "errorDetails": {"errorCode": "str", "isRetryable": "str"}, - "estimatedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "executeActionDuration": "1 day, 0:00:00", - "executeActionInitiatedBy": "str", - "executeActionInitiatedTime": "2020-02-20 00:00:00", - "executeActionStartTime": "2020-02-20 00:00:00", - "id": "str", - "implementationDetails": {"method": "str", "script": "str"}, - "isArchivedAction": bool, - "isExecutableAction": bool, - "isRevertableAction": bool, - "kind": "str", - "lastRefresh": "2020-02-20 00:00:00", - "linkedObjects": ["str"], - "location": "str", - "name": "str", - "observedImpact": [ - { - "absoluteValue": 0.0, - "changeValueAbsolute": 0.0, - "changeValueRelative": 0.0, - "dimensionName": "str", - "unit": "str", - } - ], - "recommendationReason": "str", - "revertActionDuration": "1 day, 0:00:00", - "revertActionInitiatedBy": "str", - "revertActionInitiatedTime": "2020-02-20 00:00:00", - "revertActionStartTime": "2020-02-20 00:00:00", - "score": 0, - "state": { - "currentValue": "str", - "actionInitiatedBy": "str", - "lastModified": "2020-02-20 00:00:00", - }, - "timeSeries": [ - { - "metricName": "str", - "startTime": "2020-02-20 00:00:00", - "timeGrain": "str", - "unit": "str", - "value": 0.0, - } - ], - "type": "str", - "validSince": "2020-02-20 00:00:00", - } - ], - "type": "str", - }, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations.py deleted file mode 100644 index c08490fcf61d..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations.py +++ /dev/null @@ -1,79 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerCommunicationLinksOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_communication_links_delete(self, resource_group): - response = self.client.server_communication_links.delete( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_communication_links_get(self, resource_group): - response = self.client.server_communication_links.get( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_communication_links_begin_create_or_update(self, resource_group): - response = self.client.server_communication_links.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - parameters={ - "id": "str", - "kind": "str", - "location": "str", - "name": "str", - "partnerServer": "str", - "state": "str", - "type": "str", - }, - api_version="2014-04-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_communication_links_list_by_server(self, resource_group): - response = self.client.server_communication_links.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations_async.py deleted file mode 100644 index 23cfa2569a43..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_communication_links_operations_async.py +++ /dev/null @@ -1,82 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerCommunicationLinksOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_communication_links_delete(self, resource_group): - response = await self.client.server_communication_links.delete( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_communication_links_get(self, resource_group): - response = await self.client.server_communication_links.get( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_communication_links_begin_create_or_update(self, resource_group): - response = await ( - await self.client.server_communication_links.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - communication_link_name="str", - parameters={ - "id": "str", - "kind": "str", - "location": "str", - "name": "str", - "partnerServer": "str", - "state": "str", - "type": "str", - }, - api_version="2014-04-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_communication_links_list_by_server(self, resource_group): - response = self.client.server_communication_links.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py deleted file mode 100644 index 884ebf7eb501..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations.py +++ /dev/null @@ -1,237 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServersOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_check_name_availability(self, resource_group): - response = self.client.servers.check_name_availability( - parameters={"name": "str", "type": "Microsoft.Sql/servers"}, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_list(self, resource_group): - response = self.client.servers.list( - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_list_by_resource_group(self, resource_group): - response = self.client.servers.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_get(self, resource_group): - response = self.client.servers.get( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_begin_create_or_update(self, resource_group): - response = self.client.servers.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - parameters={ - "location": "str", - "administratorLogin": "str", - "administratorLoginPassword": "str", - "administrators": { - "administratorType": "str", - "azureADOnlyAuthentication": bool, - "login": "str", - "principalType": "str", - "sid": "str", - "tenantId": "str", - }, - "createMode": "str", - "externalGovernanceStatus": "str", - "federatedClientId": "str", - "fullyQualifiedDomainName": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "isIPv6Enabled": "str", - "keyId": "str", - "kind": "str", - "minimalTlsVersion": "str", - "name": "str", - "primaryUserAssignedIdentityId": "str", - "privateEndpointConnections": [ - { - "id": "str", - "properties": { - "groupIds": ["str"], - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", - }, - "provisioningState": "str", - }, - } - ], - "publicNetworkAccess": "str", - "restrictOutboundNetworkAccess": "str", - "retentionDays": 0, - "state": "str", - "tags": {"str": "str"}, - "type": "str", - "version": "str", - "workspaceFeature": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_begin_delete(self, resource_group): - response = self.client.servers.begin_delete( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_begin_update(self, resource_group): - response = self.client.servers.begin_update( - resource_group_name=resource_group.name, - server_name="str", - parameters={ - "administratorLogin": "str", - "administratorLoginPassword": "str", - "administrators": { - "administratorType": "str", - "azureADOnlyAuthentication": bool, - "login": "str", - "principalType": "str", - "sid": "str", - "tenantId": "str", - }, - "createMode": "str", - "externalGovernanceStatus": "str", - "federatedClientId": "str", - "fullyQualifiedDomainName": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "isIPv6Enabled": "str", - "keyId": "str", - "minimalTlsVersion": "str", - "primaryUserAssignedIdentityId": "str", - "privateEndpointConnections": [ - { - "id": "str", - "properties": { - "groupIds": ["str"], - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", - }, - "provisioningState": "str", - }, - } - ], - "publicNetworkAccess": "str", - "restrictOutboundNetworkAccess": "str", - "retentionDays": 0, - "state": "str", - "tags": {"str": "str"}, - "version": "str", - "workspaceFeature": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_begin_import_database(self, resource_group): - response = self.client.servers.begin_import_database( - resource_group_name=resource_group.name, - server_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "databaseName": "str", - "edition": "str", - "maxSizeBytes": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - "serviceObjectiveName": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_servers_begin_refresh_status(self, resource_group): - response = self.client.servers.begin_refresh_status( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations.py deleted file mode 100644 index 828408498333..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations.py +++ /dev/null @@ -1,44 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServiceObjectivesOperations(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_service_objectives_get(self, resource_group): - response = self.client.service_objectives.get( - resource_group_name=resource_group.name, - server_name="str", - service_objective_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_service_objectives_list_by_server(self, resource_group): - response = self.client.service_objectives.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2014-04-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations_async.py deleted file mode 100644 index a27ba1a2b92a..000000000000 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_service_objectives_operations_async.py +++ /dev/null @@ -1,45 +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. -# -------------------------------------------------------------------------- -import pytest -from azure.mgmt.sql.aio import SqlManagementClient - -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async - -AZURE_LOCATION = "eastus" - - -@pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServiceObjectivesOperationsAsync(AzureMgmtRecordedTestCase): - def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_service_objectives_get(self, resource_group): - response = await self.client.service_objectives.get( - resource_group_name=resource_group.name, - server_name="str", - service_objective_name="str", - api_version="2014-04-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_service_objectives_list_by_server(self, resource_group): - response = self.client.service_objectives.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2014-04-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations.py index 24f541112ba3..536e36b07d64 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,32 +14,30 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementNetworkSecurityPerimeterConfigurationsOperations(AzureMgmtRecordedTestCase): +class TestSqlNetworkSecurityPerimeterConfigurationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_network_security_perimeter_configurations_list_by_server(self, resource_group): - response = self.client.network_security_perimeter_configurations.list_by_server( + def test_network_security_perimeter_configurations_get(self, resource_group): + response = self.client.network_security_perimeter_configurations.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + nsp_config_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_network_security_perimeter_configurations_get(self, resource_group): - response = self.client.network_security_perimeter_configurations.get( + def test_network_security_perimeter_configurations_list_by_server(self, resource_group): + response = self.client.network_security_perimeter_configurations.list_by_server( resource_group_name=resource_group.name, server_name="str", - nsp_config_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @@ -50,7 +48,6 @@ def test_network_security_perimeter_configurations_begin_reconcile(self, resourc resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations_async.py index e431a6a0cdb5..968916f7c631 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_network_security_perimeter_configurations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_network_security_perimeter_configurations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,32 +15,30 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementNetworkSecurityPerimeterConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlNetworkSecurityPerimeterConfigurationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_network_security_perimeter_configurations_list_by_server(self, resource_group): - response = self.client.network_security_perimeter_configurations.list_by_server( + async def test_network_security_perimeter_configurations_get(self, resource_group): + response = await self.client.network_security_perimeter_configurations.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + nsp_config_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_network_security_perimeter_configurations_get(self, resource_group): - response = await self.client.network_security_perimeter_configurations.get( + async def test_network_security_perimeter_configurations_list_by_server(self, resource_group): + response = self.client.network_security_perimeter_configurations.list_by_server( resource_group_name=resource_group.name, server_name="str", - nsp_config_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... @@ -52,7 +50,6 @@ async def test_network_security_perimeter_configurations_begin_reconcile(self, r resource_group_name=resource_group.name, server_name="str", nsp_config_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations.py index aa82af1bbd84..b2fb89c635d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,16 +14,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementOperations(AzureMgmtRecordedTestCase): +class TestSqlOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-01-01", - ) + response = self.client.operations.list() result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations_async.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations_async.py index 41888cde50f7..a740529ac0cc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,16 +15,14 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_operations_list(self, resource_group): - response = self.client.operations.list( - api_version="2025-01-01", - ) + response = self.client.operations.list() result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations.py index 57058a23b60c..27de687a3fa9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementOutboundFirewallRulesOperations(AzureMgmtRecordedTestCase): +class TestSqlOutboundFirewallRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_outbound_firewall_rules_list_by_server(self, resource_group): - response = self.client.outbound_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_outbound_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +37,6 @@ def test_outbound_firewall_rules_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -63,8 +49,18 @@ def test_outbound_firewall_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_outbound_firewall_rules_list_by_server(self, resource_group): + response = self.client.outbound_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations_async.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations_async.py index fed04638215c..5bce7b1d085e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_outbound_firewall_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_outbound_firewall_rules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementOutboundFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlOutboundFirewallRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_outbound_firewall_rules_list_by_server(self, resource_group): - response = self.client.outbound_firewall_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_outbound_firewall_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +39,6 @@ async def test_outbound_firewall_rules_begin_create_or_update(self, resource_gro resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -67,9 +53,19 @@ async def test_outbound_firewall_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", outbound_rule_fqdn="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_outbound_firewall_rules_list_by_server(self, resource_group): + response = self.client.outbound_firewall_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations.py index 4f8fccbf0e1c..5e495eaeb7b5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementPrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): +class TestSqlPrivateEndpointConnectionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_private_endpoint_connections_list_by_server(self, resource_group): - response = self.client.private_endpoint_connections.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,15 +38,28 @@ def test_private_endpoint_connections_begin_create_or_update(self, resource_grou server_name="str", private_endpoint_connection_name="str", parameters={ - "groupIds": ["str"], "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": {"description": "str", "status": "str", "actionsRequired": "str"}, - "provisioningState": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -72,8 +72,18 @@ def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_private_endpoint_connections_list_by_server(self, resource_group): + response = self.client.private_endpoint_connections.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations_async.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations_async.py index b2c357e4a8c0..e8430378593c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_endpoint_connections_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_endpoint_connections_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementPrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlPrivateEndpointConnectionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_private_endpoint_connections_list_by_server(self, resource_group): - response = self.client.private_endpoint_connections.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_private_endpoint_connections_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,19 +40,28 @@ async def test_private_endpoint_connections_begin_create_or_update(self, resourc server_name="str", private_endpoint_connection_name="str", parameters={ - "groupIds": ["str"], "id": "str", "name": "str", - "privateEndpoint": {"id": "str"}, - "privateLinkServiceConnectionState": { - "description": "str", - "status": "str", - "actionsRequired": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", }, - "provisioningState": "str", "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -80,9 +76,19 @@ async def test_private_endpoint_connections_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", private_endpoint_connection_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_private_endpoint_connections_list_by_server(self, resource_group): + response = self.client.private_endpoint_connections.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations.py index e05044e78c7d..61eeb2469fa9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementPrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): +class TestSqlPrivateLinkResourcesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_private_link_resources_list_by_server(self, resource_group): - response = self.client.private_link_resources.list_by_server( + def test_private_link_resources_get(self, resource_group): + response = self.client.private_link_resources.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + group_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_private_link_resources_get(self, resource_group): - response = self.client.private_link_resources.get( + def test_private_link_resources_list_by_server(self, resource_group): + response = self.client.private_link_resources.list_by_server( resource_group_name=resource_group.name, server_name="str", - group_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations_async.py index f8136e124ba2..b4fec8b58729 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_private_link_resources_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_private_link_resources_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementPrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlPrivateLinkResourcesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_private_link_resources_list_by_server(self, resource_group): - response = self.client.private_link_resources.list_by_server( + async def test_private_link_resources_get(self, resource_group): + response = await self.client.private_link_resources.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + group_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_private_link_resources_get(self, resource_group): - response = await self.client.private_link_resources.get( + async def test_private_link_resources_list_by_server(self, resource_group): + response = self.client.private_link_resources.list_by_server( resource_group_name=resource_group.name, server_name="str", - group_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations.py index 823b4a21e6ef..cdd5fb37c74d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecommendedSensitivityLabelsOperations(AzureMgmtRecordedTestCase): +class TestSqlRecommendedSensitivityLabelsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -28,17 +28,13 @@ def test_recommended_sensitivity_labels_update(self, resource_group): parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "table": "str", + "properties": {"column": "str", "op": "str", "schema": "str", "table": "str"}, "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations_async.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations_async.py index ebe390d2a348..293c1f0504a8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recommended_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recommended_sensitivity_labels_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecommendedSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRecommendedSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -29,17 +29,13 @@ async def test_recommended_sensitivity_labels_update(self, resource_group): parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "table": "str", + "properties": {"column": "str", "op": "str", "schema": "str", "table": "str"}, "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations.py index 9d7cfc53562e..8c43f00193e7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecoverableDatabasesOperations(AzureMgmtRecordedTestCase): +class TestSqlRecoverableDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_recoverable_databases_list_by_server(self, resource_group): - response = self.client.recoverable_databases.list_by_server( + def test_recoverable_databases_get(self, resource_group): + response = self.client.recoverable_databases.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + database_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_recoverable_databases_get(self, resource_group): - response = self.client.recoverable_databases.get( + def test_recoverable_databases_list_by_server(self, resource_group): + response = self.client.recoverable_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - database_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations_async.py index 91583ba25a44..be8147fe235d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_databases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecoverableDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRecoverableDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_recoverable_databases_list_by_server(self, resource_group): - response = self.client.recoverable_databases.list_by_server( + async def test_recoverable_databases_get(self, resource_group): + response = await self.client.recoverable_databases.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_recoverable_databases_get(self, resource_group): - response = await self.client.recoverable_databases.get( + async def test_recoverable_databases_list_by_server(self, resource_group): + response = self.client.recoverable_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - database_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations.py index 56fd824d97b1..d3e4e2a61cef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecoverableManagedDatabasesOperations(AzureMgmtRecordedTestCase): +class TestSqlRecoverableManagedDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_recoverable_managed_databases_list_by_instance(self, resource_group): - response = self.client.recoverable_managed_databases.list_by_instance( + def test_recoverable_managed_databases_get(self, resource_group): + response = self.client.recoverable_managed_databases.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + recoverable_database_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_recoverable_managed_databases_get(self, resource_group): - response = self.client.recoverable_managed_databases.get( + def test_recoverable_managed_databases_list_by_instance(self, resource_group): + response = self.client.recoverable_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - recoverable_database_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations_async.py index 5fa7744eca4f..c99a93b5d438 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_recoverable_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_recoverable_managed_databases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRecoverableManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRecoverableManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_recoverable_managed_databases_list_by_instance(self, resource_group): - response = self.client.recoverable_managed_databases.list_by_instance( + async def test_recoverable_managed_databases_get(self, resource_group): + response = await self.client.recoverable_managed_databases.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + recoverable_database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_recoverable_managed_databases_get(self, resource_group): - response = await self.client.recoverable_managed_databases.get( + async def test_recoverable_managed_databases_list_by_instance(self, resource_group): + response = self.client.recoverable_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - recoverable_database_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations.py index 4b480f956336..95d689be156a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementReplicationLinksOperations(AzureMgmtRecordedTestCase): +class TestSqlReplicationLinksOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_replication_links_list_by_database(self, resource_group): - response = self.client.replication_links.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_replication_links_get(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,22 +41,31 @@ def test_replication_links_begin_create_or_update(self, resource_group): link_id="str", parameters={ "id": "str", - "isTerminationAllowed": bool, - "linkType": "str", "name": "str", - "partnerDatabase": "str", - "partnerDatabaseId": "str", - "partnerLocation": "str", - "partnerRole": "str", - "partnerServer": "str", - "percentComplete": 0, - "replicationMode": "str", - "replicationState": "str", - "role": "str", - "startTime": "2020-02-20 00:00:00", + "properties": { + "isTerminationAllowed": bool, + "linkType": "str", + "partnerDatabase": "str", + "partnerDatabaseId": "str", + "partnerLocation": "str", + "partnerRole": "str", + "partnerServer": "str", + "percentComplete": 0, + "replicationMode": "str", + "replicationState": "str", + "role": "str", + "startTime": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,13 +73,13 @@ def test_replication_links_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_replication_links_begin_delete(self, resource_group): - response = self.client.replication_links.begin_delete( + def test_replication_links_begin_update(self, resource_group): + response = self.client.replication_links.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", + parameters={"id": "str", "name": "str", "properties": {"linkType": "str"}, "type": "str"}, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -92,19 +87,29 @@ def test_replication_links_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_replication_links_begin_update(self, resource_group): - response = self.client.replication_links.begin_update( + def test_replication_links_begin_delete(self, resource_group): + response = self.client.replication_links.begin_delete( resource_group_name=resource_group.name, server_name="str", database_name="str", link_id="str", - parameters={"id": "str", "linkType": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_replication_links_list_by_database(self, resource_group): + response = self.client.replication_links.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_replication_links_begin_failover(self, resource_group): @@ -113,7 +118,6 @@ def test_replication_links_begin_failover(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -127,7 +131,6 @@ def test_replication_links_begin_failover_allow_data_loss(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -139,7 +142,6 @@ def test_replication_links_list_by_server(self, resource_group): response = self.client.replication_links.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations_async.py index 63118ccbfb15..0e9bdaa41087 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_replication_links_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_replication_links_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementReplicationLinksOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlReplicationLinksOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_replication_links_list_by_database(self, resource_group): - response = self.client.replication_links.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_replication_links_get(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,22 +43,31 @@ async def test_replication_links_begin_create_or_update(self, resource_group): link_id="str", parameters={ "id": "str", - "isTerminationAllowed": bool, - "linkType": "str", "name": "str", - "partnerDatabase": "str", - "partnerDatabaseId": "str", - "partnerLocation": "str", - "partnerRole": "str", - "partnerServer": "str", - "percentComplete": 0, - "replicationMode": "str", - "replicationState": "str", - "role": "str", - "startTime": "2020-02-20 00:00:00", + "properties": { + "isTerminationAllowed": bool, + "linkType": "str", + "partnerDatabase": "str", + "partnerDatabaseId": "str", + "partnerLocation": "str", + "partnerRole": "str", + "partnerServer": "str", + "percentComplete": 0, + "replicationMode": "str", + "replicationState": "str", + "role": "str", + "startTime": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -81,14 +76,14 @@ async def test_replication_links_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_replication_links_begin_delete(self, resource_group): + async def test_replication_links_begin_update(self, resource_group): response = await ( - await self.client.replication_links.begin_delete( + await self.client.replication_links.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", + parameters={"id": "str", "name": "str", "properties": {"linkType": "str"}, "type": "str"}, ) ).result() # call '.result()' to poll until service return final result @@ -97,21 +92,31 @@ async def test_replication_links_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_replication_links_begin_update(self, resource_group): + async def test_replication_links_begin_delete(self, resource_group): response = await ( - await self.client.replication_links.begin_update( + await self.client.replication_links.begin_delete( resource_group_name=resource_group.name, server_name="str", database_name="str", link_id="str", - parameters={"id": "str", "linkType": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_replication_links_list_by_database(self, resource_group): + response = self.client.replication_links.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_replication_links_begin_failover(self, resource_group): @@ -121,7 +126,6 @@ async def test_replication_links_begin_failover(self, resource_group): server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -137,7 +141,6 @@ async def test_replication_links_begin_failover_allow_data_loss(self, resource_g server_name="str", database_name="str", link_id="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -150,7 +153,6 @@ async def test_replication_links_list_by_server(self, resource_group): response = self.client.replication_links.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations.py index 27c79774314b..71f79da625af 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorableDroppedDatabasesOperations(AzureMgmtRecordedTestCase): +class TestSqlRestorableDroppedDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restorable_dropped_databases_list_by_server(self, resource_group): - response = self.client.restorable_dropped_databases.list_by_server( + def test_restorable_dropped_databases_get(self, resource_group): + response = self.client.restorable_dropped_databases.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + restorable_dropped_database_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restorable_dropped_databases_get(self, resource_group): - response = self.client.restorable_dropped_databases.get( + def test_restorable_dropped_databases_list_by_server(self, resource_group): + response = self.client.restorable_dropped_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations_async.py index 70c623bc99bc..16c719c56f88 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_databases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorableDroppedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRestorableDroppedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restorable_dropped_databases_list_by_server(self, resource_group): - response = self.client.restorable_dropped_databases.list_by_server( + async def test_restorable_dropped_databases_get(self, resource_group): + response = await self.client.restorable_dropped_databases.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", + restorable_dropped_database_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restorable_dropped_databases_get(self, resource_group): - response = await self.client.restorable_dropped_databases.get( + async def test_restorable_dropped_databases_list_by_server(self, resource_group): + response = self.client.restorable_dropped_databases.list_by_server( resource_group_name=resource_group.name, server_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations.py index 426f31167f87..39ad3fdf9bfb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,31 +14,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorableDroppedManagedDatabasesOperations(AzureMgmtRecordedTestCase): +class TestSqlRestorableDroppedManagedDatabasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restorable_dropped_managed_databases_list_by_instance(self, resource_group): - response = self.client.restorable_dropped_managed_databases.list_by_instance( + def test_restorable_dropped_managed_databases_get(self, resource_group): + response = self.client.restorable_dropped_managed_databases.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + restorable_dropped_database_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restorable_dropped_managed_databases_get(self, resource_group): - response = self.client.restorable_dropped_managed_databases.get( + def test_restorable_dropped_managed_databases_list_by_instance(self, resource_group): + response = self.client.restorable_dropped_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations_async.py index 997af4db74e7..59bf402539d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restorable_dropped_managed_databases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restorable_dropped_managed_databases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,31 +15,29 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorableDroppedManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRestorableDroppedManagedDatabasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restorable_dropped_managed_databases_list_by_instance(self, resource_group): - response = self.client.restorable_dropped_managed_databases.list_by_instance( + async def test_restorable_dropped_managed_databases_get(self, resource_group): + response = await self.client.restorable_dropped_managed_databases.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", + restorable_dropped_database_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restorable_dropped_managed_databases_get(self, resource_group): - response = await self.client.restorable_dropped_managed_databases.get( + async def test_restorable_dropped_managed_databases_list_by_instance(self, resource_group): + response = self.client.restorable_dropped_managed_databases.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - restorable_dropped_database_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations.py index 1f416cf7a53c..0e05d6eefb42 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,61 +14,57 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorePointsOperations(AzureMgmtRecordedTestCase): +class TestSqlRestorePointsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restore_points_list_by_database(self, resource_group): - response = self.client.restore_points.list_by_database( + def test_restore_points_get(self, resource_group): + response = self.client.restore_points.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + restore_point_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restore_points_begin_create(self, resource_group): - response = self.client.restore_points.begin_create( + def test_restore_points_delete(self, resource_group): + response = self.client.restore_points.delete( resource_group_name=resource_group.name, server_name="str", database_name="str", - parameters={"restorePointLabel": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result + restore_point_name="str", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restore_points_get(self, resource_group): - response = self.client.restore_points.get( + def test_restore_points_list_by_database(self, resource_group): + response = self.client.restore_points.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - restore_point_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_restore_points_delete(self, resource_group): - response = self.client.restore_points.delete( + def test_restore_points_begin_create(self, resource_group): + response = self.client.restore_points.begin_create( resource_group_name=resource_group.name, server_name="str", database_name="str", - restore_point_name="str", - api_version="2025-01-01", - ) + parameters={"restorePointLabel": "str"}, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations_async.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations_async.py index 6281c80f7f5d..6ac97b0456f1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_restore_points_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_restore_points_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,48 +15,31 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementRestorePointsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlRestorePointsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restore_points_list_by_database(self, resource_group): - response = self.client.restore_points.list_by_database( + async def test_restore_points_get(self, resource_group): + response = await self.client.restore_points.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + restore_point_name="str", ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_restore_points_begin_create(self, resource_group): - response = await ( - await self.client.restore_points.begin_create( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - parameters={"restorePointLabel": "str"}, - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restore_points_get(self, resource_group): - response = await self.client.restore_points.get( + async def test_restore_points_delete(self, resource_group): + response = await self.client.restore_points.delete( resource_group_name=resource_group.name, server_name="str", database_name="str", restore_point_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -64,14 +47,27 @@ async def test_restore_points_get(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_restore_points_delete(self, resource_group): - response = await self.client.restore_points.delete( + async def test_restore_points_list_by_database(self, resource_group): + response = self.client.restore_points.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - restore_point_name="str", - api_version="2025-01-01", ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_restore_points_begin_create(self, resource_group): + response = await ( + await self.client.restore_points.begin_create( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + parameters={"restorePointLabel": "str"}, + ) + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations.py index 8d44275641ee..2006c5545a7d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSensitivityLabelsOperations(AzureMgmtRecordedTestCase): +class TestSqlSensitivityLabelsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_sensitivity_labels_list_current_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,33 +40,44 @@ def test_sensitivity_labels_update(self, resource_group): parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", + "properties": { + "column": "str", + "op": "str", + "schema": "str", + "table": "str", + "sensitivityLabel": { + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, }, - "table": "str", "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -80,7 +90,18 @@ def test_sensitivity_labels_list_recommended_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.sensitivity_labels.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ) result = [r for r in response] # please add some check logic here by yourself @@ -97,7 +118,6 @@ def test_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -113,24 +133,33 @@ def test_sensitivity_labels_create_or_update(self, resource_group): schema_name="str", table_name="str", column_name="str", + sensitivity_label_source="str", parameters={ - "clientClassificationSource": "str", - "columnName": "str", "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", "managedBy": "str", "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - sensitivity_label_source="current", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -146,8 +175,7 @@ def test_sensitivity_labels_delete(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="current", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -163,8 +191,7 @@ def test_sensitivity_labels_disable_recommendation(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -180,22 +207,8 @@ def test_sensitivity_labels_enable_recommendation(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sensitivity_labels_list_by_database(self, resource_group): - response = self.client.sensitivity_labels.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations_async.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations_async.py index b3c775fc7847..15f6081d9f9f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sensitivity_labels_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sensitivity_labels_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSensitivityLabelsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_sensitivity_labels_list_current_by_database(self, resource_group) resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,33 +41,44 @@ async def test_sensitivity_labels_update(self, resource_group): parameters={ "operations": [ { - "column": "str", "id": "str", "name": "str", - "op": "str", - "schema": "str", - "sensitivityLabel": { - "clientClassificationSource": "str", - "columnName": "str", - "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", - "managedBy": "str", - "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", - "type": "str", + "properties": { + "column": "str", + "op": "str", + "schema": "str", + "table": "str", + "sensitivityLabel": { + "id": "str", + "managedBy": "str", + "name": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, }, - "table": "str", "type": "str", } ] }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,7 +91,18 @@ async def test_sensitivity_labels_list_recommended_by_database(self, resource_gr resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sensitivity_labels_list_by_database(self, resource_group): + response = self.client.sensitivity_labels.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", ) result = [r async for r in response] # please add some check logic here by yourself @@ -98,7 +119,6 @@ async def test_sensitivity_labels_get(self, resource_group): table_name="str", column_name="str", sensitivity_label_source="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -114,24 +134,33 @@ async def test_sensitivity_labels_create_or_update(self, resource_group): schema_name="str", table_name="str", column_name="str", + sensitivity_label_source="str", parameters={ - "clientClassificationSource": "str", - "columnName": "str", "id": "str", - "informationType": "str", - "informationTypeId": "str", - "isDisabled": bool, - "labelId": "str", - "labelName": "str", "managedBy": "str", "name": "str", - "rank": "str", - "schemaName": "str", - "tableName": "str", + "properties": { + "clientClassificationSource": "str", + "columnName": "str", + "informationType": "str", + "informationTypeId": "str", + "isDisabled": bool, + "labelId": "str", + "labelName": "str", + "rank": "str", + "schemaName": "str", + "tableName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - sensitivity_label_source="current", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -147,8 +176,7 @@ async def test_sensitivity_labels_delete(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="current", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -164,8 +192,7 @@ async def test_sensitivity_labels_disable_recommendation(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself @@ -181,22 +208,8 @@ async def test_sensitivity_labels_enable_recommendation(self, resource_group): schema_name="str", table_name="str", column_name="str", - sensitivity_label_source="recommended", - api_version="2025-01-01", + sensitivity_label_source="str", ) # please add some check logic here by yourself # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sensitivity_labels_list_by_database(self, resource_group): - response = self.client.sensitivity_labels.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations.py index b0c5550008d4..48e8df2e2e1f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerAdvancedThreatProtectionSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_advanced_threat_protection_settings_list_by_server(self, resource_group): - response = self.client.server_advanced_threat_protection_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_advanced_threat_protection_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,10 +38,9 @@ def test_server_advanced_threat_protection_settings_begin_create_or_update(self, server_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,8 +51,18 @@ def test_server_advanced_threat_protection_settings_begin_create_or_update(self, }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_advanced_threat_protection_settings_list_by_server(self, resource_group): + response = self.client.server_advanced_threat_protection_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations_async.py similarity index 84% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations_async.py index 5c6ab4b06f76..f7110b7f9ac7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_advanced_threat_protection_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advanced_threat_protection_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerAdvancedThreatProtectionSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_advanced_threat_protection_settings_list_by_server(self, resource_group): - response = self.client.server_advanced_threat_protection_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_advanced_threat_protection_settings_get(self, resource_gro resource_group_name=resource_group.name, server_name="str", advanced_threat_protection_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,10 +40,9 @@ async def test_server_advanced_threat_protection_settings_begin_create_or_update server_name="str", advanced_threat_protection_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str", "creationTime": "2020-02-20 00:00:00"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -67,9 +53,19 @@ async def test_server_advanced_threat_protection_settings_begin_create_or_update }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_advanced_threat_protection_settings_list_by_server(self, resource_group): + response = self.client.server_advanced_threat_protection_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations.py new file mode 100644 index 000000000000..9ddb9593d888 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations.py @@ -0,0 +1,146 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlServerAdvisorsOperations(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_advisors_get(self, resource_group): + response = self.client.server_advisors.get( + resource_group_name=resource_group.name, + server_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_advisors_update(self, resource_group): + response = self.client.server_advisors.update( + resource_group_name=resource_group.name, + server_name="str", + advisor_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "autoExecuteStatus": "str", + "advisorStatus": "str", + "autoExecuteStatusInheritedFrom": "str", + "lastChecked": "2020-02-20 00:00:00", + "recommendationsStatus": "str", + "recommendedActions": [ + { + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": { + "currentValue": "str", + "actionInitiatedBy": "str", + "lastModified": "2020-02-20 00:00:00", + }, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_advisors_list_by_server(self, resource_group): + response = self.client.server_advisors.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations_async.py new file mode 100644 index 000000000000..9943874b3f42 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_advisors_operations_async.py @@ -0,0 +1,147 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlServerAdvisorsOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_advisors_get(self, resource_group): + response = await self.client.server_advisors.get( + resource_group_name=resource_group.name, + server_name="str", + advisor_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_advisors_update(self, resource_group): + response = await self.client.server_advisors.update( + resource_group_name=resource_group.name, + server_name="str", + advisor_name="str", + parameters={ + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "autoExecuteStatus": "str", + "advisorStatus": "str", + "autoExecuteStatusInheritedFrom": "str", + "lastChecked": "2020-02-20 00:00:00", + "recommendationsStatus": "str", + "recommendedActions": [ + { + "id": "str", + "kind": "str", + "location": "str", + "name": "str", + "properties": { + "state": { + "currentValue": "str", + "actionInitiatedBy": "str", + "lastModified": "2020-02-20 00:00:00", + }, + "details": {"str": "str"}, + "errorDetails": {"errorCode": "str", "isRetryable": "str"}, + "estimatedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "executeActionDuration": "1 day, 0:00:00", + "executeActionInitiatedBy": "str", + "executeActionInitiatedTime": "2020-02-20 00:00:00", + "executeActionStartTime": "2020-02-20 00:00:00", + "implementationDetails": {"method": "str", "script": "str"}, + "isArchivedAction": bool, + "isExecutableAction": bool, + "isRevertableAction": bool, + "lastRefresh": "2020-02-20 00:00:00", + "linkedObjects": ["str"], + "observedImpact": [ + { + "absoluteValue": 0.0, + "changeValueAbsolute": 0.0, + "changeValueRelative": 0.0, + "dimensionName": "str", + "unit": "str", + } + ], + "recommendationReason": "str", + "revertActionDuration": "1 day, 0:00:00", + "revertActionInitiatedBy": "str", + "revertActionInitiatedTime": "2020-02-20 00:00:00", + "revertActionStartTime": "2020-02-20 00:00:00", + "score": 0, + "timeSeries": [ + { + "metricName": "str", + "startTime": "2020-02-20 00:00:00", + "timeGrain": "str", + "unit": "str", + "value": 0.0, + } + ], + "validSince": "2020-02-20 00:00:00", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + } + ], + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_advisors_list_by_server(self, resource_group): + response = await self.client.server_advisors.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations.py index 8ad8a0097653..dd5899b90057 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAutomaticTuningOperations(AzureMgmtRecordedTestCase): +class TestSqlServerAutomaticTuningOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,7 +24,6 @@ def test_server_automatic_tuning_get(self, resource_group): response = self.client.server_automatic_tuning.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -37,14 +36,25 @@ def test_server_automatic_tuning_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", parameters={ - "actualState": "str", - "desiredState": "str", "id": "str", "name": "str", - "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, + "properties": { + "actualState": "str", + "desiredState": "str", + "options": { + "str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"} + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations_async.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations_async.py index 99473f8831a8..d58c9ac4ca4e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_automatic_tuning_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_automatic_tuning_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAutomaticTuningOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerAutomaticTuningOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -25,7 +25,6 @@ async def test_server_automatic_tuning_get(self, resource_group): response = await self.client.server_automatic_tuning.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -38,14 +37,25 @@ async def test_server_automatic_tuning_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", parameters={ - "actualState": "str", - "desiredState": "str", "id": "str", "name": "str", - "options": {"str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"}}, + "properties": { + "actualState": "str", + "desiredState": "str", + "options": { + "str": {"actualState": "str", "desiredState": "str", "reasonCode": 0, "reasonDesc": "str"} + }, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations.py index b0057cac1fc7..b93e9d0be29a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAzureADAdministratorsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerAzureADAdministratorsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_azure_ad_administrators_list_by_server(self, resource_group): - response = self.client.server_azure_ad_administrators.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_azure_ad_administrators_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,16 +38,25 @@ def test_server_azure_ad_administrators_begin_create_or_update(self, resource_gr server_name="str", administrator_name="str", parameters={ - "administratorType": "str", - "azureADOnlyAuthentication": bool, "id": "str", - "login": "str", "name": "str", - "sid": "str", - "tenantId": "str", + "properties": { + "login": "str", + "sid": "str", + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "tenantId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -73,8 +69,18 @@ def test_server_azure_ad_administrators_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_azure_ad_administrators_list_by_server(self, resource_group): + response = self.client.server_azure_ad_administrators.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations_async.py index 590f472c57b4..960b9f5d6501 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_administrators_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_administrators_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAzureADAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerAzureADAdministratorsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_azure_ad_administrators_list_by_server(self, resource_group): - response = self.client.server_azure_ad_administrators.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_azure_ad_administrators_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,16 +40,25 @@ async def test_server_azure_ad_administrators_begin_create_or_update(self, resou server_name="str", administrator_name="str", parameters={ - "administratorType": "str", - "azureADOnlyAuthentication": bool, "id": "str", - "login": "str", "name": "str", - "sid": "str", - "tenantId": "str", + "properties": { + "login": "str", + "sid": "str", + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "tenantId": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -77,9 +73,19 @@ async def test_server_azure_ad_administrators_begin_delete(self, resource_group) resource_group_name=resource_group.name, server_name="str", administrator_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_azure_ad_administrators_list_by_server(self, resource_group): + response = self.client.server_azure_ad_administrators.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations.py index 97e574137273..f141f50c57c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAzureADOnlyAuthenticationsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerAzureADOnlyAuthenticationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): - response = self.client.server_azure_ad_only_authentications.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_azure_ad_only_authentications_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,8 +37,20 @@ def test_server_azure_ad_only_authentications_begin_create_or_update(self, resou resource_group_name=resource_group.name, server_name="str", authentication_name="str", - parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"azureADOnlyAuthentication": bool}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,8 +63,18 @@ def test_server_azure_ad_only_authentications_begin_delete(self, resource_group) resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): + response = self.client.server_azure_ad_only_authentications.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations_async.py index e88801a29edd..08dafa3d4849 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_azure_ad_only_authentications_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_azure_ad_only_authentications_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerAzureADOnlyAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerAzureADOnlyAuthenticationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): - response = self.client.server_azure_ad_only_authentications.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_azure_ad_only_authentications_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,8 +39,20 @@ async def test_server_azure_ad_only_authentications_begin_create_or_update(self, resource_group_name=resource_group.name, server_name="str", authentication_name="str", - parameters={"azureADOnlyAuthentication": bool, "id": "str", "name": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"azureADOnlyAuthentication": bool}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -68,9 +67,19 @@ async def test_server_azure_ad_only_authentications_begin_delete(self, resource_ resource_group_name=resource_group.name, server_name="str", authentication_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_azure_ad_only_authentications_list_by_server(self, resource_group): + response = self.client.server_azure_ad_only_authentications.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations.py similarity index 62% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations.py index 2af2cafd03bf..b15933801acc 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerBlobAuditingPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_blob_auditing_policies_list_by_server(self, resource_group): - response = self.client.server_blob_auditing_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -36,8 +24,7 @@ def test_server_blob_auditing_policies_get(self, resource_group): response = self.client.server_blob_auditing_policies.get( resource_group_name=resource_group.name, server_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -49,25 +36,45 @@ def test_server_blob_auditing_policies_begin_create_or_update(self, resource_gro response = self.client.server_blob_auditing_policies.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isDevopsAuditEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isDevopsAuditEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_blob_auditing_policies_list_by_server(self, resource_group): + response = self.client.server_blob_auditing_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations_async.py similarity index 62% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations_async.py index ae8535de9b38..7dffa6e62e59 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_blob_auditing_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_blob_auditing_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerBlobAuditingPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_blob_auditing_policies_list_by_server(self, resource_group): - response = self.client.server_blob_auditing_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -37,8 +25,7 @@ async def test_server_blob_auditing_policies_get(self, resource_group): response = await self.client.server_blob_auditing_policies.get( resource_group_name=resource_group.name, server_name="str", - blob_auditing_policy_name="default", - api_version="2025-01-01", + blob_auditing_policy_name="str", ) # please add some check logic here by yourself @@ -51,26 +38,46 @@ async def test_server_blob_auditing_policies_begin_create_or_update(self, resour await self.client.server_blob_auditing_policies.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", + blob_auditing_policy_name="str", parameters={ - "auditActionsAndGroups": ["str"], "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isDevopsAuditEnabled": bool, - "isManagedIdentityInUse": bool, - "isStorageSecondaryKeyInUse": bool, "name": "str", - "queueDelayMs": 0, - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "auditActionsAndGroups": ["str"], + "isAzureMonitorTargetEnabled": bool, + "isDevopsAuditEnabled": bool, + "isManagedIdentityInUse": bool, + "isStorageSecondaryKeyInUse": bool, + "queueDelayMs": 0, + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - blob_auditing_policy_name="default", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_blob_auditing_policies_list_by_server(self, resource_group): + response = self.client.server_blob_auditing_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations.py index 4988febac186..b7ff1fa48df2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerConfigurationOptionsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerConfigurationOptionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_configuration_options_list_by_managed_instance(self, resource_group): - response = self.client.server_configuration_options.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_configuration_options_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", server_configuration_option_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,12 +40,29 @@ def test_server_configuration_options_begin_create_or_update(self, resource_grou parameters={ "id": "str", "name": "str", - "provisioningState": "str", - "serverConfigurationOptionValue": 0, + "properties": {"serverConfigurationOptionValue": 0, "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_configuration_options_list_by_managed_instance(self, resource_group): + response = self.client.server_configuration_options.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations_async.py similarity index 76% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations_async.py index 17bc7104cb98..0281ec44ed0b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_configuration_options_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_configuration_options_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerConfigurationOptionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerConfigurationOptionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_configuration_options_list_by_managed_instance(self, resource_group): - response = self.client.server_configuration_options.list_by_managed_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_configuration_options_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", server_configuration_option_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,13 +42,30 @@ async def test_server_configuration_options_begin_create_or_update(self, resourc parameters={ "id": "str", "name": "str", - "provisioningState": "str", - "serverConfigurationOptionValue": 0, + "properties": {"serverConfigurationOptionValue": 0, "provisioningState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_configuration_options_list_by_managed_instance(self, resource_group): + response = self.client.server_configuration_options.list_by_managed_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations.py index 902a234873ec..ca61a1f20417 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerConnectionPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerConnectionPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_connection_policies_list_by_server(self, resource_group): - response = self.client.server_connection_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_connection_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", connection_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,15 +38,33 @@ def test_server_connection_policies_begin_create_or_update(self, resource_group) server_name="str", connection_policy_name="str", parameters={ - "connectionType": "str", "id": "str", "kind": "str", "location": "str", "name": "str", + "properties": {"connectionType": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_connection_policies_list_by_server(self, resource_group): + response = self.client.server_connection_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations_async.py index b7c4c18e9ff0..b9aa36a6b5a3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_connection_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_connection_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerConnectionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerConnectionPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_connection_policies_list_by_server(self, resource_group): - response = self.client.server_connection_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_connection_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", connection_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,16 +40,34 @@ async def test_server_connection_policies_begin_create_or_update(self, resource_ server_name="str", connection_policy_name="str", parameters={ - "connectionType": "str", "id": "str", "kind": "str", "location": "str", "name": "str", + "properties": {"connectionType": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_connection_policies_list_by_server(self, resource_group): + response = self.client.server_connection_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations.py index 83a3ae20b1fa..3ddde01b4b63 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerDevOpsAuditSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerDevOpsAuditSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_dev_ops_audit_settings_list_by_server(self, resource_group): - response = self.client.server_dev_ops_audit_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_dev_ops_audit_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dev_ops_auditing_settings_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,13 +39,15 @@ def test_server_dev_ops_audit_settings_begin_create_or_update(self, resource_gro dev_ops_auditing_settings_name="str", parameters={ "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, "name": "str", - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -69,8 +58,18 @@ def test_server_dev_ops_audit_settings_begin_create_or_update(self, resource_gro }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_dev_ops_audit_settings_list_by_server(self, resource_group): + response = self.client.server_dev_ops_audit_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations_async.py index 1ead3f532d1d..51a132409464 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dev_ops_audit_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dev_ops_audit_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerDevOpsAuditSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerDevOpsAuditSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_dev_ops_audit_settings_list_by_server(self, resource_group): - response = self.client.server_dev_ops_audit_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_dev_ops_audit_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dev_ops_auditing_settings_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,13 +41,15 @@ async def test_server_dev_ops_audit_settings_begin_create_or_update(self, resour dev_ops_auditing_settings_name="str", parameters={ "id": "str", - "isAzureMonitorTargetEnabled": bool, - "isManagedIdentityInUse": bool, "name": "str", - "state": "str", - "storageAccountAccessKey": "str", - "storageAccountSubscriptionId": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "isAzureMonitorTargetEnabled": bool, + "isManagedIdentityInUse": bool, + "storageAccountAccessKey": "str", + "storageAccountSubscriptionId": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,9 +60,19 @@ async def test_server_dev_ops_audit_settings_begin_create_or_update(self, resour }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_dev_ops_audit_settings_list_by_server(self, resource_group): + response = self.client.server_dev_ops_audit_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations.py index 090bd5c825ad..50b835fdcbef 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerDnsAliasesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerDnsAliasesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_dns_aliases_list_by_server(self, resource_group): - response = self.client.server_dns_aliases.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -50,7 +37,6 @@ def test_server_dns_aliases_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -63,12 +49,22 @@ def test_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_dns_aliases_list_by_server(self, resource_group): + response = self.client.server_dns_aliases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_dns_aliases_begin_acquire(self, resource_group): @@ -77,7 +73,6 @@ def test_server_dns_aliases_begin_acquire(self, resource_group): server_name="str", dns_alias_name="str", parameters={"oldServerDnsAliasId": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations_async.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations_async.py index e01fa3a5ed5e..1a28ad433cdd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_dns_aliases_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_dns_aliases_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerDnsAliasesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerDnsAliasesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_dns_aliases_list_by_server(self, resource_group): - response = self.client.server_dns_aliases.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_dns_aliases_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,7 +39,6 @@ async def test_server_dns_aliases_begin_create_or_update(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -67,13 +53,23 @@ async def test_server_dns_aliases_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", dns_alias_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_dns_aliases_list_by_server(self, resource_group): + response = self.client.server_dns_aliases.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_dns_aliases_begin_acquire(self, resource_group): @@ -83,7 +79,6 @@ async def test_server_dns_aliases_begin_acquire(self, resource_group): server_name="str", dns_alias_name="str", parameters={"oldServerDnsAliasId": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations.py index 443f41ea3b5f..4817c8eb635c 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerKeysOperations(AzureMgmtRecordedTestCase): +class TestSqlServerKeysOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_keys_list_by_server(self, resource_group): - response = self.client.server_keys.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_keys_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,20 +38,29 @@ def test_server_keys_begin_create_or_update(self, resource_group): server_name="str", key_name="str", parameters={ - "autoRotationEnabled": bool, - "creationDate": "2020-02-20 00:00:00", "id": "str", - "keyVersion": "str", "kind": "str", "location": "str", "name": "str", - "serverKeyType": "str", - "subregion": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", + "subregion": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,8 +73,18 @@ def test_server_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_keys_list_by_server(self, resource_group): + response = self.client.server_keys.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations_async.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations_async.py index a4b72cb96bf2..949e44cc9c27 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_keys_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_keys_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerKeysOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerKeysOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_keys_list_by_server(self, resource_group): - response = self.client.server_keys.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_keys_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,20 +40,29 @@ async def test_server_keys_begin_create_or_update(self, resource_group): server_name="str", key_name="str", parameters={ - "autoRotationEnabled": bool, - "creationDate": "2020-02-20 00:00:00", "id": "str", - "keyVersion": "str", "kind": "str", "location": "str", "name": "str", - "serverKeyType": "str", - "subregion": "str", - "thumbprint": "str", + "properties": { + "serverKeyType": "str", + "autoRotationEnabled": bool, + "creationDate": "2020-02-20 00:00:00", + "keyVersion": "str", + "subregion": "str", + "thumbprint": "str", + "uri": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "uri": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -81,9 +77,19 @@ async def test_server_keys_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", key_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_keys_list_by_server(self, resource_group): + response = self.client.server_keys.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations.py index 4faade032193..44c078722b09 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerOperationsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerOperationsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,7 +24,6 @@ def test_server_operations_list_by_server(self, resource_group): response = self.client.server_operations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations_async.py index a57dbb3908e5..c2028575b94a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_operations_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_operations_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerOperationsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerOperationsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -25,7 +25,6 @@ async def test_server_operations_list_by_server(self, resource_group): response = self.client.server_operations.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations.py index 3b07b59133fc..30028ca2aa00 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerSecurityAlertPoliciesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_security_alert_policies_list_by_server(self, resource_group): - response = self.client.server_security_alert_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,16 +38,18 @@ def test_server_security_alert_policies_begin_create_or_update(self, resource_gr server_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -71,8 +60,18 @@ def test_server_security_alert_policies_begin_create_or_update(self, resource_gr }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_security_alert_policies_list_by_server(self, resource_group): + response = self.client.server_security_alert_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations_async.py index 5bd6d9ce598c..d4fc3f4f4c0f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_security_alert_policies_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_security_alert_policies_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerSecurityAlertPoliciesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_security_alert_policies_list_by_server(self, resource_group): - response = self.client.server_security_alert_policies.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_security_alert_policies_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", security_alert_policy_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,16 +40,18 @@ async def test_server_security_alert_policies_begin_create_or_update(self, resou server_name="str", security_alert_policy_name="str", parameters={ - "creationTime": "2020-02-20 00:00:00", - "disabledAlerts": ["str"], - "emailAccountAdmins": bool, - "emailAddresses": ["str"], "id": "str", "name": "str", - "retentionDays": 0, - "state": "str", - "storageAccountAccessKey": "str", - "storageEndpoint": "str", + "properties": { + "state": "str", + "creationTime": "2020-02-20 00:00:00", + "disabledAlerts": ["str"], + "emailAccountAdmins": bool, + "emailAddresses": ["str"], + "retentionDays": 0, + "storageAccountAccessKey": "str", + "storageEndpoint": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -73,9 +62,19 @@ async def test_server_security_alert_policies_begin_create_or_update(self, resou }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_security_alert_policies_list_by_server(self, resource_group): + response = self.client.server_security_alert_policies.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations.py index e323ed392a60..09c03a3dfd35 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerTrustCertificatesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerTrustCertificatesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_trust_certificates_list_by_instance(self, resource_group): - response = self.client.server_trust_certificates.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_trust_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,14 +38,19 @@ def test_server_trust_certificates_begin_create_or_update(self, resource_group): managed_instance_name="str", certificate_name="str", parameters={ - "certificateName": "str", "id": "str", "name": "str", - "publicBlob": "str", - "thumbprint": "str", + "properties": {"certificateName": "str", "publicBlob": "str", "thumbprint": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,8 +63,18 @@ def test_server_trust_certificates_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_trust_certificates_list_by_instance(self, resource_group): + response = self.client.server_trust_certificates.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations_async.py index 5fa4c6456a32..40ad2ae1888f 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_certificates_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerTrustCertificatesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerTrustCertificatesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_trust_certificates_list_by_instance(self, resource_group): - response = self.client.server_trust_certificates.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_trust_certificates_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,14 +40,19 @@ async def test_server_trust_certificates_begin_create_or_update(self, resource_g managed_instance_name="str", certificate_name="str", parameters={ - "certificateName": "str", "id": "str", "name": "str", - "publicBlob": "str", - "thumbprint": "str", + "properties": {"certificateName": "str", "publicBlob": "str", "thumbprint": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,9 +67,19 @@ async def test_server_trust_certificates_begin_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", certificate_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_trust_certificates_list_by_instance(self, resource_group): + response = self.client.server_trust_certificates.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations.py index c5c7c722980c..560836fd9d90 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerTrustGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerTrustGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_trust_groups_list_by_location(self, resource_group): - response = self.client.server_trust_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_trust_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,13 +38,19 @@ def test_server_trust_groups_begin_create_or_update(self, resource_group): location_name="str", server_trust_group_name="str", parameters={ - "groupMembers": [{"serverId": "str"}], "id": "str", "name": "str", - "trustScopes": ["str"], + "properties": {"groupMembers": [{"serverId": "str"}], "trustScopes": ["str"]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -70,19 +63,28 @@ def test_server_trust_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_trust_groups_list_by_location(self, resource_group): + response = self.client.server_trust_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_server_trust_groups_list_by_instance(self, resource_group): response = self.client.server_trust_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations_async.py index 2fbcabe8ef01..f678264ddc4d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_trust_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_trust_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerTrustGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerTrustGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_trust_groups_list_by_location(self, resource_group): - response = self.client.server_trust_groups.list_by_location( - resource_group_name=resource_group.name, - location_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_trust_groups_get(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,13 +40,19 @@ async def test_server_trust_groups_begin_create_or_update(self, resource_group): location_name="str", server_trust_group_name="str", parameters={ - "groupMembers": [{"serverId": "str"}], "id": "str", "name": "str", - "trustScopes": ["str"], + "properties": {"groupMembers": [{"serverId": "str"}], "trustScopes": ["str"]}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -74,20 +67,29 @@ async def test_server_trust_groups_begin_delete(self, resource_group): resource_group_name=resource_group.name, location_name="str", server_trust_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_trust_groups_list_by_location(self, resource_group): + response = self.client.server_trust_groups.list_by_location( + resource_group_name=resource_group.name, + location_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_server_trust_groups_list_by_instance(self, resource_group): response = self.client.server_trust_groups.list_by_instance( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations.py index 1df3780b34a7..05f5d976e865 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerUsagesOperations(AzureMgmtRecordedTestCase): +class TestSqlServerUsagesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,7 +24,6 @@ def test_server_usages_list_by_server(self, resource_group): response = self.client.server_usages.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations_async.py index 54ca4c46dcaa..c7f31f4ba4d3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_usages_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerUsagesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerUsagesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -25,7 +25,6 @@ async def test_server_usages_list_by_server(self, resource_group): response = self.client.server_usages.list_by_server( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations.py index 99f62607acee..92580df57804 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): +class TestSqlServerVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_server_vulnerability_assessments_list_by_server(self, resource_group): - response = self.client.server_vulnerability_assessments.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_server_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,13 +40,22 @@ def test_server_vulnerability_assessments_create_or_update(self, resource_group) parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "storageContainerPath": "str", + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -72,8 +68,18 @@ def test_server_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_server_vulnerability_assessments_list_by_server(self, resource_group): + response = self.client.server_vulnerability_assessments.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations_async.py similarity index 74% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations_async.py index 6bdb1de9b22e..6961ff187334 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_server_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_server_vulnerability_assessments_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServerVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServerVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_server_vulnerability_assessments_list_by_server(self, resource_group): - response = self.client.server_vulnerability_assessments.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_server_vulnerability_assessments_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,13 +41,22 @@ async def test_server_vulnerability_assessments_create_or_update(self, resource_ parameters={ "id": "str", "name": "str", - "recurringScans": {"emailSubscriptionAdmins": True, "emails": ["str"], "isEnabled": bool}, - "storageAccountAccessKey": "str", - "storageContainerPath": "str", - "storageContainerSasKey": "str", + "properties": { + "storageContainerPath": "str", + "recurringScans": {"emailSubscriptionAdmins": bool, "emails": ["str"], "isEnabled": bool}, + "storageAccountAccessKey": "str", + "storageContainerSasKey": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -73,8 +69,18 @@ async def test_server_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_server_vulnerability_assessments_list_by_server(self, resource_group): + response = self.client.server_vulnerability_assessments.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations.py similarity index 58% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations.py index 45b38a802208..8cc2ce85c427 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_servers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations.py @@ -2,76 +2,51 @@ # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql import SqlClient -from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer -from devtools_testutils.aio import recorded_by_proxy_async +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy AZURE_LOCATION = "eastus" @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementServersOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlServersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_check_name_availability(self, resource_group): - response = await self.client.servers.check_name_availability( - parameters={"name": "str", "type": "Microsoft.Sql/servers"}, - api_version="2025-01-01", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_list(self, resource_group): - response = self.client.servers.list( - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_list_by_resource_group(self, resource_group): - response = self.client.servers.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_get(self, resource_group): - response = await self.client.servers.get( + @recorded_by_proxy + def test_servers_get(self, resource_group): + response = self.client.servers.get( resource_group_name=resource_group.name, server_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_begin_create_or_update(self, resource_group): - response = await ( - await self.client.servers.begin_create_or_update( - resource_group_name=resource_group.name, - server_name="str", - parameters={ - "location": "str", + @recorded_by_proxy + def test_servers_begin_create_or_update(self, resource_group): + response = self.client.servers.begin_create_or_update( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "kind": "str", + "name": "str", + "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", "administrators": { @@ -86,18 +61,9 @@ async def test_servers_begin_create_or_update(self, resource_group): "externalGovernanceStatus": "str", "federatedClientId": "str", "fullyQualifiedDomainName": "str", - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "isIPv6Enabled": "str", "keyId": "str", - "kind": "str", "minimalTlsVersion": "str", - "name": "str", "primaryUserAssignedIdentityId": "str", "privateEndpointConnections": [ { @@ -118,40 +84,39 @@ async def test_servers_begin_create_or_update(self, resource_group): "restrictOutboundNetworkAccess": "str", "retentionDays": 0, "state": "str", - "tags": {"str": "str"}, - "type": "str", "version": "str", "workspaceFeature": "str", }, - api_version="2025-01-01", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_begin_delete(self, resource_group): - response = await ( - await self.client.servers.begin_delete( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_begin_update(self, resource_group): - response = await ( - await self.client.servers.begin_update( - resource_group_name=resource_group.name, - server_name="str", - parameters={ + @recorded_by_proxy + def test_servers_begin_update(self, resource_group): + response = self.client.servers.begin_update( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { "administratorLogin": "str", "administratorLoginPassword": "str", "administrators": { @@ -166,12 +131,6 @@ async def test_servers_begin_update(self, resource_group): "externalGovernanceStatus": "str", "federatedClientId": "str", "fullyQualifiedDomainName": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "isIPv6Enabled": "str", "keyId": "str", "minimalTlsVersion": "str", @@ -195,54 +154,86 @@ async def test_servers_begin_update(self, resource_group): "restrictOutboundNetworkAccess": "str", "retentionDays": 0, "state": "str", - "tags": {"str": "str"}, "version": "str", "workspaceFeature": "str", }, - api_version="2025-01-01", - ) + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_begin_import_database(self, resource_group): - response = await ( - await self.client.servers.begin_import_database( - resource_group_name=resource_group.name, - server_name="str", - parameters={ - "administratorLogin": "str", - "storageKey": "str", - "storageKeyType": "str", - "storageUri": "str", - "administratorLoginPassword": "str", - "authenticationType": "str", - "databaseName": "str", - "edition": "str", - "maxSizeBytes": "str", - "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, - "serviceObjectiveName": "str", - }, - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_servers_begin_delete(self, resource_group): + response = self.client.servers.begin_delete( + resource_group_name=resource_group.name, + server_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_servers_begin_refresh_status(self, resource_group): - response = await ( - await self.client.servers.begin_refresh_status( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) + @recorded_by_proxy + def test_servers_list_by_resource_group(self, resource_group): + response = self.client.servers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_servers_list(self, resource_group): + response = self.client.servers.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_servers_begin_import_database(self, resource_group): + response = self.client.servers.begin_import_database( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseName": "str", + "edition": "str", + "maxSizeBytes": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + "serviceObjectiveName": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_servers_begin_refresh_status(self, resource_group): + response = self.client.servers.begin_refresh_status( + resource_group_name=resource_group.name, + server_name="str", + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_servers_check_name_availability(self, resource_group): + response = self.client.servers.check_name_availability( + parameters={"name": "str", "type": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations_async.py new file mode 100644 index 000000000000..b887dbb82c69 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_servers_operations_async.py @@ -0,0 +1,250 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) Python Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +import pytest +from azure.mgmt.sql.aio import SqlClient + +from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer +from devtools_testutils.aio import recorded_by_proxy_async + +AZURE_LOCATION = "eastus" + + +@pytest.mark.skip("you may need to update the auto-generated test case before run it") +class TestSqlServersOperationsAsync(AzureMgmtRecordedTestCase): + def setup_method(self, method): + self.client = self.create_mgmt_client(SqlClient, is_async=True) + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_get(self, resource_group): + response = await self.client.servers.get( + resource_group_name=resource_group.name, + server_name="str", + ) + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_create_or_update(self, resource_group): + response = await ( + await self.client.servers.begin_create_or_update( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "location": "str", + "id": "str", + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "kind": "str", + "name": "str", + "properties": { + "administratorLogin": "str", + "administratorLoginPassword": "str", + "administrators": { + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "login": "str", + "principalType": "str", + "sid": "str", + "tenantId": "str", + }, + "createMode": "str", + "externalGovernanceStatus": "str", + "federatedClientId": "str", + "fullyQualifiedDomainName": "str", + "isIPv6Enabled": "str", + "keyId": "str", + "minimalTlsVersion": "str", + "primaryUserAssignedIdentityId": "str", + "privateEndpointConnections": [ + { + "id": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + } + ], + "publicNetworkAccess": "str", + "restrictOutboundNetworkAccess": "str", + "retentionDays": 0, + "state": "str", + "version": "str", + "workspaceFeature": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "tags": {"str": "str"}, + "type": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_update(self, resource_group): + response = await ( + await self.client.servers.begin_update( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "identity": { + "principalId": "str", + "tenantId": "str", + "type": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "properties": { + "administratorLogin": "str", + "administratorLoginPassword": "str", + "administrators": { + "administratorType": "str", + "azureADOnlyAuthentication": bool, + "login": "str", + "principalType": "str", + "sid": "str", + "tenantId": "str", + }, + "createMode": "str", + "externalGovernanceStatus": "str", + "federatedClientId": "str", + "fullyQualifiedDomainName": "str", + "isIPv6Enabled": "str", + "keyId": "str", + "minimalTlsVersion": "str", + "primaryUserAssignedIdentityId": "str", + "privateEndpointConnections": [ + { + "id": "str", + "properties": { + "groupIds": ["str"], + "privateEndpoint": {"id": "str"}, + "privateLinkServiceConnectionState": { + "description": "str", + "status": "str", + "actionsRequired": "str", + }, + "provisioningState": "str", + }, + } + ], + "publicNetworkAccess": "str", + "restrictOutboundNetworkAccess": "str", + "retentionDays": 0, + "state": "str", + "version": "str", + "workspaceFeature": "str", + }, + "tags": {"str": "str"}, + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_delete(self, resource_group): + response = await ( + await self.client.servers.begin_delete( + resource_group_name=resource_group.name, + server_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_list_by_resource_group(self, resource_group): + response = self.client.servers.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_list(self, resource_group): + response = self.client.servers.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_import_database(self, resource_group): + response = await ( + await self.client.servers.begin_import_database( + resource_group_name=resource_group.name, + server_name="str", + parameters={ + "administratorLogin": "str", + "storageKey": "str", + "storageKeyType": "str", + "storageUri": "str", + "administratorLoginPassword": "str", + "authenticationType": "str", + "databaseName": "str", + "edition": "str", + "maxSizeBytes": "str", + "networkIsolation": {"sqlServerResourceId": "str", "storageAccountResourceId": "str"}, + "serviceObjectiveName": "str", + }, + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_begin_refresh_status(self, resource_group): + response = await ( + await self.client.servers.begin_refresh_status( + resource_group_name=resource_group.name, + server_name="str", + ) + ).result() # call '.result()' to poll until service return final result + + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_servers_check_name_availability(self, resource_group): + response = await self.client.servers.check_name_availability( + parameters={"name": "str", "type": "str"}, + ) + + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations.py index e702ce3469ad..62cf613645c0 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlAgentOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlAgentOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,7 +24,6 @@ def test_sql_agent_get(self, resource_group): response = self.client.sql_agent.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -36,8 +35,20 @@ def test_sql_agent_create_or_update(self, resource_group): response = self.client.sql_agent.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations_async.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations_async.py index f47fcb3b481d..5d78ea2b7c48 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_agent_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_agent_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlAgentOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlAgentOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -25,7 +25,6 @@ async def test_sql_agent_get(self, resource_group): response = await self.client.sql_agent.get( resource_group_name=resource_group.name, managed_instance_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -37,8 +36,20 @@ async def test_sql_agent_create_or_update(self, resource_group): response = await self.client.sql_agent.create_or_update( resource_group_name=resource_group.name, managed_instance_name="str", - parameters={"id": "str", "name": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations.py index 47bd812f4121..3c1044f0636a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentBaselineOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentBaselineOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment(self, resource_group): - response = self.client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( + def test_sql_vulnerability_assessment_baseline_get(self, resource_group): + response = self.client.sql_vulnerability_assessment_baseline.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + baseline_name="str", + system_database_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_baseline_get(self, resource_group): - response = self.client.sql_vulnerability_assessment_baseline.get( + def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment(self, resource_group): + response = self.client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - baseline_name="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations_async.py index 14fde5505120..aef4c292e1d1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baseline_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baseline_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,35 +15,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentBaselineOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentBaselineOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment(self, resource_group): - response = self.client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( + async def test_sql_vulnerability_assessment_baseline_get(self, resource_group): + response = await self.client.sql_vulnerability_assessment_baseline.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + baseline_name="str", + system_database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_baseline_get(self, resource_group): - response = await self.client.sql_vulnerability_assessment_baseline.get( + async def test_sql_vulnerability_assessment_baseline_list_by_sql_vulnerability_assessment(self, resource_group): + response = self.client.sql_vulnerability_assessment_baseline.list_by_sql_vulnerability_assessment( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - baseline_name="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations.py index 174a2e21acee..a78f7fcaf076 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -28,9 +28,8 @@ def test_sql_vulnerability_assessment_baselines_create_or_update(self, resource_ baseline_name="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": {"str": [["str"]]}, + "properties": {"latestScan": bool, "results": {"str": [["str"]]}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -41,8 +40,7 @@ def test_sql_vulnerability_assessment_baselines_create_or_update(self, resource_ }, "type": "str", }, - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations_async.py index 0e349d4f94e1..129db989aa3e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -29,9 +29,8 @@ async def test_sql_vulnerability_assessment_baselines_create_or_update(self, res baseline_name="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": {"str": [["str"]]}, + "properties": {"latestScan": bool, "results": {"str": [["str"]]}}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -42,8 +41,7 @@ async def test_sql_vulnerability_assessment_baselines_create_or_update(self, res }, "type": "str", }, - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations.py index d4e64e55b378..a7d816ad431b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentExecuteScanOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentExecuteScanOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,8 +25,7 @@ def test_sql_vulnerability_assessment_execute_scan_begin_execute(self, resource_ resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations_async.py index 5ea5718df7fd..6aa720795710 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_execute_scan_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_execute_scan_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentExecuteScanOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentExecuteScanOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -27,8 +27,7 @@ async def test_sql_vulnerability_assessment_execute_scan_begin_execute(self, res resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations.py index 6bac8b4eeee1..466a76da533a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,24 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentRuleBaselineOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentRuleBaselineOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, resource_group): - response = self.client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( - resource_group_name=resource_group.name, - server_name="str", - vulnerability_assessment_name="str", - baseline_name="str", - system_database_name="master", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -42,8 +27,7 @@ def test_sql_vulnerability_assessment_rule_baseline_get(self, resource_group): vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself @@ -60,9 +44,8 @@ def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, resou rule_id="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": [["str"]], + "properties": {"latestScan": bool, "results": [["str"]]}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -73,9 +56,22 @@ def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, resou }, "type": "str", }, - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, resource_group): + response = self.client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( + resource_group_name=resource_group.name, + server_name="str", + vulnerability_assessment_name="str", + baseline_name="str", + system_database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations_async.py similarity index 82% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations_async.py index 1170b2793c2b..e5dfb067ab40 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baseline_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baseline_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,24 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentRuleBaselineOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentRuleBaselineOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, resource_group): - response = self.client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( - resource_group_name=resource_group.name, - server_name="str", - vulnerability_assessment_name="str", - baseline_name="str", - system_database_name="master", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -43,8 +28,7 @@ async def test_sql_vulnerability_assessment_rule_baseline_get(self, resource_gro vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself @@ -61,9 +45,8 @@ async def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, rule_id="str", parameters={ "id": "str", - "latestScan": bool, "name": "str", - "results": [["str"]], + "properties": {"latestScan": bool, "results": [["str"]]}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -74,9 +57,22 @@ async def test_sql_vulnerability_assessment_rule_baseline_create_or_update(self, }, "type": "str", }, - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_vulnerability_assessment_rule_baseline_list_by_baseline(self, resource_group): + response = self.client.sql_vulnerability_assessment_rule_baseline.list_by_baseline( + resource_group_name=resource_group.name, + server_name="str", + vulnerability_assessment_name="str", + baseline_name="str", + system_database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations.py index 6ad73c4890c4..335fd5a52fbb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentRuleBaselinesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -27,8 +27,7 @@ def test_sql_vulnerability_assessment_rule_baselines_delete(self, resource_group vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations_async.py index 941478a4e95e..82f42e1f72c7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_rule_baselines_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_rule_baselines_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentRuleBaselinesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -28,8 +28,7 @@ async def test_sql_vulnerability_assessment_rule_baselines_delete(self, resource vulnerability_assessment_name="str", baseline_name="str", rule_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations.py index 72002c9b0d24..7a6be30628c5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,37 +14,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentScanResultOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentScanResultOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): - response = self.client.sql_vulnerability_assessment_scan_result.list_by_scan( + def test_sql_vulnerability_assessment_scan_result_get(self, resource_group): + response = self.client.sql_vulnerability_assessment_scan_result.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", scan_id="str", - system_database_name="master", - api_version="2025-01-01", + scan_result_id="str", + system_database_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_scan_result_get(self, resource_group): - response = self.client.sql_vulnerability_assessment_scan_result.get( + def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): + response = self.client.sql_vulnerability_assessment_scan_result.list_by_scan( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", scan_id="str", - scan_result_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations_async.py index 2dcdfc51d18c..28883e36aeac 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scan_result_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scan_result_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,37 +15,35 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentScanResultOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentScanResultOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): - response = self.client.sql_vulnerability_assessment_scan_result.list_by_scan( + async def test_sql_vulnerability_assessment_scan_result_get(self, resource_group): + response = await self.client.sql_vulnerability_assessment_scan_result.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", scan_id="str", - system_database_name="master", - api_version="2025-01-01", + scan_result_id="str", + system_database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_scan_result_get(self, resource_group): - response = await self.client.sql_vulnerability_assessment_scan_result.get( + async def test_sql_vulnerability_assessment_scan_result_list_by_scan(self, resource_group): + response = self.client.sql_vulnerability_assessment_scan_result.list_by_scan( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", scan_id="str", - scan_result_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations.py index 0d78a45234be..bf4f6486dd03 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,35 +14,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentScansOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): - response = self.client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + def test_sql_vulnerability_assessment_scans_get(self, resource_group): + response = self.client.sql_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + scan_id="str", + system_database_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sql_vulnerability_assessment_scans_get(self, resource_group): - response = self.client.sql_vulnerability_assessment_scans.get( + def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): + response = self.client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - scan_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations_async.py index 815a8cc44d3b..930f97549dfd 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessment_scans_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessment_scans_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,35 +15,33 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentScansOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): - response = self.client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( + async def test_sql_vulnerability_assessment_scans_get(self, resource_group): + response = await self.client.sql_vulnerability_assessment_scans.get( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - system_database_name="master", - api_version="2025-01-01", + scan_id="str", + system_database_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sql_vulnerability_assessment_scans_get(self, resource_group): - response = await self.client.sql_vulnerability_assessment_scans.get( + async def test_sql_vulnerability_assessment_scans_list_by_sql_vulnerability_assessments(self, resource_group): + response = self.client.sql_vulnerability_assessment_scans.list_by_sql_vulnerability_assessments( resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - scan_id="str", - system_database_name="master", - api_version="2025-01-01", + system_database_name="str", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations.py index a95a36069ce1..9da86bcaede9 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_sql_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations_async.py index 302a6d1a7411..1d6ec4007361 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_sql_vulnerability_assessments_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations.py similarity index 86% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations.py index b5c1d5e70cec..87d189e72be8 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentsSettingsOperations(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentsSettingsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sql_vulnerability_assessments_settings_list_by_server(self, resource_group): - response = self.client.sql_vulnerability_assessments_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_sql_vulnerability_assessments_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,7 +40,7 @@ def test_sql_vulnerability_assessments_settings_create_or_update(self, resource_ parameters={ "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -64,8 +51,18 @@ def test_sql_vulnerability_assessments_settings_create_or_update(self, resource_ }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sql_vulnerability_assessments_settings_list_by_server(self, resource_group): + response = self.client.sql_vulnerability_assessments_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations_async.py similarity index 85% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations_async.py index b3b7737f8636..2a623f8595c3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sql_vulnerability_assessments_settings_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sql_vulnerability_assessments_settings_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSqlVulnerabilityAssessmentsSettingsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSqlVulnerabilityAssessmentsSettingsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sql_vulnerability_assessments_settings_list_by_server(self, resource_group): - response = self.client.sql_vulnerability_assessments_settings.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_sql_vulnerability_assessments_settings_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", vulnerability_assessment_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,7 +41,7 @@ async def test_sql_vulnerability_assessments_settings_create_or_update(self, res parameters={ "id": "str", "name": "str", - "state": "str", + "properties": {"state": "str"}, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,8 +52,18 @@ async def test_sql_vulnerability_assessments_settings_create_or_update(self, res }, "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sql_vulnerability_assessments_settings_list_by_server(self, resource_group): + response = self.client.sql_vulnerability_assessments_settings.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations.py index 2b4aa8c5e629..dbb58ffdef05 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementStartStopManagedInstanceSchedulesOperations(AzureMgmtRecordedTestCase): +class TestSqlStartStopManagedInstanceSchedulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_start_stop_managed_instance_schedules_list_by_instance(self, resource_group): - response = self.client.start_stop_managed_instance_schedules.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_start_stop_managed_instance_schedules_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,12 +38,15 @@ def test_start_stop_managed_instance_schedules_create_or_update(self, resource_g managed_instance_name="str", start_stop_schedule_name="str", parameters={ - "description": "", "id": "str", "name": "str", - "nextExecutionTime": "str", - "nextRunAction": "str", - "scheduleList": [{"startDay": "str", "startTime": "str", "stopDay": "str", "stopTime": "str"}], + "properties": { + "scheduleList": [{"startDay": "str", "startTime": "str", "stopDay": "str", "stopTime": "str"}], + "description": "str", + "nextExecutionTime": "str", + "nextRunAction": "str", + "timeZoneId": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -65,10 +55,8 @@ def test_start_stop_managed_instance_schedules_create_or_update(self, resource_g "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeZoneId": "UTC", "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -81,8 +69,18 @@ def test_start_stop_managed_instance_schedules_delete(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_start_stop_managed_instance_schedules_list_by_instance(self, resource_group): + response = self.client.start_stop_managed_instance_schedules.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations_async.py index e6ac3f38a385..15ff5628b118 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_start_stop_managed_instance_schedules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_start_stop_managed_instance_schedules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementStartStopManagedInstanceSchedulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlStartStopManagedInstanceSchedulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_start_stop_managed_instance_schedules_list_by_instance(self, resource_group): - response = self.client.start_stop_managed_instance_schedules.list_by_instance( - resource_group_name=resource_group.name, - managed_instance_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_start_stop_managed_instance_schedules_get(self, resource_group): resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,12 +39,15 @@ async def test_start_stop_managed_instance_schedules_create_or_update(self, reso managed_instance_name="str", start_stop_schedule_name="str", parameters={ - "description": "", "id": "str", "name": "str", - "nextExecutionTime": "str", - "nextRunAction": "str", - "scheduleList": [{"startDay": "str", "startTime": "str", "stopDay": "str", "stopTime": "str"}], + "properties": { + "scheduleList": [{"startDay": "str", "startTime": "str", "stopDay": "str", "stopTime": "str"}], + "description": "str", + "nextExecutionTime": "str", + "nextRunAction": "str", + "timeZoneId": "str", + }, "systemData": { "createdAt": "2020-02-20 00:00:00", "createdBy": "str", @@ -66,10 +56,8 @@ async def test_start_stop_managed_instance_schedules_create_or_update(self, reso "lastModifiedBy": "str", "lastModifiedByType": "str", }, - "timeZoneId": "UTC", "type": "str", }, - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -82,8 +70,18 @@ async def test_start_stop_managed_instance_schedules_delete(self, resource_group resource_group_name=resource_group.name, managed_instance_name="str", start_stop_schedule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_start_stop_managed_instance_schedules_list_by_instance(self, resource_group): + response = self.client.start_stop_managed_instance_schedules.list_by_instance( + resource_group_name=resource_group.name, + managed_instance_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations.py index 8db0f68ca534..6c8f95efc0b2 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,29 +14,27 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSubscriptionUsagesOperations(AzureMgmtRecordedTestCase): +class TestSqlSubscriptionUsagesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_subscription_usages_list_by_location(self, resource_group): - response = self.client.subscription_usages.list_by_location( + def test_subscription_usages_get(self, resource_group): + response = self.client.subscription_usages.get( location_name="str", - api_version="2025-01-01", + usage_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_subscription_usages_get(self, resource_group): - response = self.client.subscription_usages.get( + def test_subscription_usages_list_by_location(self, resource_group): + response = self.client.subscription_usages.list_by_location( location_name="str", - usage_name="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations_async.py index 243f31741872..761bcfb6663a 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_subscription_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_subscription_usages_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,29 +15,27 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSubscriptionUsagesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSubscriptionUsagesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_subscription_usages_list_by_location(self, resource_group): - response = self.client.subscription_usages.list_by_location( + async def test_subscription_usages_get(self, resource_group): + response = await self.client.subscription_usages.get( location_name="str", - api_version="2025-01-01", + usage_name="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_subscription_usages_get(self, resource_group): - response = await self.client.subscription_usages.get( + async def test_subscription_usages_list_by_location(self, resource_group): + response = self.client.subscription_usages.list_by_location( location_name="str", - usage_name="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations.py index e3b2682a5931..105e55114c06 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSynapseLinkWorkspacesOperations(AzureMgmtRecordedTestCase): +class TestSqlSynapseLinkWorkspacesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -25,7 +25,6 @@ def test_synapse_link_workspaces_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations_async.py index 0c205f32722c..9f58b764bcd1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_synapse_link_workspaces_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_synapse_link_workspaces_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSynapseLinkWorkspacesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSynapseLinkWorkspacesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,7 +26,6 @@ async def test_synapse_link_workspaces_list_by_database(self, resource_group): resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations.py index 73b2eb120438..528868177b41 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncAgentsOperations(AzureMgmtRecordedTestCase): +class TestSqlSyncAgentsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_agents_list_by_server(self, resource_group): - response = self.client.sync_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_sync_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -51,17 +38,27 @@ def test_sync_agents_begin_create_or_update(self, resource_group): server_name="str", sync_agent_name="str", parameters={ - "expiryTime": "2020-02-20 00:00:00", "id": "str", - "isUpToDate": bool, - "lastAliveTime": "2020-02-20 00:00:00", "name": "str", - "state": "str", - "syncDatabaseId": "str", + "properties": { + "expiryTime": "2020-02-20 00:00:00", + "isUpToDate": bool, + "lastAliveTime": "2020-02-20 00:00:00", + "name": "str", + "state": "str", + "syncDatabaseId": "str", + "version": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "version": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -74,12 +71,22 @@ def test_sync_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_agents_list_by_server(self, resource_group): + response = self.client.sync_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_sync_agents_generate_key(self, resource_group): @@ -87,7 +94,6 @@ def test_sync_agents_generate_key(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -100,7 +106,6 @@ def test_sync_agents_list_linked_databases(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations_async.py similarity index 78% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations_async.py index 151a73c7880c..f1d12e97a1d6 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_agents_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_agents_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncAgentsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSyncAgentsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_agents_list_by_server(self, resource_group): - response = self.client.sync_agents.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_sync_agents_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -53,17 +40,27 @@ async def test_sync_agents_begin_create_or_update(self, resource_group): server_name="str", sync_agent_name="str", parameters={ - "expiryTime": "2020-02-20 00:00:00", "id": "str", - "isUpToDate": bool, - "lastAliveTime": "2020-02-20 00:00:00", "name": "str", - "state": "str", - "syncDatabaseId": "str", + "properties": { + "expiryTime": "2020-02-20 00:00:00", + "isUpToDate": bool, + "lastAliveTime": "2020-02-20 00:00:00", + "name": "str", + "state": "str", + "syncDatabaseId": "str", + "version": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "version": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,13 +75,23 @@ async def test_sync_agents_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_agents_list_by_server(self, resource_group): + response = self.client.sync_agents.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_agents_generate_key(self, resource_group): @@ -92,7 +99,6 @@ async def test_sync_agents_generate_key(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -105,7 +111,6 @@ async def test_sync_agents_list_linked_databases(self, resource_group): resource_group_name=resource_group.name, server_name="str", sync_agent_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations.py index 1f6a5414955d..a8a548574b01 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,80 +14,126 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlSyncGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_list_sync_database_ids(self, resource_group): - response = self.client.sync_groups.list_sync_database_ids( - location_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_sync_groups_list_by_database(self, resource_group): - response = self.client.sync_groups.list_by_database( + def test_sync_groups_get(self, resource_group): + response = self.client.sync_groups.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + sync_group_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_get(self, resource_group): - response = self.client.sync_groups.get( + def test_sync_groups_begin_create_or_update(self, resource_group): + response = self.client.sync_groups.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", - ) + parameters={ + "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "conflictLoggingRetentionInDays": 0, + "conflictResolutionPolicy": "str", + "enableConflictLogging": bool, + "hubDatabasePassword": "str", + "hubDatabaseUserName": "str", + "interval": 0, + "lastSyncTime": "2020-02-20 00:00:00", + "privateEndpointName": "str", + "schema": { + "masterSyncMemberName": "str", + "tables": [ + { + "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], + "quotedName": "str", + } + ], + }, + "syncDatabaseId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_begin_create_or_update(self, resource_group): - response = self.client.sync_groups.begin_create_or_update( + def test_sync_groups_begin_update(self, resource_group): + response = self.client.sync_groups.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", parameters={ - "conflictLoggingRetentionInDays": 0, - "conflictResolutionPolicy": "str", - "enableConflictLogging": bool, - "hubDatabasePassword": "str", - "hubDatabaseUserName": "str", "id": "str", - "interval": 0, - "lastSyncTime": "2020-02-20 00:00:00", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", - "privateEndpointName": "str", - "schema": { - "masterSyncMemberName": "str", - "tables": [ - {"columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], "quotedName": "str"} - ], + "properties": { + "conflictLoggingRetentionInDays": 0, + "conflictResolutionPolicy": "str", + "enableConflictLogging": bool, + "hubDatabasePassword": "str", + "hubDatabaseUserName": "str", + "interval": 0, + "lastSyncTime": "2020-02-20 00:00:00", + "privateEndpointName": "str", + "schema": { + "masterSyncMemberName": "str", + "tables": [ + { + "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], + "quotedName": "str", + } + ], + }, + "syncDatabaseId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "syncDatabaseId": "str", - "syncState": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "usePrivateLinkConnection": bool, }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -101,7 +147,6 @@ def test_sync_groups_begin_delete(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -109,38 +154,13 @@ def test_sync_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_groups_begin_update(self, resource_group): - response = self.client.sync_groups.begin_update( + def test_sync_groups_list_by_database(self, resource_group): + response = self.client.sync_groups.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - sync_group_name="str", - parameters={ - "conflictLoggingRetentionInDays": 0, - "conflictResolutionPolicy": "str", - "enableConflictLogging": bool, - "hubDatabasePassword": "str", - "hubDatabaseUserName": "str", - "id": "str", - "interval": 0, - "lastSyncTime": "2020-02-20 00:00:00", - "name": "str", - "privateEndpointName": "str", - "schema": { - "masterSyncMemberName": "str", - "tables": [ - {"columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], "quotedName": "str"} - ], - }, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "syncDatabaseId": "str", - "syncState": "str", - "type": "str", - "usePrivateLinkConnection": bool, - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -152,7 +172,6 @@ def test_sync_groups_cancel_sync(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -166,7 +185,6 @@ def test_sync_groups_list_hub_schemas(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -183,7 +201,6 @@ def test_sync_groups_list_logs(self, resource_group): start_time="str", end_time="str", type="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself @@ -197,7 +214,6 @@ def test_sync_groups_begin_refresh_hub_schema(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -211,8 +227,17 @@ def test_sync_groups_trigger_sync(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_sync_groups_list_sync_database_ids(self, resource_group): + response = self.client.sync_groups.list_sync_database_ids( + location_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations_async.py similarity index 65% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations_async.py index b17fb7d05ed4..73f219466172 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,33 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSyncGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_list_sync_database_ids(self, resource_group): - response = self.client.sync_groups.list_sync_database_ids( - location_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_groups_list_by_database(self, resource_group): - response = self.client.sync_groups.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -51,7 +27,6 @@ async def test_sync_groups_get(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -67,32 +42,46 @@ async def test_sync_groups_begin_create_or_update(self, resource_group): database_name="str", sync_group_name="str", parameters={ - "conflictLoggingRetentionInDays": 0, - "conflictResolutionPolicy": "str", - "enableConflictLogging": bool, - "hubDatabasePassword": "str", - "hubDatabaseUserName": "str", "id": "str", - "interval": 0, - "lastSyncTime": "2020-02-20 00:00:00", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", - "privateEndpointName": "str", - "schema": { - "masterSyncMemberName": "str", - "tables": [ - { - "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], - "quotedName": "str", - } - ], + "properties": { + "conflictLoggingRetentionInDays": 0, + "conflictResolutionPolicy": "str", + "enableConflictLogging": bool, + "hubDatabasePassword": "str", + "hubDatabaseUserName": "str", + "interval": 0, + "lastSyncTime": "2020-02-20 00:00:00", + "privateEndpointName": "str", + "schema": { + "masterSyncMemberName": "str", + "tables": [ + { + "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], + "quotedName": "str", + } + ], + }, + "syncDatabaseId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, }, "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "syncDatabaseId": "str", - "syncState": "str", + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "usePrivateLinkConnection": bool, }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -101,14 +90,54 @@ async def test_sync_groups_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_groups_begin_delete(self, resource_group): + async def test_sync_groups_begin_update(self, resource_group): response = await ( - await self.client.sync_groups.begin_delete( + await self.client.sync_groups.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "conflictLoggingRetentionInDays": 0, + "conflictResolutionPolicy": "str", + "enableConflictLogging": bool, + "hubDatabasePassword": "str", + "hubDatabaseUserName": "str", + "interval": 0, + "lastSyncTime": "2020-02-20 00:00:00", + "privateEndpointName": "str", + "schema": { + "masterSyncMemberName": "str", + "tables": [ + { + "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], + "quotedName": "str", + } + ], + }, + "syncDatabaseId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + }, + "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -117,46 +146,31 @@ async def test_sync_groups_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_groups_begin_update(self, resource_group): + async def test_sync_groups_begin_delete(self, resource_group): response = await ( - await self.client.sync_groups.begin_update( + await self.client.sync_groups.begin_delete( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - parameters={ - "conflictLoggingRetentionInDays": 0, - "conflictResolutionPolicy": "str", - "enableConflictLogging": bool, - "hubDatabasePassword": "str", - "hubDatabaseUserName": "str", - "id": "str", - "interval": 0, - "lastSyncTime": "2020-02-20 00:00:00", - "name": "str", - "privateEndpointName": "str", - "schema": { - "masterSyncMemberName": "str", - "tables": [ - { - "columns": [{"dataSize": "str", "dataType": "str", "quotedName": "str"}], - "quotedName": "str", - } - ], - }, - "sku": {"name": "str", "capacity": 0, "family": "str", "size": "str", "tier": "str"}, - "syncDatabaseId": "str", - "syncState": "str", - "type": "str", - "usePrivateLinkConnection": bool, - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_list_by_database(self, resource_group): + response = self.client.sync_groups.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_groups_cancel_sync(self, resource_group): @@ -165,7 +179,6 @@ async def test_sync_groups_cancel_sync(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -179,7 +192,6 @@ async def test_sync_groups_list_hub_schemas(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -196,7 +208,6 @@ async def test_sync_groups_list_logs(self, resource_group): start_time="str", end_time="str", type="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself @@ -211,7 +222,6 @@ async def test_sync_groups_begin_refresh_hub_schema(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -226,8 +236,17 @@ async def test_sync_groups_trigger_sync(self, resource_group): server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_groups_list_sync_database_ids(self, resource_group): + response = self.client.sync_groups.list_sync_database_ids( + location_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations.py index 98cc7bf567c3..034fef94a857 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,66 +14,111 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncMembersOperations(AzureMgmtRecordedTestCase): +class TestSqlSyncMembersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_members_list_by_sync_group(self, resource_group): - response = self.client.sync_members.list_by_sync_group( + def test_sync_members_get(self, resource_group): + response = self.client.sync_members.get( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - api_version="2025-01-01", + sync_member_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_members_get(self, resource_group): - response = self.client.sync_members.get( + def test_sync_members_begin_create_or_update(self, resource_group): + response = self.client.sync_members.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", - ) + parameters={ + "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "databaseName": "str", + "databaseType": "str", + "password": "str", + "privateEndpointName": "str", + "serverName": "str", + "sqlServerDatabaseId": "str", + "syncAgentId": "str", + "syncDirection": "str", + "syncMemberAzureDatabaseResourceId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + "userName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_members_begin_create_or_update(self, resource_group): - response = self.client.sync_members.begin_create_or_update( + def test_sync_members_begin_update(self, resource_group): + response = self.client.sync_members.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", sync_member_name="str", parameters={ - "databaseName": "str", - "databaseType": "str", "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", - "password": "str", - "privateEndpointName": "str", - "serverName": "str", - "sqlServerDatabaseId": "str", - "syncAgentId": "str", - "syncDirection": "str", - "syncMemberAzureDatabaseResourceId": "str", - "syncState": "str", + "properties": { + "databaseName": "str", + "databaseType": "str", + "password": "str", + "privateEndpointName": "str", + "serverName": "str", + "sqlServerDatabaseId": "str", + "syncAgentId": "str", + "syncDirection": "str", + "syncMemberAzureDatabaseResourceId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + "userName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "usePrivateLinkConnection": bool, - "userName": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -88,7 +133,6 @@ def test_sync_members_begin_delete(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -96,33 +140,14 @@ def test_sync_members_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_sync_members_begin_update(self, resource_group): - response = self.client.sync_members.begin_update( + def test_sync_members_list_by_sync_group(self, resource_group): + response = self.client.sync_members.list_by_sync_group( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", - sync_member_name="str", - parameters={ - "databaseName": "str", - "databaseType": "str", - "id": "str", - "name": "str", - "password": "str", - "privateEndpointName": "str", - "serverName": "str", - "sqlServerDatabaseId": "str", - "syncAgentId": "str", - "syncDirection": "str", - "syncMemberAzureDatabaseResourceId": "str", - "syncState": "str", - "type": "str", - "usePrivateLinkConnection": bool, - "userName": "str", - }, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -135,7 +160,6 @@ def test_sync_members_begin_refresh_member_schema(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +174,6 @@ def test_sync_members_list_member_schemas(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations_async.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations_async.py index f183b795cec4..b3a57a27642b 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_sync_members_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_sync_members_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,23 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementSyncMembersOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlSyncMembersOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_sync_members_list_by_sync_group(self, resource_group): - response = self.client.sync_members.list_by_sync_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - sync_group_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -42,7 +28,6 @@ async def test_sync_members_get(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,23 +44,37 @@ async def test_sync_members_begin_create_or_update(self, resource_group): sync_group_name="str", sync_member_name="str", parameters={ - "databaseName": "str", - "databaseType": "str", "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, "name": "str", - "password": "str", - "privateEndpointName": "str", - "serverName": "str", - "sqlServerDatabaseId": "str", - "syncAgentId": "str", - "syncDirection": "str", - "syncMemberAzureDatabaseResourceId": "str", - "syncState": "str", + "properties": { + "databaseName": "str", + "databaseType": "str", + "password": "str", + "privateEndpointName": "str", + "serverName": "str", + "sqlServerDatabaseId": "str", + "syncAgentId": "str", + "syncDirection": "str", + "syncMemberAzureDatabaseResourceId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + "userName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "usePrivateLinkConnection": bool, - "userName": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -84,15 +83,46 @@ async def test_sync_members_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_members_begin_delete(self, resource_group): + async def test_sync_members_begin_update(self, resource_group): response = await ( - await self.client.sync_members.begin_delete( + await self.client.sync_members.begin_update( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", + parameters={ + "id": "str", + "identity": { + "type": "str", + "tenantId": "str", + "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, + }, + "name": "str", + "properties": { + "databaseName": "str", + "databaseType": "str", + "password": "str", + "privateEndpointName": "str", + "serverName": "str", + "sqlServerDatabaseId": "str", + "syncAgentId": "str", + "syncDirection": "str", + "syncMemberAzureDatabaseResourceId": "str", + "syncState": "str", + "usePrivateLinkConnection": bool, + "userName": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result @@ -101,38 +131,33 @@ async def test_sync_members_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_sync_members_begin_update(self, resource_group): + async def test_sync_members_begin_delete(self, resource_group): response = await ( - await self.client.sync_members.begin_update( + await self.client.sync_members.begin_delete( resource_group_name=resource_group.name, server_name="str", database_name="str", sync_group_name="str", sync_member_name="str", - parameters={ - "databaseName": "str", - "databaseType": "str", - "id": "str", - "name": "str", - "password": "str", - "privateEndpointName": "str", - "serverName": "str", - "sqlServerDatabaseId": "str", - "syncAgentId": "str", - "syncDirection": "str", - "syncMemberAzureDatabaseResourceId": "str", - "syncState": "str", - "type": "str", - "usePrivateLinkConnection": bool, - "userName": "str", - }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_sync_members_list_by_sync_group(self, resource_group): + response = self.client.sync_members.list_by_sync_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + sync_group_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_sync_members_begin_refresh_member_schema(self, resource_group): @@ -143,7 +168,6 @@ async def test_sync_members_begin_refresh_member_schema(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -159,7 +183,6 @@ async def test_sync_members_list_member_schemas(self, resource_group): database_name="str", sync_group_name="str", sync_member_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations.py index b638149c417c..da92b766e3ba 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTdeCertificatesOperations(AzureMgmtRecordedTestCase): +class TestSqlTdeCertificatesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,8 +24,12 @@ def test_tde_certificates_begin_create(self, resource_group): response = self.client.tde_certificates.begin_create( resource_group_name=resource_group.name, server_name="str", - parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"privateBlob": "str", "certPassword": "str"}, + "type": "str", + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations_async.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations_async.py index e91a48adadd1..0e53355f8137 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_tde_certificates_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_tde_certificates_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTdeCertificatesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlTdeCertificatesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -26,8 +26,12 @@ async def test_tde_certificates_begin_create(self, resource_group): await self.client.tde_certificates.begin_create( resource_group_name=resource_group.name, server_name="str", - parameters={"certPassword": "str", "id": "str", "name": "str", "privateBlob": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"privateBlob": "str", "certPassword": "str"}, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations.py index 1d1ab12b1684..755635aa07f3 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,29 +14,27 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTimeZonesOperations(AzureMgmtRecordedTestCase): +class TestSqlTimeZonesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_time_zones_list_by_location(self, resource_group): - response = self.client.time_zones.list_by_location( + def test_time_zones_get(self, resource_group): + response = self.client.time_zones.get( location_name="str", - api_version="2025-01-01", + time_zone_id="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_time_zones_get(self, resource_group): - response = self.client.time_zones.get( + def test_time_zones_list_by_location(self, resource_group): + response = self.client.time_zones.list_by_location( location_name="str", - time_zone_id="str", - api_version="2025-01-01", ) - + result = [r for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations_async.py index 24744dbde626..1c8228c7aad4 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_time_zones_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_time_zones_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,29 +15,27 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTimeZonesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlTimeZonesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_time_zones_list_by_location(self, resource_group): - response = self.client.time_zones.list_by_location( + async def test_time_zones_get(self, resource_group): + response = await self.client.time_zones.get( location_name="str", - api_version="2025-01-01", + time_zone_id="str", ) - result = [r async for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_time_zones_get(self, resource_group): - response = await self.client.time_zones.get( + async def test_time_zones_list_by_location(self, resource_group): + response = self.client.time_zones.list_by_location( location_name="str", - time_zone_id="str", - api_version="2025-01-01", ) - + result = [r async for r in response] # please add some check logic here by yourself # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations.py index 7b547aadf584..6101e15c9ea1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,49 +14,59 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTransparentDataEncryptionsOperations(AzureMgmtRecordedTestCase): +class TestSqlTransparentDataEncryptionsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_transparent_data_encryptions_list_by_database(self, resource_group): - response = self.client.transparent_data_encryptions.list_by_database( + def test_transparent_data_encryptions_get(self, resource_group): + response = self.client.transparent_data_encryptions.get( resource_group_name=resource_group.name, server_name="str", database_name="str", - api_version="2025-01-01", + tde_name="str", ) - result = [r for r in response] + # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_transparent_data_encryptions_get(self, resource_group): - response = self.client.transparent_data_encryptions.get( + def test_transparent_data_encryptions_begin_create_or_update(self, resource_group): + response = self.client.transparent_data_encryptions.begin_create_or_update( resource_group_name=resource_group.name, server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", - ) + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str", "scanState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, + ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_transparent_data_encryptions_begin_create_or_update(self, resource_group): - response = self.client.transparent_data_encryptions.begin_create_or_update( + def test_transparent_data_encryptions_list_by_database(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_database( resource_group_name=resource_group.name, server_name="str", database_name="str", - tde_name="str", - parameters={"id": "str", "name": "str", "scanState": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", - ).result() # call '.result()' to poll until service return final result - + ) + result = [r for r in response] # please add some check logic here by yourself # ... @@ -68,7 +78,6 @@ def test_transparent_data_encryptions_begin_resume(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,7 +91,6 @@ def test_transparent_data_encryptions_begin_suspend(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations_async.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations_async.py index dedda0035d96..40dc1c89742e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_transparent_data_encryptions_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_transparent_data_encryptions_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementTransparentDataEncryptionsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlTransparentDataEncryptionsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_transparent_data_encryptions_list_by_database(self, resource_group): - response = self.client.transparent_data_encryptions.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_transparent_data_encryptions_get(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,14 +41,38 @@ async def test_transparent_data_encryptions_begin_create_or_update(self, resourc server_name="str", database_name="str", tde_name="str", - parameters={"id": "str", "name": "str", "scanState": "str", "state": "str", "type": "str"}, - api_version="2025-01-01", + parameters={ + "id": "str", + "name": "str", + "properties": {"state": "str", "scanState": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, + "type": "str", + }, ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_transparent_data_encryptions_list_by_database(self, resource_group): + response = self.client.transparent_data_encryptions.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_transparent_data_encryptions_begin_resume(self, resource_group): @@ -72,7 +82,6 @@ async def test_transparent_data_encryptions_begin_resume(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -88,7 +97,6 @@ async def test_transparent_data_encryptions_begin_suspend(self, resource_group): server_name="str", database_name="str", tde_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations.py index e6908d868c7f..cbc994fcd4a1 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,9 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementUsagesOperations(AzureMgmtRecordedTestCase): +class TestSqlUsagesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -24,7 +24,6 @@ def test_usages_list_by_instance_pool(self, resource_group): response = self.client.usages.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations_async.py similarity index 79% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations_async.py index 1a0763b696e0..dbfddb0272b7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_usages_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_usages_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,9 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementUsagesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlUsagesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -25,7 +25,6 @@ async def test_usages_list_by_instance_pool(self, resource_group): response = self.client.usages.list_by_instance_pool( resource_group_name=resource_group.name, instance_pool_name="str", - api_version="2025-01-01", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations.py similarity index 80% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations.py index b3e12646157e..34ffa24ce4b7 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,30 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementVirtualClustersOperations(AzureMgmtRecordedTestCase): +class TestSqlVirtualClustersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_virtual_clusters_list(self, resource_group): - response = self.client.virtual_clusters.list( - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_virtual_clusters_list_by_resource_group(self, resource_group): - response = self.client.virtual_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -45,7 +24,6 @@ def test_virtual_clusters_get(self, resource_group): response = self.client.virtual_clusters.get( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,15 +37,20 @@ def test_virtual_clusters_begin_create_or_update(self, resource_group): virtual_cluster_name="str", parameters={ "location": "str", - "childResources": ["str"], "id": "str", "name": "str", - "subnetId": "str", + "properties": {"childResources": ["str"], "subnetId": "str", "version": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "version": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -75,11 +58,14 @@ def test_virtual_clusters_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_virtual_clusters_begin_delete(self, resource_group): - response = self.client.virtual_clusters.begin_delete( + def test_virtual_clusters_begin_update(self, resource_group): + response = self.client.virtual_clusters.begin_update( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", + parameters={ + "properties": {"childResources": ["str"], "subnetId": "str", "version": "str"}, + "tags": {"str": "str"}, + }, ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -87,24 +73,39 @@ def test_virtual_clusters_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_virtual_clusters_begin_update(self, resource_group): - response = self.client.virtual_clusters.begin_update( + def test_virtual_clusters_begin_delete(self, resource_group): + response = self.client.virtual_clusters.begin_delete( resource_group_name=resource_group.name, virtual_cluster_name="str", - parameters={"childResources": ["str"], "subnetId": "str", "tags": {"str": "str"}, "version": "str"}, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_clusters_list_by_resource_group(self, resource_group): + response = self.client.virtual_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_clusters_list(self, resource_group): + response = self.client.virtual_clusters.list() + result = [r for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_virtual_clusters_begin_update_dns_servers(self, resource_group): response = self.client.virtual_clusters.begin_update_dns_servers( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations_async.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations_async.py index aacd87c6dfff..61c1fd160bfb 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_clusters_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_clusters_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,30 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementVirtualClustersOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlVirtualClustersOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_virtual_clusters_list(self, resource_group): - response = self.client.virtual_clusters.list( - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_virtual_clusters_list_by_resource_group(self, resource_group): - response = self.client.virtual_clusters.list_by_resource_group( - resource_group_name=resource_group.name, - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -46,7 +25,6 @@ async def test_virtual_clusters_get(self, resource_group): response = await self.client.virtual_clusters.get( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -61,15 +39,20 @@ async def test_virtual_clusters_begin_create_or_update(self, resource_group): virtual_cluster_name="str", parameters={ "location": "str", - "childResources": ["str"], "id": "str", "name": "str", - "subnetId": "str", + "properties": {"childResources": ["str"], "subnetId": "str", "version": "str"}, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "tags": {"str": "str"}, "type": "str", - "version": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -78,12 +61,15 @@ async def test_virtual_clusters_begin_create_or_update(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_virtual_clusters_begin_delete(self, resource_group): + async def test_virtual_clusters_begin_update(self, resource_group): response = await ( - await self.client.virtual_clusters.begin_delete( + await self.client.virtual_clusters.begin_update( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", + parameters={ + "properties": {"childResources": ["str"], "subnetId": "str", "version": "str"}, + "tags": {"str": "str"}, + }, ) ).result() # call '.result()' to poll until service return final result @@ -92,19 +78,35 @@ async def test_virtual_clusters_begin_delete(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_virtual_clusters_begin_update(self, resource_group): + async def test_virtual_clusters_begin_delete(self, resource_group): response = await ( - await self.client.virtual_clusters.begin_update( + await self.client.virtual_clusters.begin_delete( resource_group_name=resource_group.name, virtual_cluster_name="str", - parameters={"childResources": ["str"], "subnetId": "str", "tags": {"str": "str"}, "version": "str"}, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_clusters_list_by_resource_group(self, resource_group): + response = self.client.virtual_clusters.list_by_resource_group( + resource_group_name=resource_group.name, + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_clusters_list(self, resource_group): + response = self.client.virtual_clusters.list() + result = [r async for r in response] + # please add some check logic here by yourself + # ... + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_virtual_clusters_begin_update_dns_servers(self, resource_group): @@ -112,7 +114,6 @@ async def test_virtual_clusters_begin_update_dns_servers(self, resource_group): await self.client.virtual_clusters.begin_update_dns_servers( resource_group_name=resource_group.name, virtual_cluster_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations.py index b622ec2d1b77..319a9317ba28 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,21 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementVirtualNetworkRulesOperations(AzureMgmtRecordedTestCase): +class TestSqlVirtualNetworkRulesOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_virtual_network_rules_list_by_server(self, resource_group): - response = self.client.virtual_network_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -37,7 +25,6 @@ def test_virtual_network_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -52,13 +39,22 @@ def test_virtual_network_rules_begin_create_or_update(self, resource_group): virtual_network_rule_name="str", parameters={ "id": "str", - "ignoreMissingVnetServiceEndpoint": bool, "name": "str", - "state": "str", + "properties": { + "virtualNetworkSubnetId": "str", + "ignoreMissingVnetServiceEndpoint": bool, + "state": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "virtualNetworkSubnetId": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -71,8 +67,18 @@ def test_virtual_network_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_virtual_network_rules_list_by_server(self, resource_group): + response = self.client.virtual_network_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations_async.py index c4f8a8fff355..0b4cd5c9bd0d 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_virtual_network_rules_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_virtual_network_rules_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,21 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementVirtualNetworkRulesOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlVirtualNetworkRulesOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_virtual_network_rules_list_by_server(self, resource_group): - response = self.client.virtual_network_rules.list_by_server( - resource_group_name=resource_group.name, - server_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -38,7 +26,6 @@ async def test_virtual_network_rules_get(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -54,13 +41,22 @@ async def test_virtual_network_rules_begin_create_or_update(self, resource_group virtual_network_rule_name="str", parameters={ "id": "str", - "ignoreMissingVnetServiceEndpoint": bool, "name": "str", - "state": "str", + "properties": { + "virtualNetworkSubnetId": "str", + "ignoreMissingVnetServiceEndpoint": bool, + "state": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", - "virtualNetworkSubnetId": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -75,9 +71,19 @@ async def test_virtual_network_rules_begin_delete(self, resource_group): resource_group_name=resource_group.name, server_name="str", virtual_network_rule_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_virtual_network_rules_list_by_server(self, resource_group): + response = self.client.virtual_network_rules.list_by_server( + resource_group_name=resource_group.name, + server_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations.py index d3d9f71d4909..70a9cf5408b5 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,23 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementWorkloadClassifiersOperations(AzureMgmtRecordedTestCase): +class TestSqlWorkloadClassifiersOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workload_classifiers_list_by_workload_group(self, resource_group): - response = self.client.workload_classifiers.list_by_workload_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - workload_group_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -41,7 +27,6 @@ def test_workload_classifiers_get(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,17 +42,26 @@ def test_workload_classifiers_begin_create_or_update(self, resource_group): workload_group_name="str", workload_classifier_name="str", parameters={ - "context": "str", - "endTime": "str", "id": "str", - "importance": "str", - "label": "str", - "memberName": "str", "name": "str", - "startTime": "str", + "properties": { + "memberName": "str", + "context": "str", + "endTime": "str", + "importance": "str", + "label": "str", + "startTime": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -82,8 +76,20 @@ def test_workload_classifiers_begin_delete(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_workload_classifiers_list_by_workload_group(self, resource_group): + response = self.client.workload_classifiers.list_by_workload_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + workload_group_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations_async.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations_async.py index 1c721e750a22..5d6a50ff9d24 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_classifiers_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_classifiers_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,23 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementWorkloadClassifiersOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlWorkloadClassifiersOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workload_classifiers_list_by_workload_group(self, resource_group): - response = self.client.workload_classifiers.list_by_workload_group( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - workload_group_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -42,7 +28,6 @@ async def test_workload_classifiers_get(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -59,17 +44,26 @@ async def test_workload_classifiers_begin_create_or_update(self, resource_group) workload_group_name="str", workload_classifier_name="str", parameters={ - "context": "str", - "endTime": "str", "id": "str", - "importance": "str", - "label": "str", - "memberName": "str", "name": "str", - "startTime": "str", + "properties": { + "memberName": "str", + "context": "str", + "endTime": "str", + "importance": "str", + "label": "str", + "startTime": "str", + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -86,9 +80,21 @@ async def test_workload_classifiers_begin_delete(self, resource_group): database_name="str", workload_group_name="str", workload_classifier_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_workload_classifiers_list_by_workload_group(self, resource_group): + response = self.client.workload_classifiers.list_by_workload_group( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + workload_group_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations.py index c356e0b77e98..10c1ac37c034 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql import SqlManagementClient +from azure.mgmt.sql import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer, recorded_by_proxy @@ -14,22 +14,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementWorkloadGroupsOperations(AzureMgmtRecordedTestCase): +class TestSqlWorkloadGroupsOperations(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_workload_groups_list_by_database(self, resource_group): - response = self.client.workload_groups.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy @@ -39,7 +26,6 @@ def test_workload_groups_get(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -55,16 +41,25 @@ def test_workload_groups_begin_create_or_update(self, resource_group): workload_group_name="str", parameters={ "id": "str", - "importance": "str", - "maxResourcePercent": 0, - "maxResourcePercentPerRequest": 0.0, - "minResourcePercent": 0, - "minResourcePercentPerRequest": 0.0, "name": "str", - "queryExecutionTimeout": 0, + "properties": { + "maxResourcePercent": 0, + "minResourcePercent": 0, + "minResourcePercentPerRequest": 0.0, + "importance": "str", + "maxResourcePercentPerRequest": 0.0, + "queryExecutionTimeout": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,8 +73,19 @@ def test_workload_groups_begin_delete(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2025-01-01", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy + def test_workload_groups_list_by_database(self, resource_group): + response = self.client.workload_groups.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations_async.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py rename to sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations_async.py index 943a8bf3659b..49daeb32d75e 100644 --- a/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_management_workload_groups_operations_async.py +++ b/sdk/sql/azure-mgmt-sql/generated_tests/test_sql_workload_groups_operations_async.py @@ -2,11 +2,11 @@ # -------------------------------------------------------------------------- # 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. +# Code generated by Microsoft (R) Python Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- import pytest -from azure.mgmt.sql.aio import SqlManagementClient +from azure.mgmt.sql.aio import SqlClient from devtools_testutils import AzureMgmtRecordedTestCase, RandomNameResourceGroupPreparer from devtools_testutils.aio import recorded_by_proxy_async @@ -15,22 +15,9 @@ @pytest.mark.skip("you may need to update the auto-generated test case before run it") -class TestSqlManagementWorkloadGroupsOperationsAsync(AzureMgmtRecordedTestCase): +class TestSqlWorkloadGroupsOperationsAsync(AzureMgmtRecordedTestCase): def setup_method(self, method): - self.client = self.create_mgmt_client(SqlManagementClient, is_async=True) - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_workload_groups_list_by_database(self, resource_group): - response = self.client.workload_groups.list_by_database( - resource_group_name=resource_group.name, - server_name="str", - database_name="str", - api_version="2025-01-01", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... + self.client = self.create_mgmt_client(SqlClient, is_async=True) @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async @@ -40,7 +27,6 @@ async def test_workload_groups_get(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2025-01-01", ) # please add some check logic here by yourself @@ -57,16 +43,25 @@ async def test_workload_groups_begin_create_or_update(self, resource_group): workload_group_name="str", parameters={ "id": "str", - "importance": "str", - "maxResourcePercent": 0, - "maxResourcePercentPerRequest": 0.0, - "minResourcePercent": 0, - "minResourcePercentPerRequest": 0.0, "name": "str", - "queryExecutionTimeout": 0, + "properties": { + "maxResourcePercent": 0, + "minResourcePercent": 0, + "minResourcePercentPerRequest": 0.0, + "importance": "str", + "maxResourcePercentPerRequest": 0.0, + "queryExecutionTimeout": 0, + }, + "systemData": { + "createdAt": "2020-02-20 00:00:00", + "createdBy": "str", + "createdByType": "str", + "lastModifiedAt": "2020-02-20 00:00:00", + "lastModifiedBy": "str", + "lastModifiedByType": "str", + }, "type": "str", }, - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result @@ -82,9 +77,20 @@ async def test_workload_groups_begin_delete(self, resource_group): server_name="str", database_name="str", workload_group_name="str", - api_version="2025-01-01", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... + + @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) + @recorded_by_proxy_async + async def test_workload_groups_list_by_database(self, resource_group): + response = self.client.workload_groups.list_by_database( + resource_group_name=resource_group.name, + server_name="str", + database_name="str", + ) + result = [r async for r in response] + # please add some check logic here by yourself + # ... diff --git a/sdk/sql/azure-mgmt-sql/pyproject.toml b/sdk/sql/azure-mgmt-sql/pyproject.toml index 6dd291c9eeeb..70c8a60253f3 100644 --- a/sdk/sql/azure-mgmt-sql/pyproject.toml +++ b/sdk/sql/azure-mgmt-sql/pyproject.toml @@ -13,7 +13,7 @@ authors = [ description = "Microsoft Azure Sql Management Client Library for Python" license = "MIT" classifiers = [ - "Development Status :: 5 - Production/Stable", + "Development Status :: 4 - Beta", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", @@ -78,7 +78,7 @@ verifytypes = false package_name = "azure-mgmt-sql" package_pprint_name = "SQL Management" package_doc_id = "sql" -is_stable = true +is_stable = false sample_link = "" title = "SqlManagementClient" package_nspkg = "azure-mgmt-nspkg" diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql.py index b092c13a3c7f..4a1bad9ca99f 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_auth.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_auth.py index ccc2494cc095..b4e97291ea90 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_auth.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_auth.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_database.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_database.py index ce4810120e4d..836379012adb 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_database.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_database.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression,too-many-lines # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_elastic_pool.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_elastic_pool.py index 9ff9218f41e9..02c7055ae380 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_elastic_pool.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_failover_group.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_failover_group.py index 116bd6993240..e665d3611af5 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_failover_group.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_failover_group.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_job.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_job.py index a7b3b76ecf65..bcec6ddaeb8d 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_job.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_job.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_managed_db.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_managed_db.py index 1a1955b6f541..abe4340945b0 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_managed_db.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_managed_db.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_server.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_server.py index b08575867506..cd4779f2b42c 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_server.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_server.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_sync.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_sync.py index 4b5964b300e0..ff3af2ad0524 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_sync.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_sync.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_vulnerability_assessment.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_vulnerability_assessment.py index f501dd3b2774..3c6f1e7a0a72 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_vulnerability_assessment.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_cli_mgmt_sql_vulnerability_assessment.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/disable_test_mgmt_sql.py b/sdk/sql/azure-mgmt-sql/tests/disable_test_mgmt_sql.py index db1a729e9a31..5ba7e1c8236d 100644 --- a/sdk/sql/azure-mgmt-sql/tests/disable_test_mgmt_sql.py +++ b/sdk/sql/azure-mgmt-sql/tests/disable_test_mgmt_sql.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py b/sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py index 42527427f559..077ff03f694f 100644 --- a/sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/tests/test_cli_mgmt_sql_managed_instance.py @@ -1,3 +1,4 @@ +# pylint: disable=line-too-long,useless-suppression # coding: utf-8 # ------------------------------------------------------------------------- diff --git a/sdk/sql/azure-mgmt-sql/tsp-location.yaml b/sdk/sql/azure-mgmt-sql/tsp-location.yaml new file mode 100644 index 000000000000..510cceff3185 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/sql/resource-manager/Microsoft.Sql/SQL +commit: 3256c6764d5edc188ae06b8e20a180ac484bbfb7 +repo: Azure/azure-rest-api-specs +additionalDirectories: From d0db91766ed2ad8de28b45d041f437dd5f3a2038 Mon Sep 17 00:00:00 2001 From: ChenxiJiang333 Date: Wed, 1 Apr 2026 18:00:45 +0800 Subject: [PATCH 3/3] changelog from report comparison --- .../breaking_changes_checker/changelog_tracker.py | 5 ++++- sdk/sql/azure-mgmt-sql/CHANGELOG.md | 15 +++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/breaking_changes_checker/changelog_tracker.py b/scripts/breaking_changes_checker/changelog_tracker.py index 3f8254b48186..0978fbba1f38 100644 --- a/scripts/breaking_changes_checker/changelog_tracker.py +++ b/scripts/breaking_changes_checker/changelog_tracker.py @@ -186,7 +186,10 @@ def _build_md(content: list, title: str, buffer: list): for _, bc in enumerate(content): # Extract the message, skip the change type and the module name msg, _, _,*args = bc - buffer.append(" - " + msg.format(*args)) + try: + buffer.append(" - " + msg.format(*args)) + except (IndexError, KeyError): + buffer.append(" - " + msg) buffer.append("") return buffer diff --git a/sdk/sql/azure-mgmt-sql/CHANGELOG.md b/sdk/sql/azure-mgmt-sql/CHANGELOG.md index fefef261667c..68305f45f4c7 100644 --- a/sdk/sql/azure-mgmt-sql/CHANGELOG.md +++ b/sdk/sql/azure-mgmt-sql/CHANGELOG.md @@ -1,8 +1,19 @@ # Release History -## 4.0.0b25 (2026-04-01) +## 4.0.0b25 (2026-04-02) -skip changelog generation +### Features Added + + - This version is generated from TypeSpec with API version `2025-02-01-preview` + - Client `SqlManagementClient` added method `send_request` + +### Breaking Changes + + - This version is now generated from TypeSpec. Breaking changes may exist comparing to the previous version + - Enum `MinimalTlsVersion` renamed its member `ENUM_1.0` to `TLS1_0` + - Enum `MinimalTlsVersion` renamed its member `ENUM_1.1` to `TLS1_1` + - Enum `MinimalTlsVersion` renamed its member `ENUM_1.2` to `TLS1_2` + - Enum `MinimalTlsVersion` renamed its member `ENUM_1.3` to `TLS1_3` ## 3.1.0 (2026-04-01)